@medialane/ui 0.392.0 → 0.393.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/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/drop/create/asset-editor.d.cts +2 -1
- package/dist/components/drop/create/asset-editor.d.ts +2 -1
- package/dist/components/drop/create/assets-panel.d.cts +2 -1
- package/dist/components/drop/create/assets-panel.d.ts +2 -1
- package/dist/components/drop/create/collection-panel.cjs +1 -1
- package/dist/components/drop/create/collection-panel.cjs.map +1 -1
- package/dist/components/drop/create/collection-panel.d.cts +2 -1
- package/dist/components/drop/create/collection-panel.d.ts +2 -1
- package/dist/components/drop/create/collection-panel.js +1 -1
- package/dist/components/drop/create/collection-panel.js.map +1 -1
- package/dist/components/drop/create/drop-create.cjs +1 -1
- package/dist/components/drop/create/drop-create.cjs.map +1 -1
- package/dist/components/drop/create/drop-create.d.cts +2 -1
- package/dist/components/drop/create/drop-create.d.ts +2 -1
- package/dist/components/drop/create/drop-create.js +1 -1
- package/dist/components/drop/create/drop-create.js.map +1 -1
- package/dist/components/drop/create/drop-fields.cjs +2 -2
- package/dist/components/drop/create/drop-fields.cjs.map +1 -1
- package/dist/components/drop/create/drop-fields.d.cts +3 -2
- package/dist/components/drop/create/drop-fields.d.ts +3 -2
- package/dist/components/drop/create/drop-fields.js +2 -2
- package/dist/components/drop/create/drop-fields.js.map +1 -1
- package/dist/components/drop/create/drop-panel.cjs +1 -1
- package/dist/components/drop/create/drop-panel.cjs.map +1 -1
- package/dist/components/drop/create/drop-panel.d.cts +3 -2
- package/dist/components/drop/create/drop-panel.d.ts +3 -2
- package/dist/components/drop/create/drop-panel.js +1 -1
- package/dist/components/drop/create/drop-panel.js.map +1 -1
- package/dist/components/drop/create/launch-dialog.d.cts +2 -1
- package/dist/components/drop/create/launch-dialog.d.ts +2 -1
- package/dist/components/drop/create/settings-panel.d.cts +2 -1
- package/dist/components/drop/create/settings-panel.d.ts +2 -1
- package/dist/components/drop/drop-features.cjs +3 -3
- package/dist/components/drop/drop-features.cjs.map +1 -1
- package/dist/components/drop/drop-features.js +3 -3
- package/dist/components/drop/drop-features.js.map +1 -1
- package/dist/components/drop/drop-status.d.cts +1 -0
- package/dist/components/drop/drop-status.d.ts +1 -0
- package/dist/components/drop/page/drop-action-box.cjs +4 -4
- package/dist/components/drop/page/drop-action-box.cjs.map +1 -1
- package/dist/components/drop/page/drop-action-box.d.cts +1 -0
- package/dist/components/drop/page/drop-action-box.d.ts +1 -0
- package/dist/components/drop/page/drop-action-box.js +4 -4
- package/dist/components/drop/page/drop-action-box.js.map +1 -1
- package/dist/components/drop/page/drop-mint-dialog.cjs +1 -1
- package/dist/components/drop/page/drop-mint-dialog.cjs.map +1 -1
- package/dist/components/drop/page/drop-mint-dialog.d.cts +2 -1
- package/dist/components/drop/page/drop-mint-dialog.d.ts +2 -1
- package/dist/components/drop/page/drop-mint-dialog.js +1 -1
- package/dist/components/drop/page/drop-mint-dialog.js.map +1 -1
- package/dist/components/drop/page/drop-page.cjs +4 -8
- package/dist/components/drop/page/drop-page.cjs.map +1 -1
- package/dist/components/drop/page/drop-page.js +5 -9
- package/dist/components/drop/page/drop-page.js.map +1 -1
- package/dist/{draft-DaQIVRMX.d.ts → draft-B0fPlVZS.d.ts} +6 -5
- package/dist/{draft-CuU1m9P3.d.cts → draft-Bw3JWkOZ.d.cts} +6 -5
- package/dist/i18n/catalog/pt.cjs +29 -7
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +29 -7
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/translate.cjs.map +1 -1
- package/dist/i18n/translate.d.cts +5 -1
- package/dist/i18n/translate.d.ts +5 -1
- package/dist/i18n/translate.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/utils/drop/draft-store.d.cts +2 -1
- package/dist/utils/drop/draft-store.d.ts +2 -1
- package/dist/utils/drop/draft.cjs +11 -14
- package/dist/utils/drop/draft.cjs.map +1 -1
- package/dist/utils/drop/draft.d.cts +2 -1
- package/dist/utils/drop/draft.d.ts +2 -1
- package/dist/utils/drop/draft.js +11 -14
- package/dist/utils/drop/draft.js.map +1 -1
- package/dist/utils/drop/metadata.d.cts +2 -1
- package/dist/utils/drop/metadata.d.ts +2 -1
- package/dist/utils/drop/sale.cjs +10 -9
- package/dist/utils/drop/sale.cjs.map +1 -1
- package/dist/utils/drop/sale.d.cts +3 -2
- package/dist/utils/drop/sale.d.ts +3 -2
- package/dist/utils/drop/sale.js +10 -9
- package/dist/utils/drop/sale.js.map +1 -1
- package/dist/utils/drop/view.cjs +15 -13
- package/dist/utils/drop/view.cjs.map +1 -1
- package/dist/utils/drop/view.d.cts +6 -4
- package/dist/utils/drop/view.d.ts +6 -4
- package/dist/utils/drop/view.js +15 -13
- package/dist/utils/drop/view.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { a as DropDraft, b as DropDraftErrors } from '../../../draft-
|
|
3
|
+
import { a as DropDraft, b as DropDraftErrors } from '../../../draft-Bw3JWkOZ.cjs';
|
|
4
|
+
import { Phrase } from '../../../i18n/translate.cjs';
|
|
4
5
|
import '@medialane/sdk';
|
|
5
6
|
import '../../../utils/drop/sale.cjs';
|
|
6
7
|
|
|
@@ -15,7 +16,7 @@ declare function DropPanel({ icon, title, summary, error, open, onToggle, childr
|
|
|
15
16
|
icon: ReactNode;
|
|
16
17
|
title: string;
|
|
17
18
|
summary: ReactNode;
|
|
18
|
-
error?:
|
|
19
|
+
error?: Phrase;
|
|
19
20
|
open: boolean;
|
|
20
21
|
onToggle: () => void;
|
|
21
22
|
children: ReactNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { a as DropDraft, b as DropDraftErrors } from '../../../draft-
|
|
3
|
+
import { a as DropDraft, b as DropDraftErrors } from '../../../draft-B0fPlVZS.js';
|
|
4
|
+
import { Phrase } from '../../../i18n/translate.js';
|
|
4
5
|
import '@medialane/sdk';
|
|
5
6
|
import '../../../utils/drop/sale.js';
|
|
6
7
|
|
|
@@ -15,7 +16,7 @@ declare function DropPanel({ icon, title, summary, error, open, onToggle, childr
|
|
|
15
16
|
icon: ReactNode;
|
|
16
17
|
title: string;
|
|
17
18
|
summary: ReactNode;
|
|
18
|
-
error?:
|
|
19
|
+
error?: Phrase;
|
|
19
20
|
open: boolean;
|
|
20
21
|
onToggle: () => void;
|
|
21
22
|
children: ReactNode;
|
|
@@ -18,7 +18,7 @@ function DropPanel({ icon, title, summary, error, open, onToggle, children }) {
|
|
|
18
18
|
/* @__PURE__ */ jsx(IconTile, { size: "sm", className: "h-10 w-10 [&_svg]:h-5 [&_svg]:w-5", children: icon }),
|
|
19
19
|
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
20
20
|
/* @__PURE__ */ jsx("span", { className: "block text-[15px] font-semibold", children: title }),
|
|
21
|
-
error ? /* @__PURE__ */ jsx("span", { className: "block text-sm text-destructive", children: t(error) }) : /* @__PURE__ */ jsx("span", { className: "block text-sm text-muted-foreground", children: summary })
|
|
21
|
+
error ? /* @__PURE__ */ jsx("span", { className: "block text-sm text-destructive", children: t(error.text, error.vars) }) : /* @__PURE__ */ jsx("span", { className: "block text-sm text-muted-foreground", children: summary })
|
|
22
22
|
] }),
|
|
23
23
|
/* @__PURE__ */ jsx(ChevronDown, { className: cn("h-4 w-4 shrink-0 text-muted-foreground transition-transform", open && "rotate-180") })
|
|
24
24
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/drop/create/drop-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { IconTile } from \"../../icon-tile.js\";\nimport { cn } from \"../../../utils/cn.js\";\nimport type { DropDraft, DropDraftErrors } from \"../../../utils/drop/draft.js\";\nimport { useT } from \"../../../i18n/provider.js\";\n\nexport interface PanelProps {\n draft: DropDraft;\n setDraft: (patch: Partial<DropDraft>) => void;\n errors: DropDraftErrors;\n open: boolean;\n onToggle: () => void;\n}\n\nexport function DropPanel({ icon, title, summary, error, open, onToggle, children }: {\n icon: ReactNode;\n title: string;\n summary: ReactNode;\n error?:
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/drop/create/drop-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { IconTile } from \"../../icon-tile.js\";\nimport { cn } from \"../../../utils/cn.js\";\nimport type { DropDraft, DropDraftErrors } from \"../../../utils/drop/draft.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport type { Phrase } from \"../../../i18n/translate.js\";\n\nexport interface PanelProps {\n draft: DropDraft;\n setDraft: (patch: Partial<DropDraft>) => void;\n errors: DropDraftErrors;\n open: boolean;\n onToggle: () => void;\n}\n\nexport function DropPanel({ icon, title, summary, error, open, onToggle, children }: {\n icon: ReactNode;\n title: string;\n summary: ReactNode;\n error?: Phrase;\n open: boolean;\n onToggle: () => void;\n children: ReactNode;\n}) {\n const t = useT();\n return (\n <section className=\"rounded-2xl border border-border bg-background\">\n <button type=\"button\" aria-expanded={open} onClick={onToggle}\n className=\"flex w-full items-center gap-3.5 rounded-2xl p-4 text-left transition-colors hover:bg-muted/30 sm:p-5\">\n <IconTile size=\"sm\" className=\"h-10 w-10 [&_svg]:h-5 [&_svg]:w-5\">{icon}</IconTile>\n <span className=\"min-w-0 flex-1 space-y-1\">\n <span className=\"block text-[15px] font-semibold\">{title}</span>\n {error\n ? <span className=\"block text-sm text-destructive\">{t(error.text, error.vars)}</span>\n : <span className=\"block text-sm text-muted-foreground\">{summary}</span>}\n </span>\n <ChevronDown className={cn(\"h-4 w-4 shrink-0 text-muted-foreground transition-transform\", open && \"rotate-180\")} />\n </button>\n {open && <div className=\"space-y-5 border-t border-border/60 p-4 sm:p-5\">{children}</div>}\n </section>\n );\n}\n"],"mappings":";AAgCQ,cACA,YADA;AA7BR,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,UAAU;AAEnB,SAAS,YAAY;AAWd,SAAS,UAAU,EAAE,MAAM,OAAO,SAAS,OAAO,MAAM,UAAU,SAAS,GAQ/E;AACD,QAAM,IAAI,KAAK;AACf,SACE,qBAAC,aAAQ,WAAU,kDACjB;AAAA;AAAA,MAAC;AAAA;AAAA,QAAO,MAAK;AAAA,QAAS,iBAAe;AAAA,QAAM,SAAS;AAAA,QAClD,WAAU;AAAA,QACV;AAAA,8BAAC,YAAS,MAAK,MAAK,WAAU,qCAAqC,gBAAK;AAAA,UACxE,qBAAC,UAAK,WAAU,4BACd;AAAA,gCAAC,UAAK,WAAU,mCAAmC,iBAAM;AAAA,YACxD,QACG,oBAAC,UAAK,WAAU,kCAAkC,YAAE,MAAM,MAAM,MAAM,IAAI,GAAE,IAC5E,oBAAC,UAAK,WAAU,uCAAuC,mBAAQ;AAAA,aACrE;AAAA,UACA,oBAAC,eAAY,WAAW,GAAG,+DAA+D,QAAQ,YAAY,GAAG;AAAA;AAAA;AAAA,IACnH;AAAA,IACC,QAAQ,oBAAC,SAAI,WAAU,kDAAkD,UAAS;AAAA,KACrF;AAEJ;","names":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as DropDraft } from '../../../draft-
|
|
2
|
+
import { a as DropDraft } from '../../../draft-Bw3JWkOZ.cjs';
|
|
3
3
|
import '@medialane/sdk';
|
|
4
4
|
import '../../../utils/drop/sale.cjs';
|
|
5
|
+
import '../../../i18n/translate.cjs';
|
|
5
6
|
|
|
6
7
|
declare function LaunchDialog({ open, onClose, draft, onLaunched }: {
|
|
7
8
|
open: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as DropDraft } from '../../../draft-
|
|
2
|
+
import { a as DropDraft } from '../../../draft-B0fPlVZS.js';
|
|
3
3
|
import '@medialane/sdk';
|
|
4
4
|
import '../../../utils/drop/sale.js';
|
|
5
|
+
import '../../../i18n/translate.js';
|
|
5
6
|
|
|
6
7
|
declare function LaunchDialog({ open, onClose, draft, onLaunched }: {
|
|
7
8
|
open: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { PanelProps } from './drop-panel.cjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../../../draft-
|
|
4
|
+
import '../../../draft-Bw3JWkOZ.cjs';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '../../../utils/drop/sale.cjs';
|
|
7
|
+
import '../../../i18n/translate.cjs';
|
|
7
8
|
|
|
8
9
|
declare function SettingsPanel({ draft, setDraft, errors, open, onToggle }: PanelProps): react_jsx_runtime.JSX.Element;
|
|
9
10
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { PanelProps } from './drop-panel.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import '../../../draft-
|
|
4
|
+
import '../../../draft-B0fPlVZS.js';
|
|
5
5
|
import '@medialane/sdk';
|
|
6
6
|
import '../../../utils/drop/sale.js';
|
|
7
|
+
import '../../../i18n/translate.js';
|
|
7
8
|
|
|
8
9
|
declare function SettingsPanel({ draft, setDraft, errors, open, onToggle }: PanelProps): react_jsx_runtime.JSX.Element;
|
|
9
10
|
|
|
@@ -27,9 +27,9 @@ var import_lucide_react = require("lucide-react");
|
|
|
27
27
|
var import_translate = require("../../i18n/translate.js");
|
|
28
28
|
var import_provider = require("../../i18n/provider.js");
|
|
29
29
|
const FEATURES = [
|
|
30
|
-
{ icon: import_lucide_react.Layers, title: (0, import_translate.msg)("
|
|
31
|
-
{ icon: import_lucide_react.Timer, title: (0, import_translate.msg)("
|
|
32
|
-
{ icon: import_lucide_react.Users, title: (0, import_translate.msg)("
|
|
30
|
+
{ icon: import_lucide_react.Layers, title: (0, import_translate.msg)("Copies per asset"), desc: (0, import_translate.msg)("One artwork or many, each with its own copies.") },
|
|
31
|
+
{ icon: import_lucide_react.Timer, title: (0, import_translate.msg)("A sale window"), desc: (0, import_translate.msg)("Start and end on any date.") },
|
|
32
|
+
{ icon: import_lucide_react.Users, title: (0, import_translate.msg)("Open or by list"), desc: (0, import_translate.msg)("Everyone or listed wallets only.") },
|
|
33
33
|
{ icon: import_lucide_react.Package, title: (0, import_translate.msg)("Collectors own them"), desc: (0, import_translate.msg)("Collectors own every token.") }
|
|
34
34
|
];
|
|
35
35
|
function DropFeatures() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/drop/drop-features.tsx"],"sourcesContent":["\"use client\";\n\nimport { Layers, Package, Timer, Users } from \"lucide-react\";\nimport { msg } from \"../../i18n/translate.js\";\n\nimport { useT } from \"../../i18n/provider.js\";\nconst FEATURES = [\n { icon: Layers, title: msg(\"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drop/drop-features.tsx"],"sourcesContent":["\"use client\";\n\nimport { Layers, Package, Timer, Users } from \"lucide-react\";\nimport { msg } from \"../../i18n/translate.js\";\n\nimport { useT } from \"../../i18n/provider.js\";\nconst FEATURES = [\n { icon: Layers, title: msg(\"Copies per asset\"), desc: msg(\"One artwork or many, each with its own copies.\") },\n { icon: Timer, title: msg(\"A sale window\"), desc: msg(\"Start and end on any date.\") },\n { icon: Users, title: msg(\"Open or by list\"), desc: msg(\"Everyone or listed wallets only.\") },\n { icon: Package, title: msg(\"Collectors own them\"), desc: msg(\"Collectors own every token.\") },\n];\n\nexport function DropFeatures() {\n const t = useT();\n return (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n {FEATURES.map(({ icon: Icon, title, desc }) => (\n <div key={title} className=\"panel relative overflow-hidden p-4 space-y-2\">\n <Icon className=\"h-5 w-5 text-brand-orange\" />\n <p className=\"text-sm font-semibold leading-tight\">{t(title)}</p>\n <p className=\"text-xs text-muted-foreground leading-relaxed\">{t(desc)}</p>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBQ;AAhBR,0BAA8C;AAC9C,uBAAoB;AAEpB,sBAAqB;AACrB,MAAM,WAAW;AAAA,EACf,EAAE,MAAM,4BAAQ,WAAO,sBAAI,kBAAkB,GAAG,UAAM,sBAAI,gDAAgD,EAAE;AAAA,EAC5G,EAAE,MAAM,2BAAO,WAAO,sBAAI,eAAe,GAAG,UAAM,sBAAI,4BAA4B,EAAE;AAAA,EACpF,EAAE,MAAM,2BAAO,WAAO,sBAAI,iBAAiB,GAAG,UAAM,sBAAI,kCAAkC,EAAE;AAAA,EAC5F,EAAE,MAAM,6BAAS,WAAO,sBAAI,qBAAqB,GAAG,UAAM,sBAAI,6BAA6B,EAAE;AAC/F;AAEO,SAAS,eAAe;AAC7B,QAAM,QAAI,sBAAK;AACf,SACE,4CAAC,SAAI,WAAU,yCACZ,mBAAS,IAAI,CAAC,EAAE,MAAM,MAAM,OAAO,KAAK,MACvC,6CAAC,SAAgB,WAAU,gDACzB;AAAA,gDAAC,QAAK,WAAU,6BAA4B;AAAA,IAC5C,4CAAC,OAAE,WAAU,uCAAuC,YAAE,KAAK,GAAE;AAAA,IAC7D,4CAAC,OAAE,WAAU,iDAAiD,YAAE,IAAI,GAAE;AAAA,OAH9D,KAIV,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -4,9 +4,9 @@ import { Layers, Package, Timer, Users } from "lucide-react";
|
|
|
4
4
|
import { msg } from "../../i18n/translate.js";
|
|
5
5
|
import { useT } from "../../i18n/provider.js";
|
|
6
6
|
const FEATURES = [
|
|
7
|
-
{ icon: Layers, title: msg("
|
|
8
|
-
{ icon: Timer, title: msg("
|
|
9
|
-
{ icon: Users, title: msg("
|
|
7
|
+
{ icon: Layers, title: msg("Copies per asset"), desc: msg("One artwork or many, each with its own copies.") },
|
|
8
|
+
{ icon: Timer, title: msg("A sale window"), desc: msg("Start and end on any date.") },
|
|
9
|
+
{ icon: Users, title: msg("Open or by list"), desc: msg("Everyone or listed wallets only.") },
|
|
10
10
|
{ icon: Package, title: msg("Collectors own them"), desc: msg("Collectors own every token.") }
|
|
11
11
|
];
|
|
12
12
|
function DropFeatures() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/drop/drop-features.tsx"],"sourcesContent":["\"use client\";\n\nimport { Layers, Package, Timer, Users } from \"lucide-react\";\nimport { msg } from \"../../i18n/translate.js\";\n\nimport { useT } from \"../../i18n/provider.js\";\nconst FEATURES = [\n { icon: Layers, title: msg(\"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drop/drop-features.tsx"],"sourcesContent":["\"use client\";\n\nimport { Layers, Package, Timer, Users } from \"lucide-react\";\nimport { msg } from \"../../i18n/translate.js\";\n\nimport { useT } from \"../../i18n/provider.js\";\nconst FEATURES = [\n { icon: Layers, title: msg(\"Copies per asset\"), desc: msg(\"One artwork or many, each with its own copies.\") },\n { icon: Timer, title: msg(\"A sale window\"), desc: msg(\"Start and end on any date.\") },\n { icon: Users, title: msg(\"Open or by list\"), desc: msg(\"Everyone or listed wallets only.\") },\n { icon: Package, title: msg(\"Collectors own them\"), desc: msg(\"Collectors own every token.\") },\n];\n\nexport function DropFeatures() {\n const t = useT();\n return (\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n {FEATURES.map(({ icon: Icon, title, desc }) => (\n <div key={title} className=\"panel relative overflow-hidden p-4 space-y-2\">\n <Icon className=\"h-5 w-5 text-brand-orange\" />\n <p className=\"text-sm font-semibold leading-tight\">{t(title)}</p>\n <p className=\"text-xs text-muted-foreground leading-relaxed\">{t(desc)}</p>\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";AAkBQ,SACE,KADF;AAhBR,SAAS,QAAQ,SAAS,OAAO,aAAa;AAC9C,SAAS,WAAW;AAEpB,SAAS,YAAY;AACrB,MAAM,WAAW;AAAA,EACf,EAAE,MAAM,QAAQ,OAAO,IAAI,kBAAkB,GAAG,MAAM,IAAI,gDAAgD,EAAE;AAAA,EAC5G,EAAE,MAAM,OAAO,OAAO,IAAI,eAAe,GAAG,MAAM,IAAI,4BAA4B,EAAE;AAAA,EACpF,EAAE,MAAM,OAAO,OAAO,IAAI,iBAAiB,GAAG,MAAM,IAAI,kCAAkC,EAAE;AAAA,EAC5F,EAAE,MAAM,SAAS,OAAO,IAAI,qBAAqB,GAAG,MAAM,IAAI,6BAA6B,EAAE;AAC/F;AAEO,SAAS,eAAe;AAC7B,QAAM,IAAI,KAAK;AACf,SACE,oBAAC,SAAI,WAAU,yCACZ,mBAAS,IAAI,CAAC,EAAE,MAAM,MAAM,OAAO,KAAK,MACvC,qBAAC,SAAgB,WAAU,gDACzB;AAAA,wBAAC,QAAK,WAAU,6BAA4B;AAAA,IAC5C,oBAAC,OAAE,WAAU,uCAAuC,YAAE,KAAK,GAAE;AAAA,IAC7D,oBAAC,OAAE,WAAU,iDAAiD,YAAE,IAAI,GAAE;AAAA,OAH9D,KAIV,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -36,7 +36,7 @@ function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction
|
|
|
36
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "panel space-y-5 p-5", children: [
|
|
37
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
38
38
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_status.DropStatusBadge, { phase: view.phase }),
|
|
39
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground", children: view.statusText })
|
|
39
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-muted-foreground", children: t(view.statusText.text, view.statusText.vars) })
|
|
40
40
|
] }),
|
|
41
41
|
view.countdown && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_countdown.DropCountdown, { targetTs: view.countdown.target, label: t(view.countdown.label) }),
|
|
42
42
|
maxSupply > 0n ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_status.DropSupplyProgress, { minted: Number(minted), max: Number(maxSupply) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t("{value} minted", { value: intl.number(Number(minted)) }) }),
|
|
@@ -52,9 +52,9 @@ function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction
|
|
|
52
52
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "rounded-xl p-2 bg-background/40", disabled: quantity >= view.maxQuantity, onClick: () => onQuantity(quantity + 1n), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3.5 w-3.5" }) })
|
|
53
53
|
] })
|
|
54
54
|
] }),
|
|
55
|
-
view.totalText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: view.totalText }),
|
|
56
|
-
|
|
57
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, big: true, disabled: view.button.action === "none", onClick: onAction, className: "w-full", children: t(view.button.label) })
|
|
55
|
+
view.totalText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t(view.totalText.text, view.totalText.vars) }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm", children: t(view.eligibility.text, view.eligibility.vars) }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, big: true, disabled: view.button.action === "none", onClick: onAction, className: "w-full", children: t(view.button.label.text, view.button.label.vars) })
|
|
58
58
|
] });
|
|
59
59
|
}
|
|
60
60
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/drop/page/drop-action-box.tsx"],"sourcesContent":["\"use client\";\n\nimport { Minus, Plus } from \"lucide-react\";\nimport { DropCountdown } from \"../../drop-countdown.js\";\nimport { DropStatusBadge, DropSupplyProgress } from \"../drop-status.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport type { ActionBoxView } from \"../../../utils/drop/view.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { useFormat } from \"../../../i18n/use-format.js\";\n\nexport interface DropActionBoxProps {\n view: ActionBoxView;\n minted: bigint;\n maxSupply: bigint;\n quantity: bigint;\n onQuantity: (q: bigint) => void;\n onAction: () => void;\n}\n\nexport function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps) {\n const intl = useFormat();\n const t = useT();\n const canPick = view.button.action === \"mint\" && view.maxQuantity > 1n;\n return (\n <div className=\"panel space-y-5 p-5\">\n <div className=\"flex items-center justify-between gap-3\">\n <DropStatusBadge phase={view.phase} />\n <span className=\"text-xs text-muted-foreground\">{view.statusText}</span>\n </div>\n {view.countdown && <DropCountdown targetTs={view.countdown.target} label={t(view.countdown.label)} />}\n {maxSupply > 0n\n ? <DropSupplyProgress minted={Number(minted)} max={Number(maxSupply)} />\n : <p className=\"text-sm text-muted-foreground\">{t(\"{value} minted\", { value: intl.number(Number(minted)) })}</p>}\n <div className=\"flex items-end justify-between gap-3\">\n <div>\n <p className=\"text-xs text-muted-foreground\">{t(\"Price\")}</p>\n <p className=\"text-xl font-bold\">{view.priceText}</p>\n </div>\n {canPick && (\n <div className=\"flex items-center gap-2\" aria-label={t(\"Quantity\")}>\n <span className=\"sr-only\">{t(\"Quantity\")}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity <= 1n} onClick={() => onQuantity(quantity - 1n)}><Minus className=\"h-3.5 w-3.5\" /></button>\n <span className=\"w-8 text-center font-semibold tabular-nums\">{quantity.toString()}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity >= view.maxQuantity} onClick={() => onQuantity(quantity + 1n)}><Plus className=\"h-3.5 w-3.5\" /></button>\n </div>\n )}\n </div>\n {view.totalText && <p className=\"text-sm text-muted-foreground\">{view.totalText}</p>}\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/drop/page/drop-action-box.tsx"],"sourcesContent":["\"use client\";\n\nimport { Minus, Plus } from \"lucide-react\";\nimport { DropCountdown } from \"../../drop-countdown.js\";\nimport { DropStatusBadge, DropSupplyProgress } from \"../drop-status.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport type { ActionBoxView } from \"../../../utils/drop/view.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { useFormat } from \"../../../i18n/use-format.js\";\n\nexport interface DropActionBoxProps {\n view: ActionBoxView;\n minted: bigint;\n maxSupply: bigint;\n quantity: bigint;\n onQuantity: (q: bigint) => void;\n onAction: () => void;\n}\n\nexport function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps) {\n const intl = useFormat();\n const t = useT();\n const canPick = view.button.action === \"mint\" && view.maxQuantity > 1n;\n return (\n <div className=\"panel space-y-5 p-5\">\n <div className=\"flex items-center justify-between gap-3\">\n <DropStatusBadge phase={view.phase} />\n <span className=\"text-xs text-muted-foreground\">{t(view.statusText.text, view.statusText.vars)}</span>\n </div>\n {view.countdown && <DropCountdown targetTs={view.countdown.target} label={t(view.countdown.label)} />}\n {maxSupply > 0n\n ? <DropSupplyProgress minted={Number(minted)} max={Number(maxSupply)} />\n : <p className=\"text-sm text-muted-foreground\">{t(\"{value} minted\", { value: intl.number(Number(minted)) })}</p>}\n <div className=\"flex items-end justify-between gap-3\">\n <div>\n <p className=\"text-xs text-muted-foreground\">{t(\"Price\")}</p>\n <p className=\"text-xl font-bold\">{view.priceText}</p>\n </div>\n {canPick && (\n <div className=\"flex items-center gap-2\" aria-label={t(\"Quantity\")}>\n <span className=\"sr-only\">{t(\"Quantity\")}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity <= 1n} onClick={() => onQuantity(quantity - 1n)}><Minus className=\"h-3.5 w-3.5\" /></button>\n <span className=\"w-8 text-center font-semibold tabular-nums\">{quantity.toString()}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity >= view.maxQuantity} onClick={() => onQuantity(quantity + 1n)}><Plus className=\"h-3.5 w-3.5\" /></button>\n </div>\n )}\n </div>\n {view.totalText && <p className=\"text-sm text-muted-foreground\">{t(view.totalText.text, view.totalText.vars)}</p>}\n <p className=\"text-sm\">{t(view.eligibility.text, view.eligibility.vars)}</p>\n <ActionButton solid big disabled={view.button.action === \"none\"} onClick={onAction} className=\"w-full\">\n {t(view.button.label.text, view.button.label.vars)}\n </ActionButton>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBM;AAvBN,0BAA4B;AAC5B,4BAA8B;AAC9B,yBAAoD;AACpD,2BAA6B;AAE7B,sBAAqB;AACrB,wBAA0B;AAWnB,SAAS,cAAc,EAAE,MAAM,QAAQ,WAAW,UAAU,YAAY,SAAS,GAAuB;AAC7G,QAAM,WAAO,6BAAU;AACvB,QAAM,QAAI,sBAAK;AACf,QAAM,UAAU,KAAK,OAAO,WAAW,UAAU,KAAK,cAAc;AACpE,SACE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AU,IAAI,GAAE;AAAA,IAC7G,4CAAC,OAAE,WAAU,WAAW,YAAE,KAAK,YAAY,MAAM,KAAK,YAAY,IAAI,GAAE;AAAA,IACxE,4CAAC,qCAAa,OAAK,MAAC,KAAG,MAAC,UAAU,KAAK,OAAO,WAAW,QAAQ,SAAS,UAAU,WAAU,UAC3F,YAAE,KAAK,OAAO,MAAM,MAAM,KAAK,OAAO,MAAM,IAAI,GACnD;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -13,7 +13,7 @@ function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction
|
|
|
13
13
|
return /* @__PURE__ */ jsxs("div", { className: "panel space-y-5 p-5", children: [
|
|
14
14
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
15
15
|
/* @__PURE__ */ jsx(DropStatusBadge, { phase: view.phase }),
|
|
16
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: view.statusText })
|
|
16
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t(view.statusText.text, view.statusText.vars) })
|
|
17
17
|
] }),
|
|
18
18
|
view.countdown && /* @__PURE__ */ jsx(DropCountdown, { targetTs: view.countdown.target, label: t(view.countdown.label) }),
|
|
19
19
|
maxSupply > 0n ? /* @__PURE__ */ jsx(DropSupplyProgress, { minted: Number(minted), max: Number(maxSupply) }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("{value} minted", { value: intl.number(Number(minted)) }) }),
|
|
@@ -29,9 +29,9 @@ function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction
|
|
|
29
29
|
/* @__PURE__ */ jsx("button", { type: "button", className: "rounded-xl p-2 bg-background/40", disabled: quantity >= view.maxQuantity, onClick: () => onQuantity(quantity + 1n), children: /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5" }) })
|
|
30
30
|
] })
|
|
31
31
|
] }),
|
|
32
|
-
view.totalText && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: view.totalText }),
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */ jsx(ActionButton, { solid: true, big: true, disabled: view.button.action === "none", onClick: onAction, className: "w-full", children: t(view.button.label) })
|
|
32
|
+
view.totalText && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t(view.totalText.text, view.totalText.vars) }),
|
|
33
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: t(view.eligibility.text, view.eligibility.vars) }),
|
|
34
|
+
/* @__PURE__ */ jsx(ActionButton, { solid: true, big: true, disabled: view.button.action === "none", onClick: onAction, className: "w-full", children: t(view.button.label.text, view.button.label.vars) })
|
|
35
35
|
] });
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/drop/page/drop-action-box.tsx"],"sourcesContent":["\"use client\";\n\nimport { Minus, Plus } from \"lucide-react\";\nimport { DropCountdown } from \"../../drop-countdown.js\";\nimport { DropStatusBadge, DropSupplyProgress } from \"../drop-status.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport type { ActionBoxView } from \"../../../utils/drop/view.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { useFormat } from \"../../../i18n/use-format.js\";\n\nexport interface DropActionBoxProps {\n view: ActionBoxView;\n minted: bigint;\n maxSupply: bigint;\n quantity: bigint;\n onQuantity: (q: bigint) => void;\n onAction: () => void;\n}\n\nexport function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps) {\n const intl = useFormat();\n const t = useT();\n const canPick = view.button.action === \"mint\" && view.maxQuantity > 1n;\n return (\n <div className=\"panel space-y-5 p-5\">\n <div className=\"flex items-center justify-between gap-3\">\n <DropStatusBadge phase={view.phase} />\n <span className=\"text-xs text-muted-foreground\">{view.statusText}</span>\n </div>\n {view.countdown && <DropCountdown targetTs={view.countdown.target} label={t(view.countdown.label)} />}\n {maxSupply > 0n\n ? <DropSupplyProgress minted={Number(minted)} max={Number(maxSupply)} />\n : <p className=\"text-sm text-muted-foreground\">{t(\"{value} minted\", { value: intl.number(Number(minted)) })}</p>}\n <div className=\"flex items-end justify-between gap-3\">\n <div>\n <p className=\"text-xs text-muted-foreground\">{t(\"Price\")}</p>\n <p className=\"text-xl font-bold\">{view.priceText}</p>\n </div>\n {canPick && (\n <div className=\"flex items-center gap-2\" aria-label={t(\"Quantity\")}>\n <span className=\"sr-only\">{t(\"Quantity\")}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity <= 1n} onClick={() => onQuantity(quantity - 1n)}><Minus className=\"h-3.5 w-3.5\" /></button>\n <span className=\"w-8 text-center font-semibold tabular-nums\">{quantity.toString()}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity >= view.maxQuantity} onClick={() => onQuantity(quantity + 1n)}><Plus className=\"h-3.5 w-3.5\" /></button>\n </div>\n )}\n </div>\n {view.totalText && <p className=\"text-sm text-muted-foreground\">{view.totalText}</p>}\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/drop/page/drop-action-box.tsx"],"sourcesContent":["\"use client\";\n\nimport { Minus, Plus } from \"lucide-react\";\nimport { DropCountdown } from \"../../drop-countdown.js\";\nimport { DropStatusBadge, DropSupplyProgress } from \"../drop-status.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport type { ActionBoxView } from \"../../../utils/drop/view.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { useFormat } from \"../../../i18n/use-format.js\";\n\nexport interface DropActionBoxProps {\n view: ActionBoxView;\n minted: bigint;\n maxSupply: bigint;\n quantity: bigint;\n onQuantity: (q: bigint) => void;\n onAction: () => void;\n}\n\nexport function DropActionBox({ view, minted, maxSupply, quantity, onQuantity, onAction }: DropActionBoxProps) {\n const intl = useFormat();\n const t = useT();\n const canPick = view.button.action === \"mint\" && view.maxQuantity > 1n;\n return (\n <div className=\"panel space-y-5 p-5\">\n <div className=\"flex items-center justify-between gap-3\">\n <DropStatusBadge phase={view.phase} />\n <span className=\"text-xs text-muted-foreground\">{t(view.statusText.text, view.statusText.vars)}</span>\n </div>\n {view.countdown && <DropCountdown targetTs={view.countdown.target} label={t(view.countdown.label)} />}\n {maxSupply > 0n\n ? <DropSupplyProgress minted={Number(minted)} max={Number(maxSupply)} />\n : <p className=\"text-sm text-muted-foreground\">{t(\"{value} minted\", { value: intl.number(Number(minted)) })}</p>}\n <div className=\"flex items-end justify-between gap-3\">\n <div>\n <p className=\"text-xs text-muted-foreground\">{t(\"Price\")}</p>\n <p className=\"text-xl font-bold\">{view.priceText}</p>\n </div>\n {canPick && (\n <div className=\"flex items-center gap-2\" aria-label={t(\"Quantity\")}>\n <span className=\"sr-only\">{t(\"Quantity\")}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity <= 1n} onClick={() => onQuantity(quantity - 1n)}><Minus className=\"h-3.5 w-3.5\" /></button>\n <span className=\"w-8 text-center font-semibold tabular-nums\">{quantity.toString()}</span>\n <button type=\"button\" className=\"rounded-xl p-2 bg-background/40\" disabled={quantity >= view.maxQuantity} onClick={() => onQuantity(quantity + 1n)}><Plus className=\"h-3.5 w-3.5\" /></button>\n </div>\n )}\n </div>\n {view.totalText && <p className=\"text-sm text-muted-foreground\">{t(view.totalText.text, view.totalText.vars)}</p>}\n <p className=\"text-sm\">{t(view.eligibility.text, view.eligibility.vars)}</p>\n <ActionButton solid big disabled={view.button.action === \"none\"} onClick={onAction} className=\"w-full\">\n {t(view.button.label.text, view.button.label.vars)}\n </ActionButton>\n </div>\n );\n}\n"],"mappings":";AAyBM,SACE,KADF;AAvBN,SAAS,OAAO,YAAY;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB,0BAA0B;AACpD,SAAS,oBAAoB;AAE7B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAWnB,SAAS,cAAc,EAAE,MAAM,QAAQ,WAAW,UAAU,YAAY,SAAS,GAAuB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E;AAAA,SACtL;AAAA,OAEJ;AAAA,IACC,KAAK,aAAa,oBAAC,OAAE,WAAU,iCAAiC,YAAE,KAAK,UAAU,MAAM,KAAK,UAAU,IAAI,GAAE;AAAA,IAC7G,oBAAC,OAAE,WAAU,WAAW,YAAE,KAAK,YAAY,MAAM,KAAK,YAAY,IAAI,GAAE;AAAA,IACxE,oBAAC,gBAAa,OAAK,MAAC,KAAG,MAAC,UAAU,KAAK,OAAO,WAAW,QAAQ,SAAS,UAAU,WAAU,UAC3F,YAAE,KAAK,OAAO,MAAM,MAAM,KAAK,OAAO,MAAM,IAAI,GACnD;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -60,7 +60,7 @@ function DropMintDialog({
|
|
|
60
60
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, { className: "sr-only", children: t("Mint from this drop.") }),
|
|
61
61
|
step.kind === "confirm" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
62
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, { className: "text-lg font-semibold", children: t("Mint {quantity} from {name}", { quantity: quantity.toString(), name }) }),
|
|
63
|
-
totalText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: totalText }),
|
|
63
|
+
totalText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: t(totalText.text, totalText.vars) }),
|
|
64
64
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, big: true, onClick: () => void mint(), className: "w-full", children: t("Confirm mint") })
|
|
65
65
|
] }),
|
|
66
66
|
step.kind === "minting" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogTitle, { className: "flex items-center gap-2 text-lg font-semibold", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/drop/page/drop-mint-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../../dialog.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport { Button } from \"../../button.js\";\nimport { describeError } from \"../../../utils/describe-error.js\";\nimport { useT } from \"../../../i18n/provider.js\";\n\ntype Step = { kind: \"confirm\" } | { kind: \"minting\" } | { kind: \"done\"; tokenIds: string[] } | { kind: \"error\"; message: string };\n\nexport function DropMintDialog({\n open, onClose, name, quantity, totalText, onMint, portfolioHref,\n}: {\n open: boolean;\n onClose: () => void;\n name: string;\n quantity: bigint;\n totalText:
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/drop/page/drop-mint-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../../dialog.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport { Button } from \"../../button.js\";\nimport { describeError } from \"../../../utils/describe-error.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport type { Phrase } from \"../../../i18n/translate.js\";\n\ntype Step = { kind: \"confirm\" } | { kind: \"minting\" } | { kind: \"done\"; tokenIds: string[] } | { kind: \"error\"; message: string };\n\nexport function DropMintDialog({\n open, onClose, name, quantity, totalText, onMint, portfolioHref,\n}: {\n open: boolean;\n onClose: () => void;\n name: string;\n quantity: bigint;\n totalText: Phrase | null;\n onMint: () => Promise<{ tokenIds: string[] }>;\n portfolioHref: string;\n}) {\n const t = useT();\n const [step, setStep] = useState<Step>({ kind: \"confirm\" });\n const mint = async () => {\n setStep({ kind: \"minting\" });\n try {\n setStep({ kind: \"done\", tokenIds: (await onMint()).tokenIds });\n } catch (err) {\n setStep({ kind: \"error\", message: describeError(err).message });\n }\n };\n const close = () => {\n if (step.kind === \"minting\") return;\n setStep({ kind: \"confirm\" });\n onClose();\n };\n return (\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"gap-5 sm:max-w-md\" hideClose={step.kind === \"minting\"}>\n <DialogDescription className=\"sr-only\">{t(\"Mint from this drop.\")}</DialogDescription>\n {step.kind === \"confirm\" && (\n <>\n <DialogTitle className=\"text-lg font-semibold\">{t(\"Mint {quantity} from {name}\", { quantity: quantity.toString(), name })}</DialogTitle>\n {totalText && <p className=\"text-sm text-muted-foreground\">{t(totalText.text, totalText.vars)}</p>}\n <ActionButton solid big onClick={() => void mint()} className=\"w-full\">{t(\"Confirm mint\")}</ActionButton>\n </>\n )}\n {step.kind === \"minting\" && <DialogTitle className=\"flex items-center gap-2 text-lg font-semibold\"><Loader2 className=\"h-4 w-4 animate-spin\" />{t(\"Minting…\")}</DialogTitle>}\n {step.kind === \"done\" && (\n <>\n <DialogTitle className=\"flex items-center gap-2 text-lg font-semibold\"><CheckCircle2 className=\"h-5 w-5 text-brand-blue\" />{t(\"Minted\")}</DialogTitle>\n <Button asChild><a href={portfolioHref}>{t(\"View in portfolio\")}</a></Button>\n </>\n )}\n {step.kind === \"error\" && (\n <>\n <DialogTitle className=\"flex items-center gap-2 text-lg font-semibold\"><XCircle className=\"h-4 w-4 text-destructive\" />{t(\"Not minted\")}</DialogTitle>\n <p className=\"text-sm text-muted-foreground\">{step.message}</p>\n <Button onClick={() => void mint()}>{t(\"Try again\")}</Button>\n </>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CQ;AAxCR,mBAAyB;AACzB,0BAA+C;AAC/C,oBAAsE;AACtE,2BAA6B;AAC7B,oBAAuB;AACvB,4BAA8B;AAC9B,sBAAqB;AAKd,SAAS,eAAe;AAAA,EAC7B;AAAA,EAAM;AAAA,EAAS;AAAA,EAAM;AAAA,EAAU;AAAA,EAAW;AAAA,EAAQ;AACpD,GAQG;AAC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AAU,2BAA0B;AAAA,QAAG,EAAE,QAAQ;AAAA,SAAE;AAAA,MACxI,4CAAC,wBAAO,SAAO,MAAC,sDAAC,OAAE,MAAM,eAAgB,YAAE,mBAAmB,GAAE,GAAI;AAAA,OACtE;AAAA,IAED,KAAK,SAAS,WACb,4EACE;AAAA,mDAAC,6BAAY,WAAU,iDAAgD;AAAA,oDAAC,+BAAQ,WAAU,4BAA2B;AAAA,QAAG,EAAE,YAAY;AAAA,SAAE;AAAA,MACxI,4CAAC,OAAE,WAAU,iCAAiC,eAAK,SAAQ;AAAA,MAC3D,4CAAC,wBAAO,SAAS,MAAM,KAAK,KAAK,GAAI,YAAE,WAAW,GAAE;AAAA,OACtD;AAAA,KAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Phrase } from '../../../i18n/translate.cjs';
|
|
2
3
|
|
|
3
4
|
declare function DropMintDialog({ open, onClose, name, quantity, totalText, onMint, portfolioHref, }: {
|
|
4
5
|
open: boolean;
|
|
5
6
|
onClose: () => void;
|
|
6
7
|
name: string;
|
|
7
8
|
quantity: bigint;
|
|
8
|
-
totalText:
|
|
9
|
+
totalText: Phrase | null;
|
|
9
10
|
onMint: () => Promise<{
|
|
10
11
|
tokenIds: string[];
|
|
11
12
|
}>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Phrase } from '../../../i18n/translate.js';
|
|
2
3
|
|
|
3
4
|
declare function DropMintDialog({ open, onClose, name, quantity, totalText, onMint, portfolioHref, }: {
|
|
4
5
|
open: boolean;
|
|
5
6
|
onClose: () => void;
|
|
6
7
|
name: string;
|
|
7
8
|
quantity: bigint;
|
|
8
|
-
totalText:
|
|
9
|
+
totalText: Phrase | null;
|
|
9
10
|
onMint: () => Promise<{
|
|
10
11
|
tokenIds: string[];
|
|
11
12
|
}>;
|
|
@@ -37,7 +37,7 @@ function DropMintDialog({
|
|
|
37
37
|
/* @__PURE__ */ jsx(DialogDescription, { className: "sr-only", children: t("Mint from this drop.") }),
|
|
38
38
|
step.kind === "confirm" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
39
|
/* @__PURE__ */ jsx(DialogTitle, { className: "text-lg font-semibold", children: t("Mint {quantity} from {name}", { quantity: quantity.toString(), name }) }),
|
|
40
|
-
totalText && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: totalText }),
|
|
40
|
+
totalText && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t(totalText.text, totalText.vars) }),
|
|
41
41
|
/* @__PURE__ */ jsx(ActionButton, { solid: true, big: true, onClick: () => void mint(), className: "w-full", children: t("Confirm mint") })
|
|
42
42
|
] }),
|
|
43
43
|
step.kind === "minting" && /* @__PURE__ */ jsxs(DialogTitle, { className: "flex items-center gap-2 text-lg font-semibold", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/drop/page/drop-mint-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../../dialog.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport { Button } from \"../../button.js\";\nimport { describeError } from \"../../../utils/describe-error.js\";\nimport { useT } from \"../../../i18n/provider.js\";\n\ntype Step = { kind: \"confirm\" } | { kind: \"minting\" } | { kind: \"done\"; tokenIds: string[] } | { kind: \"error\"; message: string };\n\nexport function DropMintDialog({\n open, onClose, name, quantity, totalText, onMint, portfolioHref,\n}: {\n open: boolean;\n onClose: () => void;\n name: string;\n quantity: bigint;\n totalText:
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/drop/page/drop-mint-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"../../dialog.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport { Button } from \"../../button.js\";\nimport { describeError } from \"../../../utils/describe-error.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport type { Phrase } from \"../../../i18n/translate.js\";\n\ntype Step = { kind: \"confirm\" } | { kind: \"minting\" } | { kind: \"done\"; tokenIds: string[] } | { kind: \"error\"; message: string };\n\nexport function DropMintDialog({\n open, onClose, name, quantity, totalText, onMint, portfolioHref,\n}: {\n open: boolean;\n onClose: () => void;\n name: string;\n quantity: bigint;\n totalText: Phrase | null;\n onMint: () => Promise<{ tokenIds: string[] }>;\n portfolioHref: string;\n}) {\n const t = useT();\n const [step, setStep] = useState<Step>({ kind: \"confirm\" });\n const mint = async () => {\n setStep({ kind: \"minting\" });\n try {\n setStep({ kind: \"done\", tokenIds: (await onMint()).tokenIds });\n } catch (err) {\n setStep({ kind: \"error\", message: describeError(err).message });\n }\n };\n const close = () => {\n if (step.kind === \"minting\") return;\n setStep({ kind: \"confirm\" });\n onClose();\n };\n return (\n <Dialog open={open} onOpenChange={(next) => { if (!next) close(); }}>\n <DialogContent className=\"gap-5 sm:max-w-md\" hideClose={step.kind === \"minting\"}>\n <DialogDescription className=\"sr-only\">{t(\"Mint from this drop.\")}</DialogDescription>\n {step.kind === \"confirm\" && (\n <>\n <DialogTitle className=\"text-lg font-semibold\">{t(\"Mint {quantity} from {name}\", { quantity: quantity.toString(), name })}</DialogTitle>\n {totalText && <p className=\"text-sm text-muted-foreground\">{t(totalText.text, totalText.vars)}</p>}\n <ActionButton solid big onClick={() => void mint()} className=\"w-full\">{t(\"Confirm mint\")}</ActionButton>\n </>\n )}\n {step.kind === \"minting\" && <DialogTitle className=\"flex items-center gap-2 text-lg font-semibold\"><Loader2 className=\"h-4 w-4 animate-spin\" />{t(\"Minting…\")}</DialogTitle>}\n {step.kind === \"done\" && (\n <>\n <DialogTitle className=\"flex items-center gap-2 text-lg font-semibold\"><CheckCircle2 className=\"h-5 w-5 text-brand-blue\" />{t(\"Minted\")}</DialogTitle>\n <Button asChild><a href={portfolioHref}>{t(\"View in portfolio\")}</a></Button>\n </>\n )}\n {step.kind === \"error\" && (\n <>\n <DialogTitle className=\"flex items-center gap-2 text-lg font-semibold\"><XCircle className=\"h-4 w-4 text-destructive\" />{t(\"Not minted\")}</DialogTitle>\n <p className=\"text-sm text-muted-foreground\">{step.message}</p>\n <Button onClick={() => void mint()}>{t(\"Try again\")}</Button>\n </>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AA0CQ,SAEE,UAFF,KAEE,YAFF;AAxCR,SAAS,gBAAgB;AACzB,SAAS,cAAc,SAAS,eAAe;AAC/C,SAAS,QAAQ,eAAe,mBAAmB,mBAAmB;AACtE,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,YAAY;AAKd,SAAS,eAAe;AAAA,EAC7B;AAAA,EAAM;AAAA,EAAS;AAAA,EAAM;AAAA,EAAU;AAAA,EAAW;AAAA,EAAQ;AACpD,GAQG;AACD,QAAM,IAAI,KAAK;AACf,QAAM,CAAC,MAAM,OAAO,IAAI,SAAe,EAAE,MAAM,UAAU,CAAC;AAC1D,QAAM,OAAO,YAAY;AACvB,YAAQ,EAAE,MAAM,UAAU,CAAC;AAC3B,QAAI;AACF,cAAQ,EAAE,MAAM,QAAQ,WAAW,MAAM,OAAO,GAAG,SAAS,CAAC;AAAA,IAC/D,SAAS,KAAK;AACZ,cAAQ,EAAE,MAAM,SAAS,SAAS,cAAc,GAAG,EAAE,QAAQ,CAAC;AAAA,IAChE;AAAA,EACF;AACA,QAAM,QAAQ,MAAM;AAClB,QAAI,KAAK,SAAS,UAAW;AAC7B,YAAQ,EAAE,MAAM,UAAU,CAAC;AAC3B,YAAQ;AAAA,EACV;AACA,SACE,oBAAC,UAAO,MAAY,cAAc,CAAC,SAAS;AAAE,QAAI,CA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drop_activity = require("./drop-activity.js");
|
|
48
48
|
var import_drop_manage = require("./drop-manage.js");
|
|
49
49
|
var import_drop_mint_dialog = require("./drop-mint-dialog.js");
|
|
50
|
-
var import_action_button = require("../../action-button.js");
|
|
51
50
|
var import_use_collections = require("../../../utils/use-collections.js");
|
|
52
51
|
var import_use_drops = require("../../../utils/use-drops.js");
|
|
53
52
|
var import_use_now = require("../../../utils/drop/use-now.js");
|
|
@@ -59,6 +58,7 @@ var import_use_image_url = require("../../../utils/use-image-url.js");
|
|
|
59
58
|
var import_provider = require("../../../i18n/provider.js");
|
|
60
59
|
function DropPage(props) {
|
|
61
60
|
const t = (0, import_provider.useT)();
|
|
61
|
+
const locale = (0, import_provider.useLocale)();
|
|
62
62
|
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
63
63
|
const app = (0, import_medialane_app.useMedialaneApp)();
|
|
64
64
|
const { contract } = props;
|
|
@@ -93,7 +93,7 @@ function DropPage(props) {
|
|
|
93
93
|
const onchain = chain.drop;
|
|
94
94
|
const priced = feeBps === null ? null : onchain;
|
|
95
95
|
const mint = (0, import_starknet.dropMintState)({ drop: priced, wallet: walletAddress, claimed: chain.claimed, proof, balance: chain.balance, feeBps: feeBps ?? 0, now });
|
|
96
|
-
const view = priced ? (0, import_view.actionBoxView)({ drop: priced, mint, quantity, feeBps, now }) : null;
|
|
96
|
+
const view = priced ? (0, import_view.actionBoxView)({ drop: priced, mint, quantity, feeBps, now, locale }) : null;
|
|
97
97
|
const isOrganizer = !!walletAddress && !!onchain && BigInt(walletAddress) === BigInt(onchain.organizer);
|
|
98
98
|
const art = resolveImage(firstToken?.image ?? indexed?.image);
|
|
99
99
|
const name = indexed?.name ?? "Drop";
|
|
@@ -103,7 +103,7 @@ function DropPage(props) {
|
|
|
103
103
|
if (view.button.action === "sign-in") app.onRequireWallet();
|
|
104
104
|
if (view.button.action === "mint") setMinting(true);
|
|
105
105
|
};
|
|
106
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-10
|
|
106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-10", children: [
|
|
107
107
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-8 lg:grid-cols-2 lg:gap-10", children: [
|
|
108
108
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative aspect-square overflow-hidden rounded-2xl bg-muted", children: art && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: art, alt: name, fill: true, unoptimized: true, className: "object-cover" }) }),
|
|
109
109
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-5", children: [
|
|
@@ -114,13 +114,9 @@ function DropPage(props) {
|
|
|
114
114
|
] }),
|
|
115
115
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_share_button.ShareButton, { title: name, variant: "soft", size: "sm" })
|
|
116
116
|
] }),
|
|
117
|
-
view && onchain && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
view && onchain && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_action_box.DropActionBox, { view, minted: onchain.totalMinted, maxSupply: onchain.maxSupply, quantity, onQuantity: setQuantity, onAction })
|
|
118
118
|
] })
|
|
119
119
|
] }),
|
|
120
|
-
view && onchain && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "lg:hidden", children: [
|
|
121
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_action_box.DropActionBox, { view, minted: onchain.totalMinted, maxSupply: onchain.maxSupply, quantity, onQuantity: setQuantity, onAction }),
|
|
122
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "fixed inset-x-0 bottom-0 z-30 border-t border-border bg-background/95 p-3 backdrop-blur", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { solid: true, disabled: view.button.action === "none", onClick: onAction, className: "w-full", children: t(view.button.label) }) })
|
|
123
|
-
] }),
|
|
124
120
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tabs.Tabs, { defaultValue: props.initialTab === "manage" && isOrganizer ? "manage" : "about", children: [
|
|
125
121
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tabs.TabsList, { children: [
|
|
126
122
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tabs.TabsTrigger, { value: "about", children: t("About") }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/drop/page/drop-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo, useState } from \"react\";\nimport { Package } from \"lucide-react\";\nimport { dropMintState } from \"@medialane/sdk/starknet\";\nimport Image from \"../../image.js\";\nimport { CreatorChip } from \"../../creator-chip.js\";\nimport { ShareButton } from \"../../share-button.js\";\nimport { Skeleton } from \"../../skeleton.js\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"../../tabs.js\";\nimport { AssetLicenseSummary } from \"../../asset-license-summary.js\";\nimport { TokenCard } from \"../../token-card.js\";\nimport { DropActionBox } from \"./drop-action-box.js\";\nimport { DropActivityList } from \"./drop-activity.js\";\nimport { DropManage } from \"./drop-manage.js\";\nimport { DropMintDialog } from \"./drop-mint-dialog.js\";\nimport { ActionButton } from \"../../action-button.js\";\nimport { useCollectionTokens } from \"../../../utils/use-collections.js\";\nimport { useDrop, useDropChain, useDropFee, useDropFile, useDropMints } from \"../../../utils/use-drops.js\";\nimport { useNow } from \"../../../utils/drop/use-now.js\";\nimport { actionBoxView } from \"../../../utils/drop/view.js\";\nimport { claimProofFor } from \"../../../utils/drop/claim-proof.js\";\nimport { manageDrop, mintDrop, saveExclusiveContent } from \"../../../utils/drop/actions.js\";\nimport { useMedialaneApp } from \"../../medialane-app.js\";\nimport { useImageUrl } from \"../../../utils/use-image-url.js\";\nimport { useT } from \"../../../i18n/provider.js\";\n\ntype TokenFile = { image?: string; attributes?: { trait_type?: string; value?: string }[] };\n\nexport function DropPage(props: { contract: string; initialTab?: string; portfolioHref?: string }) {\n const t = useT();\n const resolveImage = useImageUrl();\n const app = useMedialaneApp();\n const { contract } = props;\n const { getClient, walletAddress } = app;\n const { drop: indexed, isLoading } = useDrop(contract);\n const chain = useDropChain(contract, walletAddress);\n const { mints, mutate: refreshMints } = useDropMints(contract);\n const feeBps = useDropFee();\n const collectionFile = useDropFile<{ drop_kind?: string }>(indexed?.baseUri ?? null, \"collection.json\");\n const isCollection = collectionFile?.drop_kind === \"collection\";\n const firstToken = useDropFile<TokenFile>(indexed?.baseUri ?? null, \"1\");\n const { tokens } = useCollectionTokens(isCollection ? contract : null, 1, 24);\n const now = useNow();\n const [quantity, setQuantity] = useState(1n);\n const [minting, setMinting] = useState(false);\n const proof = useMemo(\n () => (typeof window === \"undefined\" ? null : claimProofFor(window.localStorage, contract, window.location.hash, \"drop-proof\")),\n [contract],\n );\n\n if (isLoading && !chain.drop) {\n return <div className=\"grid gap-8 lg:grid-cols-2\"><Skeleton className=\"aspect-square rounded-2xl\" /><Skeleton className=\"h-96 rounded-2xl\" /></div>;\n }\n if (!indexed && !chain.drop) {\n return (\n <div className=\"space-y-3 py-24 text-center\">\n <Package className=\"mx-auto h-10 w-10 text-muted-foreground/30\" />\n <p className=\"text-sm text-muted-foreground\">{t(\"New drops appear within a minute.\")}</p>\n </div>\n );\n }\n\n const onchain = chain.drop;\n const priced = feeBps === null ? null : onchain;\n const mint = dropMintState({ drop: priced, wallet: walletAddress, claimed: chain.claimed, proof, balance: chain.balance, feeBps: feeBps ?? 0, now });\n const view = priced ? actionBoxView({ drop: priced, mint, quantity, feeBps: feeBps!, now }) : null;\n const isOrganizer = !!walletAddress && !!onchain && BigInt(walletAddress) === BigInt(onchain.organizer);\n const art = resolveImage(firstToken?.image ?? indexed?.image);\n const name = indexed?.name ?? \"Drop\";\n const deps = async () => ({ client: getClient(), signer: await app.getSigner() });\n\n const onAction = () => {\n if (!view) return;\n if (view.button.action === \"sign-in\") app.onRequireWallet();\n if (view.button.action === \"mint\") setMinting(true);\n };\n\n return (\n <div className=\"space-y-10 pb-28 lg:pb-0\">\n <div className=\"grid gap-8 lg:grid-cols-2 lg:gap-10\">\n <div className=\"relative aspect-square overflow-hidden rounded-2xl bg-muted\">\n {art && <Image src={art} alt={name} fill unoptimized className=\"object-cover\" />}\n </div>\n <div className=\"space-y-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"space-y-1\">\n <h1 className=\"text-3xl font-semibold\">{name}</h1>\n {onchain && <CreatorChip address={onchain.organizer} />}\n </div>\n <ShareButton title={name} variant=\"soft\" size=\"sm\" />\n </div>\n {view && onchain && (\n <div className=\"hidden lg:block\">\n <DropActionBox view={view} minted={onchain.totalMinted} maxSupply={onchain.maxSupply} quantity={quantity} onQuantity={setQuantity} onAction={onAction} />\n </div>\n )}\n </div>\n </div>\n\n {view && onchain && (\n <div className=\"lg:hidden\">\n <DropActionBox view={view} minted={onchain.totalMinted} maxSupply={onchain.maxSupply} quantity={quantity} onQuantity={setQuantity} onAction={onAction} />\n <div className=\"fixed inset-x-0 bottom-0 z-30 border-t border-border bg-background/95 p-3 backdrop-blur\">\n <ActionButton solid disabled={view.button.action === \"none\"} onClick={onAction} className=\"w-full\">{t(view.button.label)}</ActionButton>\n </div>\n </div>\n )}\n\n <Tabs defaultValue={props.initialTab === \"manage\" && isOrganizer ? \"manage\" : \"about\"}>\n <TabsList>\n <TabsTrigger value=\"about\">{t(\"About\")}</TabsTrigger>\n {isCollection && <TabsTrigger value=\"items\">{t(\"Items\")}</TabsTrigger>}\n <TabsTrigger value=\"activity\">{t(\"Activity\")}</TabsTrigger>\n <TabsTrigger value=\"license\">{t(\"License\")}</TabsTrigger>\n {isOrganizer && <TabsTrigger value=\"manage\">{t(\"Manage\")}</TabsTrigger>}\n </TabsList>\n <TabsContent value=\"about\" className=\"pt-6\">\n <p className=\"whitespace-pre-line text-sm leading-relaxed text-muted-foreground\">{indexed?.description || t(\"No description.\")}</p>\n </TabsContent>\n {isCollection && (\n <TabsContent value=\"items\" className=\"pt-6\">\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4\">{tokens.map((t) => <TokenCard key={t.tokenId} token={t} />)}</div>\n </TabsContent>\n )}\n <TabsContent value=\"activity\" className=\"pt-6\"><DropActivityList mints={mints} /></TabsContent>\n <TabsContent value=\"license\" className=\"pt-6\"><AssetLicenseSummary attributes={firstToken?.attributes ?? []} /></TabsContent>\n {isOrganizer && onchain && (\n <TabsContent value=\"manage\" className=\"pt-6\">\n <DropManage\n contract={contract}\n indexed={indexed}\n onchain={onchain}\n mints={mints}\n run={async (params) => {\n await manageDrop(await deps(), { owner: walletAddress!, collection: contract, ...params });\n await Promise.all([chain.mutate(), refreshMints()]);\n }}\n saveExclusive={(value) => saveExclusiveContent(getClient(), contract, value)}\n />\n </TabsContent>\n )}\n </Tabs>\n\n {view && minting && (\n <DropMintDialog\n open\n onClose={() => setMinting(false)}\n name={name}\n quantity={quantity > view.maxQuantity ? view.maxQuantity : quantity}\n totalText={view.totalText}\n portfolioHref={props.portfolioHref ?? \"/portfolio\"}\n onMint={async () => {\n const res = await mintDrop(await deps(), { claimer: walletAddress!, collection: contract, quantity: quantity > view.maxQuantity ? view.maxQuantity : quantity, proof });\n await Promise.all([chain.mutate(), refreshMints()]);\n return res;\n }}\n />\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDW;AAlDX,mBAAkC;AAClC,0BAAwB;AACxB,sBAA8B;AAC9B,mBAAkB;AAClB,0BAA4B;AAC5B,0BAA4B;AAC5B,sBAAyB;AACzB,kBAAyD;AACzD,mCAAoC;AACpC,wBAA0B;AAC1B,6BAA8B;AAC9B,2BAAiC;AACjC,yBAA2B;AAC3B,8BAA+B;AAC/B,2BAA6B;AAC7B,6BAAoC;AACpC,uBAA6E;AAC7E,qBAAuB;AACvB,kBAA8B;AAC9B,yBA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AAA,MACjF,4CAAC,2BAAY,OAAM,WAAU,WAAU,QAAO,sDAAC,oDAAoB,YAAY,YAAY,cAAc,CAAC,GAAG,GAAE;AAAA,MAC9G,eAAe,WACd,4CAAC,2BAAY,OAAM,UAAS,WAAU,QACpC;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,KAAK,OAAO,WAAW;AACrB,sBAAM,2BAAW,MAAM,KAAK,GAAG,EAAE,OAAO,eAAgB,YAAY,UAAU,GAAG,OAAO,CAAC;AACzF,kBAAM,QAAQ,IAAI,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC;AAAA,UACpD;AAAA,UACA,eAAe,CAAC,cAAU,qCAAqB,UAAU,GAAG,UAAU,KAAK;AAAA;AAAA,MAC7E,GACF;AAAA,OAEJ;AAAA,IAEC,QAAQ,WACP;AAAA,MAAC;AAAA;AAAA,QACC,MAAI;AAAA,QACJ,SAAS,MAAM,WAAW,KAAK;AAAA,QAC/B;AAAA,QACA,UAAU,WAAW,KAAK,cAAc,KAAK,cAAc;AAAA,QAC3D,WAAW,KAAK;AAAA,QAChB,eAAe,MAAM,iBAAiB;AAAA,QACtC,QAAQ,YAAY;AAClB,gBAAM,MAAM,UAAM,yBAAS,MAAM,KAAK,GAAG,EAAE,SAAS,eAAgB,YAAY,UAAU,UAAU,WAAW,KAAK,cAAc,KAAK,cAAc,UAAU,MAAM,CAAC;AACtK,gBAAM,QAAQ,IAAI,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC;AAClD,iBAAO;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ;","names":["Image","t"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/drop/page/drop-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo, useState } from \"react\";\nimport { Package } from \"lucide-react\";\nimport { dropMintState } from \"@medialane/sdk/starknet\";\nimport Image from \"../../image.js\";\nimport { CreatorChip } from \"../../creator-chip.js\";\nimport { ShareButton } from \"../../share-button.js\";\nimport { Skeleton } from \"../../skeleton.js\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"../../tabs.js\";\nimport { AssetLicenseSummary } from \"../../asset-license-summary.js\";\nimport { TokenCard } from \"../../token-card.js\";\nimport { DropActionBox } from \"./drop-action-box.js\";\nimport { DropActivityList } from \"./drop-activity.js\";\nimport { DropManage } from \"./drop-manage.js\";\nimport { DropMintDialog } from \"./drop-mint-dialog.js\";\nimport { useCollectionTokens } from \"../../../utils/use-collections.js\";\nimport { useDrop, useDropChain, useDropFee, useDropFile, useDropMints } from \"../../../utils/use-drops.js\";\nimport { useNow } from \"../../../utils/drop/use-now.js\";\nimport { actionBoxView } from \"../../../utils/drop/view.js\";\nimport { claimProofFor } from \"../../../utils/drop/claim-proof.js\";\nimport { manageDrop, mintDrop, saveExclusiveContent } from \"../../../utils/drop/actions.js\";\nimport { useMedialaneApp } from \"../../medialane-app.js\";\nimport { useImageUrl } from \"../../../utils/use-image-url.js\";\nimport { useLocale, useT } from \"../../../i18n/provider.js\";\n\ntype TokenFile = { image?: string; attributes?: { trait_type?: string; value?: string }[] };\n\nexport function DropPage(props: { contract: string; initialTab?: string; portfolioHref?: string }) {\n const t = useT();\n const locale = useLocale();\n const resolveImage = useImageUrl();\n const app = useMedialaneApp();\n const { contract } = props;\n const { getClient, walletAddress } = app;\n const { drop: indexed, isLoading } = useDrop(contract);\n const chain = useDropChain(contract, walletAddress);\n const { mints, mutate: refreshMints } = useDropMints(contract);\n const feeBps = useDropFee();\n const collectionFile = useDropFile<{ drop_kind?: string }>(indexed?.baseUri ?? null, \"collection.json\");\n const isCollection = collectionFile?.drop_kind === \"collection\";\n const firstToken = useDropFile<TokenFile>(indexed?.baseUri ?? null, \"1\");\n const { tokens } = useCollectionTokens(isCollection ? contract : null, 1, 24);\n const now = useNow();\n const [quantity, setQuantity] = useState(1n);\n const [minting, setMinting] = useState(false);\n const proof = useMemo(\n () => (typeof window === \"undefined\" ? null : claimProofFor(window.localStorage, contract, window.location.hash, \"drop-proof\")),\n [contract],\n );\n\n if (isLoading && !chain.drop) {\n return <div className=\"grid gap-8 lg:grid-cols-2\"><Skeleton className=\"aspect-square rounded-2xl\" /><Skeleton className=\"h-96 rounded-2xl\" /></div>;\n }\n if (!indexed && !chain.drop) {\n return (\n <div className=\"space-y-3 py-24 text-center\">\n <Package className=\"mx-auto h-10 w-10 text-muted-foreground/30\" />\n <p className=\"text-sm text-muted-foreground\">{t(\"New drops appear within a minute.\")}</p>\n </div>\n );\n }\n\n const onchain = chain.drop;\n const priced = feeBps === null ? null : onchain;\n const mint = dropMintState({ drop: priced, wallet: walletAddress, claimed: chain.claimed, proof, balance: chain.balance, feeBps: feeBps ?? 0, now });\n const view = priced ? actionBoxView({ drop: priced, mint, quantity, feeBps: feeBps!, now, locale }) : null;\n const isOrganizer = !!walletAddress && !!onchain && BigInt(walletAddress) === BigInt(onchain.organizer);\n const art = resolveImage(firstToken?.image ?? indexed?.image);\n const name = indexed?.name ?? \"Drop\";\n const deps = async () => ({ client: getClient(), signer: await app.getSigner() });\n\n const onAction = () => {\n if (!view) return;\n if (view.button.action === \"sign-in\") app.onRequireWallet();\n if (view.button.action === \"mint\") setMinting(true);\n };\n\n return (\n <div className=\"space-y-10\">\n <div className=\"grid gap-8 lg:grid-cols-2 lg:gap-10\">\n <div className=\"relative aspect-square overflow-hidden rounded-2xl bg-muted\">\n {art && <Image src={art} alt={name} fill unoptimized className=\"object-cover\" />}\n </div>\n <div className=\"space-y-5\">\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"space-y-1\">\n <h1 className=\"text-3xl font-semibold\">{name}</h1>\n {onchain && <CreatorChip address={onchain.organizer} />}\n </div>\n <ShareButton title={name} variant=\"soft\" size=\"sm\" />\n </div>\n {view && onchain && (\n <DropActionBox view={view} minted={onchain.totalMinted} maxSupply={onchain.maxSupply} quantity={quantity} onQuantity={setQuantity} onAction={onAction} />\n )}\n </div>\n </div>\n\n <Tabs defaultValue={props.initialTab === \"manage\" && isOrganizer ? \"manage\" : \"about\"}>\n <TabsList>\n <TabsTrigger value=\"about\">{t(\"About\")}</TabsTrigger>\n {isCollection && <TabsTrigger value=\"items\">{t(\"Items\")}</TabsTrigger>}\n <TabsTrigger value=\"activity\">{t(\"Activity\")}</TabsTrigger>\n <TabsTrigger value=\"license\">{t(\"License\")}</TabsTrigger>\n {isOrganizer && <TabsTrigger value=\"manage\">{t(\"Manage\")}</TabsTrigger>}\n </TabsList>\n <TabsContent value=\"about\" className=\"pt-6\">\n <p className=\"whitespace-pre-line text-sm leading-relaxed text-muted-foreground\">{indexed?.description || t(\"No description.\")}</p>\n </TabsContent>\n {isCollection && (\n <TabsContent value=\"items\" className=\"pt-6\">\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4\">{tokens.map((t) => <TokenCard key={t.tokenId} token={t} />)}</div>\n </TabsContent>\n )}\n <TabsContent value=\"activity\" className=\"pt-6\"><DropActivityList mints={mints} /></TabsContent>\n <TabsContent value=\"license\" className=\"pt-6\"><AssetLicenseSummary attributes={firstToken?.attributes ?? []} /></TabsContent>\n {isOrganizer && onchain && (\n <TabsContent value=\"manage\" className=\"pt-6\">\n <DropManage\n contract={contract}\n indexed={indexed}\n onchain={onchain}\n mints={mints}\n run={async (params) => {\n await manageDrop(await deps(), { owner: walletAddress!, collection: contract, ...params });\n await Promise.all([chain.mutate(), refreshMints()]);\n }}\n saveExclusive={(value) => saveExclusiveContent(getClient(), contract, value)}\n />\n </TabsContent>\n )}\n </Tabs>\n\n {view && minting && (\n <DropMintDialog\n open\n onClose={() => setMinting(false)}\n name={name}\n quantity={quantity > view.maxQuantity ? view.maxQuantity : quantity}\n totalText={view.totalText}\n portfolioHref={props.portfolioHref ?? \"/portfolio\"}\n onMint={async () => {\n const res = await mintDrop(await deps(), { claimer: walletAddress!, collection: contract, quantity: quantity > view.maxQuantity ? view.maxQuantity : quantity, proof });\n await Promise.all([chain.mut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