@medialane/ui 0.288.0 → 0.290.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/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/approve-mint-dialog.cjs +150 -0
- package/dist/components/approve-mint-dialog.cjs.map +1 -0
- package/dist/components/approve-mint-dialog.d.cts +27 -0
- package/dist/components/approve-mint-dialog.d.ts +27 -0
- package/dist/components/approve-mint-dialog.js +126 -0
- package/dist/components/approve-mint-dialog.js.map +1 -0
- package/dist/components/asset-page.cjs +3 -2
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +3 -2
- package/dist/components/asset-page.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 +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/collection-page.cjs +3 -2
- package/dist/components/collection-page.cjs.map +1 -1
- package/dist/components/collection-page.js +3 -2
- package/dist/components/collection-page.js.map +1 -1
- package/dist/components/comments-section.cjs +3 -3
- package/dist/components/comments-section.cjs.map +1 -1
- package/dist/components/comments-section.js +2 -2
- package/dist/components/comments-section.js.map +1 -1
- package/dist/components/creator-page.cjs +6 -5
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.js +5 -4
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/listing-card-menu.cjs +10 -13
- package/dist/components/listing-card-menu.cjs.map +1 -1
- package/dist/components/listing-card-menu.js +10 -13
- package/dist/components/listing-card-menu.js.map +1 -1
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +2 -8
- package/dist/components/medialane-app.d.ts +2 -8
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/portfolio-assets.cjs +4 -5
- package/dist/components/portfolio-assets.cjs.map +1 -1
- package/dist/components/portfolio-assets.js +3 -4
- package/dist/components/portfolio-assets.js.map +1 -1
- package/dist/components/report-dialog.cjs +191 -0
- package/dist/components/report-dialog.cjs.map +1 -0
- package/dist/components/report-dialog.d.cts +17 -0
- package/dist/components/report-dialog.d.ts +17 -0
- package/dist/components/report-dialog.js +167 -0
- package/dist/components/report-dialog.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,9 +39,8 @@ var import_sdk = require("@medialane/sdk");
|
|
|
39
39
|
var import_link = __toESM(require("./link.js"), 1);
|
|
40
40
|
var import_button = require("./button.js");
|
|
41
41
|
var import_dropdown_menu = require("./dropdown-menu.js");
|
|
42
|
-
var
|
|
42
|
+
var import_report_dialog = require("./report-dialog.js");
|
|
43
43
|
function ListingCardMenu({ order }) {
|
|
44
|
-
const { ReportDialog } = (0, import_medialane_app.useMedialaneApp)();
|
|
45
44
|
const [reportOpen, setReportOpen] = (0, import_react.useState)(false);
|
|
46
45
|
const contract = order.nftContract ?? "";
|
|
47
46
|
const tokenId = order.nftTokenId ?? "";
|
|
@@ -57,19 +56,17 @@ function ListingCardMenu({ order }) {
|
|
|
57
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
58
57
|
"View collection"
|
|
59
58
|
] }) }),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
] })
|
|
69
|
-
] }) : null
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dropdown_menu.DropdownMenuSeparator, {}),
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dropdown_menu.DropdownMenuItem, { className: "flex items-center gap-2 text-destructive focus:text-destructive", onClick: (e) => {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
setReportOpen(true);
|
|
63
|
+
}, children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Flag, { className: "h-3.5 w-3.5" }),
|
|
65
|
+
"Report"
|
|
66
|
+
] })
|
|
70
67
|
] })
|
|
71
68
|
] }),
|
|
72
|
-
|
|
69
|
+
reportOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_report_dialog.ReportDialog, { open: reportOpen, onOpenChange: setReportOpen, target: { type: "TOKEN", contract, tokenId, name: order.token?.name ?? void 0 } }) : null
|
|
73
70
|
] });
|
|
74
71
|
}
|
|
75
72
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/listing-card-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { ExternalLink, Flag, Layers, MoreHorizontal } from \"lucide-react\";\nimport { assetHref, collectionHref, type ApiOrder } from \"@medialane/sdk\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/listing-card-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { ExternalLink, Flag, Layers, MoreHorizontal } from \"lucide-react\";\nimport { assetHref, collectionHref, type ApiOrder } from \"@medialane/sdk\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\n\nexport function ListingCardMenu({ order }: { order: ApiOrder }) {\n const [reportOpen, setReportOpen] = useState(false);\n const contract = order.nftContract ?? \"\";\n const tokenId = order.nftTokenId ?? \"\";\n\n return (\n <>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button size=\"sm\" variant=\"outline\" className=\"h-9 w-9 p-0 shrink-0 rounded-[9px]\" onClick={(e) => e.preventDefault()} aria-label=\"More actions\">\n <MoreHorizontal className=\"h-3.5 w-3.5\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-44\">\n <DropdownMenuItem asChild>\n <Link href={assetHref(\"STARKNET\", contract, tokenId)} className=\"flex items-center gap-2\">\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground\" />\n View asset\n </Link>\n </DropdownMenuItem>\n <DropdownMenuItem asChild>\n <Link href={collectionHref(\"STARKNET\", contract)} className=\"flex items-center gap-2\">\n <Layers className=\"h-3.5 w-3.5 text-muted-foreground\" />\n View collection\n </Link>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"flex items-center gap-2 text-destructive focus:text-destructive\" onClick={(e) => { e.preventDefault(); setReportOpen(true); }}>\n <Flag className=\"h-3.5 w-3.5\" />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n {reportOpen ? (\n <ReportDialog open={reportOpen} onOpenChange={setReportOpen} target={{ type: \"TOKEN\", contract, tokenId, name: order.token?.name ?? undefined }} />\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBI;AAdJ,mBAAyB;AACzB,0BAA2D;AAC3D,iBAAyD;AACzD,kBAAiB;AACjB,oBAAuB;AACvB,2BAAgH;AAChH,2BAA6B;AAEtB,SAAS,gBAAgB,EAAE,MAAM,GAAwB;AAC9D,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAS,KAAK;AAClD,QAAM,WAAW,MAAM,eAAe;AACtC,QAAM,UAAU,MAAM,cAAc;AAEpC,SACE,4EACE;AAAA,iDAAC,qCACC;AAAA,kDAAC,4CAAoB,SAAO,MAC1B,sDAAC,wBAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,sCAAqC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,cAAW,gBAChI,sDAAC,sCAAe,WAAU,eAAc,GAC1C,GACF;AAAA,MACA,6CAAC,4CAAoB,OAAM,OAAM,WAAU,QACzC;AAAA,oDAAC,yCAAiB,SAAO,MACvB,uDAAC,YAAAA,SAAA,EAAK,UAAM,sBAAU,YAAY,UAAU,OAAO,GAAG,WAAU,2BAC9D;AAAA,sDAAC,oCAAa,WAAU,qCAAoC;AAAA,UAAE;AAAA,WAEhE,GACF;AAAA,QACA,4CAAC,yCAAiB,SAAO,MACvB,uDAAC,YAAAA,SAAA,EAAK,UAAM,2BAAe,YAAY,QAAQ,GAAG,WAAU,2BAC1D;AAAA,sDAAC,8BAAO,WAAU,qCAAoC;AAAA,UAAE;AAAA,WAE1D,GACF;AAAA,QACA,4CAAC,8CAAsB;AAAA,QACvB,6CAAC,yCAAiB,WAAU,mEAAkE,SAAS,CAAC,MAAM;AAAE,YAAE,eAAe;AAAG,wBAAc,IAAI;AAAA,QAAG,GACvJ;AAAA,sDAAC,4BAAK,WAAU,eAAc;AAAA,UAAE;AAAA,WAElC;AAAA,SACF;AAAA,OACF;AAAA,IACC,aACC,4CAAC,qCAAa,MAAM,YAAY,cAAc,eAAe,QAAQ,EAAE,MAAM,SAAS,UAAU,SAAS,MAAM,MAAM,OAAO,QAAQ,OAAU,GAAG,IAC/I;AAAA,KACN;AAEJ;","names":["Link"]}
|
|
@@ -6,9 +6,8 @@ import { assetHref, collectionHref } from "@medialane/sdk";
|
|
|
6
6
|
import Link from "./link.js";
|
|
7
7
|
import { Button } from "./button.js";
|
|
8
8
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
9
|
-
import {
|
|
9
|
+
import { ReportDialog } from "./report-dialog.js";
|
|
10
10
|
function ListingCardMenu({ order }) {
|
|
11
|
-
const { ReportDialog } = useMedialaneApp();
|
|
12
11
|
const [reportOpen, setReportOpen] = useState(false);
|
|
13
12
|
const contract = order.nftContract ?? "";
|
|
14
13
|
const tokenId = order.nftTokenId ?? "";
|
|
@@ -24,19 +23,17 @@ function ListingCardMenu({ order }) {
|
|
|
24
23
|
/* @__PURE__ */ jsx(Layers, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
25
24
|
"View collection"
|
|
26
25
|
] }) }),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
] })
|
|
36
|
-
] }) : null
|
|
26
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
27
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { className: "flex items-center gap-2 text-destructive focus:text-destructive", onClick: (e) => {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
setReportOpen(true);
|
|
30
|
+
}, children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Flag, { className: "h-3.5 w-3.5" }),
|
|
32
|
+
"Report"
|
|
33
|
+
] })
|
|
37
34
|
] })
|
|
38
35
|
] }),
|
|
39
|
-
|
|
36
|
+
reportOpen ? /* @__PURE__ */ jsx(ReportDialog, { open: reportOpen, onOpenChange: setReportOpen, target: { type: "TOKEN", contract, tokenId, name: order.token?.name ?? void 0 } }) : null
|
|
40
37
|
] });
|
|
41
38
|
}
|
|
42
39
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/listing-card-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { ExternalLink, Flag, Layers, MoreHorizontal } from \"lucide-react\";\nimport { assetHref, collectionHref, type ApiOrder } from \"@medialane/sdk\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/listing-card-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { ExternalLink, Flag, Layers, MoreHorizontal } from \"lucide-react\";\nimport { assetHref, collectionHref, type ApiOrder } from \"@medialane/sdk\";\nimport Link from \"./link.js\";\nimport { Button } from \"./button.js\";\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from \"./dropdown-menu.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\n\nexport function ListingCardMenu({ order }: { order: ApiOrder }) {\n const [reportOpen, setReportOpen] = useState(false);\n const contract = order.nftContract ?? \"\";\n const tokenId = order.nftTokenId ?? \"\";\n\n return (\n <>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button size=\"sm\" variant=\"outline\" className=\"h-9 w-9 p-0 shrink-0 rounded-[9px]\" onClick={(e) => e.preventDefault()} aria-label=\"More actions\">\n <MoreHorizontal className=\"h-3.5 w-3.5\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-44\">\n <DropdownMenuItem asChild>\n <Link href={assetHref(\"STARKNET\", contract, tokenId)} className=\"flex items-center gap-2\">\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground\" />\n View asset\n </Link>\n </DropdownMenuItem>\n <DropdownMenuItem asChild>\n <Link href={collectionHref(\"STARKNET\", contract)} className=\"flex items-center gap-2\">\n <Layers className=\"h-3.5 w-3.5 text-muted-foreground\" />\n View collection\n </Link>\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"flex items-center gap-2 text-destructive focus:text-destructive\" onClick={(e) => { e.preventDefault(); setReportOpen(true); }}>\n <Flag className=\"h-3.5 w-3.5\" />\n Report\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n {reportOpen ? (\n <ReportDialog open={reportOpen} onOpenChange={setReportOpen} target={{ type: \"TOKEN\", contract, tokenId, name: order.token?.name ?? undefined }} />\n ) : null}\n </>\n );\n}\n"],"mappings":";AAgBI,mBAIQ,KAKA,YATR;AAdJ,SAAS,gBAAgB;AACzB,SAAS,cAAc,MAAM,QAAQ,sBAAsB;AAC3D,SAAS,WAAW,sBAAqC;AACzD,OAAO,UAAU;AACjB,SAAS,cAAc;AACvB,SAAS,cAAc,qBAAqB,kBAAkB,uBAAuB,2BAA2B;AAChH,SAAS,oBAAoB;AAEtB,SAAS,gBAAgB,EAAE,MAAM,GAAwB;AAC9D,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,WAAW,MAAM,eAAe;AACtC,QAAM,UAAU,MAAM,cAAc;AAEpC,SACE,iCACE;AAAA,yBAAC,gBACC;AAAA,0BAAC,uBAAoB,SAAO,MAC1B,8BAAC,UAAO,MAAK,MAAK,SAAQ,WAAU,WAAU,sCAAqC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,cAAW,gBAChI,8BAAC,kBAAe,WAAU,eAAc,GAC1C,GACF;AAAA,MACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,QACzC;AAAA,4BAAC,oBAAiB,SAAO,MACvB,+BAAC,QAAK,MAAM,UAAU,YAAY,UAAU,OAAO,GAAG,WAAU,2BAC9D;AAAA,8BAAC,gBAAa,WAAU,qCAAoC;AAAA,UAAE;AAAA,WAEhE,GACF;AAAA,QACA,oBAAC,oBAAiB,SAAO,MACvB,+BAAC,QAAK,MAAM,eAAe,YAAY,QAAQ,GAAG,WAAU,2BAC1D;AAAA,8BAAC,UAAO,WAAU,qCAAoC;AAAA,UAAE;AAAA,WAE1D,GACF;AAAA,QACA,oBAAC,yBAAsB;AAAA,QACvB,qBAAC,oBAAiB,WAAU,mEAAkE,SAAS,CAAC,MAAM;AAAE,YAAE,eAAe;AAAG,wBAAc,IAAI;AAAA,QAAG,GACvJ;AAAA,8BAAC,QAAK,WAAU,eAAc;AAAA,UAAE;AAAA,WAElC;AAAA,SACF;AAAA,OACF;AAAA,IACC,aACC,oBAAC,gBAAa,MAAM,YAAY,cAAc,eAAe,QAAQ,EAAE,MAAM,SAAS,UAAU,SAAS,MAAM,MAAM,OAAO,QAAQ,OAAU,GAAG,IAC/I;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type
|
|
1
|
+
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string }\n | { type: \"CREATOR\"; address: string; name?: string }\n | { type: \"COMMENT\"; commentId: string };\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n releaseSigner?: () => void;\n ensureSignedIn?: () => Promise<void>;\n connectLabel?: string;\n verifyEmailHref?: string;\n companion?: CompanionApp;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwCS;AAtCT,mBAA4E;AAmCrE,MAAM,0BAAsB,4BAAmC,IAAI;AAEnE,SAAS,qBAAqB,EAAE,OAAO,SAAS,GAAiD;AACtG,SAAO,4CAAC,oBAAoB,UAApB,EAA6B,OAAe,UAAS;AAC/D;AAEO,SAAS,kBAAgC;AAC9C,QAAM,UAAM,yBAAW,mBAAmB;AAC1C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,8BAA8B;AACxD,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { ElementType,
|
|
3
|
+
import { ElementType, ReactNode } from 'react';
|
|
4
4
|
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
5
5
|
import { FastMintSigner } from './fast-mint/types.cjs';
|
|
6
6
|
import { ApiToken } from '@medialane/sdk';
|
|
@@ -31,11 +31,6 @@ type ReportTarget = {
|
|
|
31
31
|
type: "COMMENT";
|
|
32
32
|
commentId: string;
|
|
33
33
|
};
|
|
34
|
-
type ReportDialogSlot = ComponentType<{
|
|
35
|
-
open: boolean;
|
|
36
|
-
onOpenChange: (open: boolean) => void;
|
|
37
|
-
target: ReportTarget;
|
|
38
|
-
}>;
|
|
39
34
|
interface MedialaneApp {
|
|
40
35
|
getClient: () => MedialaneClient;
|
|
41
36
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
@@ -47,7 +42,6 @@ interface MedialaneApp {
|
|
|
47
42
|
connectLabel?: string;
|
|
48
43
|
verifyEmailHref?: string;
|
|
49
44
|
companion?: CompanionApp;
|
|
50
|
-
ReportDialog?: ReportDialogSlot;
|
|
51
45
|
resolveImage?: ImageResolver;
|
|
52
46
|
}
|
|
53
47
|
declare const MedialaneAppContext: React.Context<MedialaneApp | null>;
|
|
@@ -57,4 +51,4 @@ declare function MedialaneAppProvider({ value, children }: {
|
|
|
57
51
|
}): react_jsx_runtime.JSX.Element;
|
|
58
52
|
declare function useMedialaneApp(): MedialaneApp;
|
|
59
53
|
|
|
60
|
-
export { type AssetRef, type CompanionApp, type MedialaneApp, MedialaneAppContext, MedialaneAppProvider, type
|
|
54
|
+
export { type AssetRef, type CompanionApp, type MedialaneApp, MedialaneAppContext, MedialaneAppProvider, type ReportTarget, useMedialaneApp };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { ElementType,
|
|
3
|
+
import { ElementType, ReactNode } from 'react';
|
|
4
4
|
import { MedialaneClient } from '@medialane/sdk/starknet';
|
|
5
5
|
import { FastMintSigner } from './fast-mint/types.js';
|
|
6
6
|
import { ApiToken } from '@medialane/sdk';
|
|
@@ -31,11 +31,6 @@ type ReportTarget = {
|
|
|
31
31
|
type: "COMMENT";
|
|
32
32
|
commentId: string;
|
|
33
33
|
};
|
|
34
|
-
type ReportDialogSlot = ComponentType<{
|
|
35
|
-
open: boolean;
|
|
36
|
-
onOpenChange: (open: boolean) => void;
|
|
37
|
-
target: ReportTarget;
|
|
38
|
-
}>;
|
|
39
34
|
interface MedialaneApp {
|
|
40
35
|
getClient: () => MedialaneClient;
|
|
41
36
|
getSigner: () => Promise<FastMintSigner> | FastMintSigner;
|
|
@@ -47,7 +42,6 @@ interface MedialaneApp {
|
|
|
47
42
|
connectLabel?: string;
|
|
48
43
|
verifyEmailHref?: string;
|
|
49
44
|
companion?: CompanionApp;
|
|
50
|
-
ReportDialog?: ReportDialogSlot;
|
|
51
45
|
resolveImage?: ImageResolver;
|
|
52
46
|
}
|
|
53
47
|
declare const MedialaneAppContext: React.Context<MedialaneApp | null>;
|
|
@@ -57,4 +51,4 @@ declare function MedialaneAppProvider({ value, children }: {
|
|
|
57
51
|
}): react_jsx_runtime.JSX.Element;
|
|
58
52
|
declare function useMedialaneApp(): MedialaneApp;
|
|
59
53
|
|
|
60
|
-
export { type AssetRef, type CompanionApp, type MedialaneApp, MedialaneAppContext, MedialaneAppProvider, type
|
|
54
|
+
export { type AssetRef, type CompanionApp, type MedialaneApp, MedialaneAppContext, MedialaneAppProvider, type ReportTarget, useMedialaneApp };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type
|
|
1
|
+
{"version":3,"sources":["../../src/components/medialane-app.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ElementType, type ReactNode } from \"react\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport type { FastMintSigner } from \"./fast-mint/types.js\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport type { ImageResolver } from \"../utils/ipfs.js\";\n\nexport type AssetRef = Pick<ApiToken, \"chain\" | \"contractAddress\" | \"tokenId\">;\n\nexport interface CompanionApp {\n title: string;\n description: string;\n icon: ElementType;\n origin: string;\n}\n\nexport type ReportTarget =\n | { type: \"TOKEN\"; contract: string; tokenId: string; name?: string }\n | { type: \"COLLECTION\"; contract: string; name?: string }\n | { type: \"CREATOR\"; address: string; name?: string }\n | { type: \"COMMENT\"; commentId: string };\n\nexport interface MedialaneApp {\n getClient: () => MedialaneClient;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n walletAddress: string | null;\n walletLoading?: boolean;\n onRequireWallet: () => void;\n releaseSigner?: () => void;\n ensureSignedIn?: () => Promise<void>;\n connectLabel?: string;\n verifyEmailHref?: string;\n companion?: CompanionApp;\n resolveImage?: ImageResolver;\n}\n\nexport const MedialaneAppContext = createContext<MedialaneApp | null>(null);\n\nexport function MedialaneAppProvider({ value, children }: { value: MedialaneApp; children: ReactNode }) {\n return <MedialaneAppContext.Provider value={value}>{children}</MedialaneAppContext.Provider>;\n}\n\nexport function useMedialaneApp(): MedialaneApp {\n const app = useContext(MedialaneAppContext);\n if (!app) throw new Error(\"MedialaneAppProvider missing\");\n return app;\n}\n"],"mappings":";AAwCS;AAtCT,SAAS,eAAe,kBAAoD;AAmCrE,MAAM,sBAAsB,cAAmC,IAAI;AAEnE,SAAS,qBAAqB,EAAE,OAAO,SAAS,GAAiD;AACtG,SAAO,oBAAC,oBAAoB,UAApB,EAA6B,OAAe,UAAS;AAC/D;AAEO,SAAS,kBAAgC;AAC9C,QAAM,MAAM,WAAW,mBAAmB;AAC1C,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,8BAA8B;AACxD,SAAO;AACT;","names":[]}
|
|
@@ -28,7 +28,7 @@ var import_lucide_react = require("lucide-react");
|
|
|
28
28
|
var import_empty_or_error = require("./empty-or-error.js");
|
|
29
29
|
var import_load_more_sentinel = require("./load-more-sentinel.js");
|
|
30
30
|
var import_token_card = require("./token-card.js");
|
|
31
|
-
var
|
|
31
|
+
var import_report_dialog = require("./report-dialog.js");
|
|
32
32
|
var import_order_usd = require("../utils/order-usd.js");
|
|
33
33
|
var import_use_usd_prices = require("../utils/use-usd-prices.js");
|
|
34
34
|
var import_use_tokens = require("../utils/use-tokens.js");
|
|
@@ -39,7 +39,6 @@ function usdFor(token, prices) {
|
|
|
39
39
|
return (0, import_order_usd.orderUsd)(order?.price, prices);
|
|
40
40
|
}
|
|
41
41
|
function PortfolioAssets({ address, useActions }) {
|
|
42
|
-
const { ReportDialog } = (0, import_medialane_app.useMedialaneApp)();
|
|
43
42
|
const [page, setPage] = (0, import_react.useState)(1);
|
|
44
43
|
const [all, setAll] = (0, import_react.useState)([]);
|
|
45
44
|
const [reportToken, setReportToken] = (0, import_react.useState)(null);
|
|
@@ -86,7 +85,7 @@ function PortfolioAssets({ address, useActions }) {
|
|
|
86
85
|
onList: actions.list,
|
|
87
86
|
onTransfer: actions.transfer,
|
|
88
87
|
onCancel: actions.cancel,
|
|
89
|
-
onReport:
|
|
88
|
+
onReport: setReportToken
|
|
90
89
|
},
|
|
91
90
|
`${token.contractAddress}-${token.tokenId}`
|
|
92
91
|
)) }),
|
|
@@ -95,8 +94,8 @@ function PortfolioAssets({ address, useActions }) {
|
|
|
95
94
|
}
|
|
96
95
|
),
|
|
97
96
|
actions.dialogs,
|
|
98
|
-
|
|
99
|
-
ReportDialog,
|
|
97
|
+
reportToken && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
import_report_dialog.ReportDialog,
|
|
100
99
|
{
|
|
101
100
|
open: !!reportToken,
|
|
102
101
|
onOpenChange: (open) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard } from \"./token-card.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard } from \"./token-card.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle=\"No assets yet\"\n emptyDescription=\"Create your first asset to get started.\"\n emptyCta={{ label: \"Create your first asset\", href: \"/launchpad/single-editions\" }}\n emptyIcon={<ImageIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <div key={i} className=\"animate-pulse overflow-hidden rounded-xl bg-muted\">\n <div className=\"aspect-square w-full bg-muted-foreground/10\" />\n <div className=\"space-y-2 p-3\">\n <div className=\"h-4 w-3/4 rounded bg-muted-foreground/10\" />\n <div className=\"h-3 w-1/2 rounded bg-muted-foreground/10\" />\n </div>\n </div>\n ))}\n </div>\n }\n >\n <div className={GRID}>\n {shown.map((token) => (\n <TokenCard\n key={`${token.contractAddress}-${token.tokenId}`}\n token={token}\n isOwner\n usdValue={usdFor(token, prices)}\n onList={actions.list}\n onTransfer={actions.transfer}\n onCancel={actions.cancel}\n onReport={setReportToken}\n />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </EmptyOrError>\n {actions.dialogs}\n {reportToken && (\n <ReportDialog\n open={!!reportToken}\n onOpenChange={(open) => { if (!open) setReportToken(null); }}\n target={{ type: \"TOKEN\", contract: reportToken.contractAddress, tokenId: reportToken.tokenId, name: reportToken.metadata?.name ?? undefined }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6CI;AA3CJ,mBAAoD;AAEpD,0BAA0B;AAC1B,4BAA6B;AAC7B,gCAAiC;AACjC,wBAA0B;AAC1B,2BAA6B;AAC7B,uBAAyB;AACzB,4BAA6B;AAC7B,wBAAiC;AAWjC,MAAM,YAAY;AAClB,MAAM,OAAO;AAEb,SAAS,OAAO,OAAiB,QAAwD;AACvF,QAAM,QAAQ,MAAM,cAAc,KAAK,CAAC,MAAM,EAAE,MAAM,aAAa,YAAY,EAAE,MAAM,aAAa,SAAS;AAC7G,aAAO,2BAAS,OAAO,OAAO,MAAM;AACtC;AAEO,SAAS,gBAAgB,EAAE,SAAS,WAAW,GAA8D;AAClH,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,CAAC;AAClC,QAAM,CAAC,KAAK,MAAM,QAAI,uBAAqB,CAAC,CAAC;AAC7C,QAAM,CAAC,aAAa,cAAc,QAAI,uBAA0B,IAAI;AACpE,QAAM,EAAE,QAAQ,MAAM,WAAW,OAAO,OAAO,QAAI,oCAAiB,SAAS,MAAM,SAAS;AAC5F,QAAM,aAAS,oCAAa;AAE5B,8BAAU,MA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cAChB,YAAY,QAAQ;AAAA,cACpB,UAAU,QAAQ;AAAA,cAClB,UAAU;AAAA;AAAA,YAPL,GAAG,MAAM,eAAe,IAAI,MAAM,OAAO;AAAA,UAQhD,CACD,GACH;AAAA,UACA,4CAAC,8CAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA;AAAA;AAAA,IACrG;AAAA,IACC,QAAQ;AAAA,IACR,eACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AAAE,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAAG;AAAA,QAC3D,QAAQ,EAAE,MAAM,SAAS,UAAU,YAAY,iBAAiB,SAAS,YAAY,SAAS,MAAM,YAAY,UAAU,QAAQ,OAAU;AAAA;AAAA,IAC9I;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -5,7 +5,7 @@ import { ImageIcon } from "lucide-react";
|
|
|
5
5
|
import { EmptyOrError } from "./empty-or-error.js";
|
|
6
6
|
import { LoadMoreSentinel } from "./load-more-sentinel.js";
|
|
7
7
|
import { TokenCard } from "./token-card.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ReportDialog } from "./report-dialog.js";
|
|
9
9
|
import { orderUsd } from "../utils/order-usd.js";
|
|
10
10
|
import { useUsdPrices } from "../utils/use-usd-prices.js";
|
|
11
11
|
import { useTokensByOwner } from "../utils/use-tokens.js";
|
|
@@ -16,7 +16,6 @@ function usdFor(token, prices) {
|
|
|
16
16
|
return orderUsd(order?.price, prices);
|
|
17
17
|
}
|
|
18
18
|
function PortfolioAssets({ address, useActions }) {
|
|
19
|
-
const { ReportDialog } = useMedialaneApp();
|
|
20
19
|
const [page, setPage] = useState(1);
|
|
21
20
|
const [all, setAll] = useState([]);
|
|
22
21
|
const [reportToken, setReportToken] = useState(null);
|
|
@@ -63,7 +62,7 @@ function PortfolioAssets({ address, useActions }) {
|
|
|
63
62
|
onList: actions.list,
|
|
64
63
|
onTransfer: actions.transfer,
|
|
65
64
|
onCancel: actions.cancel,
|
|
66
|
-
onReport:
|
|
65
|
+
onReport: setReportToken
|
|
67
66
|
},
|
|
68
67
|
`${token.contractAddress}-${token.tokenId}`
|
|
69
68
|
)) }),
|
|
@@ -72,7 +71,7 @@ function PortfolioAssets({ address, useActions }) {
|
|
|
72
71
|
}
|
|
73
72
|
),
|
|
74
73
|
actions.dialogs,
|
|
75
|
-
|
|
74
|
+
reportToken && /* @__PURE__ */ jsx(
|
|
76
75
|
ReportDialog,
|
|
77
76
|
{
|
|
78
77
|
open: !!reportToken,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard } from \"./token-card.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/portfolio-assets.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type ReactNode } from \"react\";\nimport type { ApiToken } from \"@medialane/sdk\";\nimport { ImageIcon } from \"lucide-react\";\nimport { EmptyOrError } from \"./empty-or-error.js\";\nimport { LoadMoreSentinel } from \"./load-more-sentinel.js\";\nimport { TokenCard } from \"./token-card.js\";\nimport { ReportDialog } from \"./report-dialog.js\";\nimport { orderUsd } from \"../utils/order-usd.js\";\nimport { useUsdPrices } from \"../utils/use-usd-prices.js\";\nimport { useTokensByOwner } from \"../utils/use-tokens.js\";\n\nexport interface PortfolioAssetActions {\n list: (token: ApiToken) => void;\n transfer: (token: ApiToken) => void;\n cancel: (token: ApiToken) => void;\n dialogs?: ReactNode;\n}\n\nexport type UsePortfolioAssetActions = (context: { refresh: () => void }) => PortfolioAssetActions;\n\nconst PAGE_SIZE = 20;\nconst GRID = \"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4\";\n\nfunction usdFor(token: ApiToken, prices: ReturnType<typeof useUsdPrices>): string | null {\n const order = token.activeOrders?.find((o) => o.offer.itemType === \"ERC721\" || o.offer.itemType === \"ERC1155\");\n return orderUsd(order?.price, prices);\n}\n\nexport function PortfolioAssets({ address, useActions }: { address: string; useActions: UsePortfolioAssetActions }) {\n const [page, setPage] = useState(1);\n const [all, setAll] = useState<ApiToken[]>([]);\n const [reportToken, setReportToken] = useState<ApiToken | null>(null);\n const { tokens, meta, isLoading, error, mutate } = useTokensByOwner(address, page, PAGE_SIZE);\n const prices = useUsdPrices();\n\n useEffect(() => setAll((prev) => (page === 1 ? tokens : [...prev, ...tokens])), [tokens, page]);\n useEffect(() => { setPage(1); setAll([]); }, [address]);\n\n const actions = useActions({ refresh: () => { setPage(1); setAll([]); void mutate(); } });\n const shown = page === 1 ? tokens : all;\n const hasMore = meta ? (meta.total ?? 0) > shown.length : false;\n\n return (\n <>\n <EmptyOrError\n isLoading={isLoading && page === 1}\n error={error}\n isEmpty={shown.length === 0 && !isLoading}\n onRetry={() => void mutate()}\n emptyTitle=\"No assets yet\"\n emptyDescription=\"Create your first asset to get started.\"\n emptyCta={{ label: \"Create your first asset\", href: \"/launchpad/single-editions\" }}\n emptyIcon={<ImageIcon className=\"h-7 w-7 text-muted-foreground\" />}\n skeletonNode={\n <div className={GRID}>\n {Array.from({ length: 10 }).map((_, i) => (\n <div key={i} className=\"animate-pulse overflow-hidden rounded-xl bg-muted\">\n <div className=\"aspect-square w-full bg-muted-foreground/10\" />\n <div className=\"space-y-2 p-3\">\n <div className=\"h-4 w-3/4 rounded bg-muted-foreground/10\" />\n <div className=\"h-3 w-1/2 rounded bg-muted-foreground/10\" />\n </div>\n </div>\n ))}\n </div>\n }\n >\n <div className={GRID}>\n {shown.map((token) => (\n <TokenCard\n key={`${token.contractAddress}-${token.tokenId}`}\n token={token}\n isOwner\n usdValue={usdFor(token, prices)}\n onList={actions.list}\n onTransfer={actions.transfer}\n onCancel={actions.cancel}\n onReport={setReportToken}\n />\n ))}\n </div>\n <LoadMoreSentinel hasMore={hasMore} isLoading={isLoading} onLoadMore={() => setPage((p) => p + 1)} />\n </EmptyOrError>\n {actions.dialogs}\n {reportToken && (\n <ReportDialog\n open={!!reportToken}\n onOpenChange={(open) => { if (!open) setReportToken(null); }}\n target={{ type: \"TOKEN\", contract: reportToken.contractAddress, tokenId: reportToken.tokenId, name: reportToken.metadata?.name ?? undefined }}\n />\n )}\n </>\n );\n}\n"],"mappings":";AA6CI,mBASe,KAMH,YAfZ;AA3CJ,SAAS,WAAW,gBAAgC;AAEpD,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAWjC,MAAM,YAAY;AAClB,MAAM,OAAO;AAEb,SAAS,OAAO,OAAiB,QAAwD;AACvF,QAAM,QAAQ,MAAM,cAAc,KAAK,CAAC,MAAM,EAAE,MAAM,aAAa,YAAY,EAAE,MAAM,aAAa,SAAS;AAC7G,SAAO,SAAS,OAAO,OAAO,MAAM;AACtC;AAEO,SAAS,gBAAgB,EAAE,SAAS,WAAW,GAA8D;AAClH,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,CAAC;AAClC,QAAM,CAAC,KAAK,MAAM,IAAI,SAAqB,CAAC,CAAC;AAC7C,QAAM,CAAC,aAAa,cAAc,IAAI,SAA0B,IAAI;AACpE,QAAM,EAAE,QAAQ,MAAM,WAAW,OAAO,OAAO,IAAI,iBAAiB,SAAS,MAAM,SAAS;AAC5F,QAAM,SAAS,aAAa;AAE5B,YAAU,MAAM,OAAO,CAAC,SAAU,SAAS,IAAI,SAAS,CAAC,GAAG,MAAM,GAAG,MAAM,CAAE,GAAG,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G,MAAM,eAAe,IAAI,MAAM,OAAO;AAAA,UAQhD,CACD,GACH;AAAA,UACA,oBAAC,oBAAiB,SAAkB,WAAsB,YAAY,MAAM,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG;AAAA;AAAA;AAAA,IACrG;AAAA,IACC,QAAQ;AAAA,IACR,eACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,CAAC,CAAC;AAAA,QACR,cAAc,CAAC,SAAS;AAAE,cAAI,CAAC,KAAM,gBAAe,IAAI;AAAA,QAAG;AAAA,QAC3D,QAAQ,EAAE,MAAM,SAAS,UAAU,YAAY,iBAAiB,SAAS,YAAY,SAAS,MAAM,YAAY,UAAU,QAAQ,OAAU;AAAA;AAAA,IAC9I;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var report_dialog_exports = {};
|
|
21
|
+
__export(report_dialog_exports, {
|
|
22
|
+
ReportDialog: () => ReportDialog
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(report_dialog_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_lucide_react = require("lucide-react");
|
|
28
|
+
var import_sdk = require("@medialane/sdk");
|
|
29
|
+
var import_dialog = require("./dialog.js");
|
|
30
|
+
var import_button = require("./button.js");
|
|
31
|
+
var import_checkbox = require("./checkbox.js");
|
|
32
|
+
var import_textarea = require("./textarea.js");
|
|
33
|
+
var import_label = require("./label.js");
|
|
34
|
+
var import_medialane_app = require("./medialane-app.js");
|
|
35
|
+
var import_describe_error = require("../utils/describe-error.js");
|
|
36
|
+
const CATEGORIES = [
|
|
37
|
+
{ value: "COPYRIGHT_PIRACY", label: "Copyright / Piracy" },
|
|
38
|
+
{ value: "VIOLENCE_GRAPHIC", label: "Violence / Graphic content" },
|
|
39
|
+
{ value: "HATE_SPEECH", label: "Hate speech" },
|
|
40
|
+
{ value: "SCAM_FRAUD", label: "Scam / Fraud" },
|
|
41
|
+
{ value: "SPAM", label: "Spam" },
|
|
42
|
+
{ value: "NSFW", label: "NSFW / Adult content" },
|
|
43
|
+
{ value: "OTHER", label: "Other" }
|
|
44
|
+
];
|
|
45
|
+
function ReportDialog({ target, open, onOpenChange }) {
|
|
46
|
+
const { getClient, ensureSignedIn } = (0, import_medialane_app.useMedialaneApp)();
|
|
47
|
+
const [categories, setCategories] = (0, import_react.useState)([]);
|
|
48
|
+
const [description, setDescription] = (0, import_react.useState)("");
|
|
49
|
+
const [submitStep, setSubmitStep] = (0, import_react.useState)("idle");
|
|
50
|
+
const [submitError, setSubmitError] = (0, import_react.useState)(null);
|
|
51
|
+
const toggleCategory = (value) => {
|
|
52
|
+
setCategories(
|
|
53
|
+
(prev) => prev.includes(value) ? prev.filter((c) => c !== value) : [...prev, value]
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
const close = () => {
|
|
57
|
+
setCategories([]);
|
|
58
|
+
setDescription("");
|
|
59
|
+
setSubmitStep("idle");
|
|
60
|
+
setSubmitError(null);
|
|
61
|
+
onOpenChange(false);
|
|
62
|
+
};
|
|
63
|
+
const handleOpenChange = (next) => {
|
|
64
|
+
if (!next && submitStep !== "submitting") close();
|
|
65
|
+
};
|
|
66
|
+
const handleSubmit = async () => {
|
|
67
|
+
if (categories.length === 0 || submitStep === "submitting") return;
|
|
68
|
+
setSubmitStep("submitting");
|
|
69
|
+
setSubmitError(null);
|
|
70
|
+
try {
|
|
71
|
+
await ensureSignedIn?.();
|
|
72
|
+
await getClient().api.platform.submitReport({
|
|
73
|
+
targetType: target.type,
|
|
74
|
+
categories,
|
|
75
|
+
description: description.trim() || void 0,
|
|
76
|
+
...target.type === "TOKEN" ? { targetContract: target.contract, targetTokenId: target.tokenId } : {},
|
|
77
|
+
...target.type === "COLLECTION" ? { targetContract: target.contract } : {},
|
|
78
|
+
...target.type === "CREATOR" ? { targetAddress: target.address } : {},
|
|
79
|
+
...target.type === "COMMENT" ? { targetId: target.commentId } : {}
|
|
80
|
+
});
|
|
81
|
+
setSubmitStep("success");
|
|
82
|
+
} catch (err) {
|
|
83
|
+
setSubmitStep("error");
|
|
84
|
+
if (err instanceof import_sdk.MedialaneApiError && err.status === 409) {
|
|
85
|
+
setSubmitError("You've already reported this content.");
|
|
86
|
+
} else if (err instanceof import_sdk.MedialaneApiError && err.status === 429) {
|
|
87
|
+
setSubmitError("Too many reports \u2014 please wait before trying again.");
|
|
88
|
+
} else {
|
|
89
|
+
setSubmitError((0, import_describe_error.describeError)(err).message);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const targetLabel = target.type !== "COMMENT" && target.name ? `"${target.name}"` : target.type.charAt(0) + target.type.slice(1).toLowerCase();
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, { className: "max-w-md", children: [
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogTitle, { className: "flex items-center gap-2", children: [
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Flag, { className: "w-4 h-4" }),
|
|
97
|
+
"Report ",
|
|
98
|
+
targetLabel
|
|
99
|
+
] }) }),
|
|
100
|
+
submitStep === "success" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center gap-4 py-4 text-center", children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckCircle, { className: "h-10 w-10 text-emerald-500" }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-semibold", children: "Report submitted" }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "Our team will review it." })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { className: "w-full", onClick: close, children: "Done" })
|
|
107
|
+
] }) : submitStep === "error" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-center gap-4 py-4 text-center", children: [
|
|
108
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-10 w-10 text-destructive" }),
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: submitError }),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex gap-2 w-full", children: [
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", className: "flex-1", onClick: () => {
|
|
112
|
+
setSubmitStep("idle");
|
|
113
|
+
setSubmitError(null);
|
|
114
|
+
}, children: "Try again" }),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "outline", className: "flex-1", onClick: close, children: "Dismiss" })
|
|
116
|
+
] })
|
|
117
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
|
|
119
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-3", children: [
|
|
120
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.Label, { className: "text-sm font-medium", children: [
|
|
121
|
+
"What's wrong with this content?",
|
|
122
|
+
" ",
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(select all that apply)" })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 gap-2", children: CATEGORIES.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
|
+
import_checkbox.Checkbox,
|
|
128
|
+
{
|
|
129
|
+
id: value,
|
|
130
|
+
checked: categories.includes(value),
|
|
131
|
+
onCheckedChange: () => toggleCategory(value),
|
|
132
|
+
disabled: submitStep === "submitting"
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
+
"label",
|
|
137
|
+
{
|
|
138
|
+
htmlFor: value,
|
|
139
|
+
className: "text-sm cursor-pointer leading-none",
|
|
140
|
+
children: label
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] }, value)) })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.Label, { htmlFor: "report-description", className: "text-sm font-medium", children: [
|
|
147
|
+
"Additional details",
|
|
148
|
+
" ",
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground font-normal", children: "(optional)" })
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
import_textarea.Textarea,
|
|
153
|
+
{
|
|
154
|
+
id: "report-description",
|
|
155
|
+
placeholder: "Describe the issue in more detail (optional)",
|
|
156
|
+
value: description,
|
|
157
|
+
onChange: (e) => setDescription(e.target.value),
|
|
158
|
+
maxLength: 500,
|
|
159
|
+
className: "resize-none h-24",
|
|
160
|
+
disabled: submitStep === "submitting"
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground text-right", children: [
|
|
164
|
+
description.length,
|
|
165
|
+
"/500"
|
|
166
|
+
] })
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: "Reports are reviewed by the Medialane DAO team. Content remains accessible onchain and via the permissionless dapp." })
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogFooter, { children: [
|
|
171
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.Button, { variant: "ghost", onClick: close, disabled: submitStep === "submitting", children: "Cancel" }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
import_button.Button,
|
|
174
|
+
{
|
|
175
|
+
onClick: handleSubmit,
|
|
176
|
+
disabled: categories.length === 0 || submitStep === "submitting",
|
|
177
|
+
children: submitStep === "submitting" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 mr-2 animate-spin" }),
|
|
179
|
+
"Submitting\u2026"
|
|
180
|
+
] }) : "Submit Report"
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
] })
|
|
184
|
+
] })
|
|
185
|
+
] }) });
|
|
186
|
+
}
|
|
187
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
188
|
+
0 && (module.exports = {
|
|
189
|
+
ReportDialog
|
|
190
|
+
});
|
|
191
|
+
//# sourceMappingURL=report-dialog.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/report-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { AlertCircle, CheckCircle, Flag, Loader2 } from \"lucide-react\";\nimport { MedialaneApiError } from \"@medialane/sdk\";\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { Checkbox } from \"./checkbox.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { Label } from \"./label.js\";\nimport { useMedialaneApp, type ReportTarget } from \"./medialane-app.js\";\nimport { describeError } from \"../utils/describe-error.js\";\n\nconst CATEGORIES = [\n { value: \"COPYRIGHT_PIRACY\", label: \"Copyright / Piracy\" },\n { value: \"VIOLENCE_GRAPHIC\", label: \"Violence / Graphic content\" },\n { value: \"HATE_SPEECH\", label: \"Hate speech\" },\n { value: \"SCAM_FRAUD\", label: \"Scam / Fraud\" },\n { value: \"SPAM\", label: \"Spam\" },\n { value: \"NSFW\", label: \"NSFW / Adult content\" },\n { value: \"OTHER\", label: \"Other\" },\n] as const;\n\nexport interface ReportDialogProps {\n target: ReportTarget;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\nexport function ReportDialog({ target, open, onOpenChange }: ReportDialogProps) {\n const { getClient, ensureSignedIn } = useMedialaneApp();\n const [categories, setCategories] = useState<string[]>([]);\n const [description, setDescription] = useState(\"\");\n const [submitStep, setSubmitStep] = useState<\"idle\" | \"submitting\" | \"success\" | \"error\">(\"idle\");\n const [submitError, setSubmitError] = useState<string | null>(null);\n\n const toggleCategory = (value: string) => {\n setCategories((prev) =>\n prev.includes(value) ? prev.filter((c) => c !== value) : [...prev, value]\n );\n };\n\n const close = () => {\n setCategories([]);\n setDescription(\"\");\n setSubmitStep(\"idle\");\n setSubmitError(null);\n onOpenChange(false);\n };\n\n const handleOpenChange = (next: boolean) => {\n if (!next && submitStep !== \"submitting\") close();\n };\n\n const handleSubmit = async () => {\n if (categories.length === 0 || submitStep === \"submitting\") return;\n setSubmitStep(\"submitting\");\n setSubmitError(null);\n\n try {\n await ensureSignedIn?.();\n await getClient().api.platform.submitReport({\n targetType: target.type,\n categories,\n description: description.trim() || undefined,\n ...(target.type === \"TOKEN\" ? { targetContract: target.contract, targetTokenId: target.tokenId } : {}),\n ...(target.type === \"COLLECTION\" ? { targetContract: target.contract } : {}),\n ...(target.type === \"CREATOR\" ? { targetAddress: target.address } : {}),\n ...(target.type === \"COMMENT\" ? { targetId: target.commentId } : {}),\n });\n\n setSubmitStep(\"success\");\n } catch (err) {\n setSubmitStep(\"error\");\n if (err instanceof MedialaneApiError && err.status === 409) {\n setSubmitError(\"You've already reported this content.\");\n } else if (err instanceof MedialaneApiError && err.status === 429) {\n setSubmitError(\"Too many reports — please wait before trying again.\");\n } else {\n setSubmitError(describeError(err).message);\n }\n }\n };\n\n const targetLabel =\n target.type !== \"COMMENT\" && target.name\n ? `\"${target.name}\"`\n : target.type.charAt(0) + target.type.slice(1).toLowerCase();\n\n return (\n <Dialog open={open} onOpenChange={handleOpenChange}>\n <DialogContent className=\"max-w-md\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <Flag className=\"w-4 h-4\" />\n Report {targetLabel}\n </DialogTitle>\n </DialogHeader>\n\n {submitStep === \"success\" ? (\n <div className=\"flex flex-col items-center gap-4 py-4 text-center\">\n <CheckCircle className=\"h-10 w-10 text-emerald-500\" />\n <div className=\"space-y-1\">\n <p className=\"font-semibold\">Report submitted</p>\n <p className=\"text-sm text-muted-foreground\">Our team will review it.</p>\n </div>\n <Button className=\"w-full\" onClick={close}>Done</Button>\n </div>\n ) : submitStep === \"error\" ? (\n <div className=\"flex flex-col items-center gap-4 py-4 text-center\">\n <AlertCircle className=\"h-10 w-10 text-destructive\" />\n <p className=\"text-sm text-muted-foreground\">{submitError}</p>\n <div className=\"flex gap-2 w-full\">\n <Button variant=\"outline\" className=\"flex-1\" onClick={() => { setSubmitStep(\"idle\"); setSubmitError(null); }}>Try again</Button>\n <Button variant=\"outline\" className=\"flex-1\" onClick={close}>Dismiss</Button>\n </div>\n </div>\n ) : (\n <>\n <div className=\"space-y-4\">\n <div className=\"space-y-3\">\n <Label className=\"text-sm font-medium\">\n What's wrong with this content?{\" \"}\n <span className=\"text-muted-foreground font-normal\">\n (select all that apply)\n </span>\n </Label>\n <div className=\"grid grid-cols-1 gap-2\">\n {CATEGORIES.map(({ value, label }) => (\n <div key={value} className=\"flex items-center space-x-2\">\n <Checkbox\n id={value}\n checked={categories.includes(value)}\n onCheckedChange={() => toggleCategory(value)}\n disabled={submitStep === \"submitting\"}\n />\n <label\n htmlFor={value}\n className=\"text-sm cursor-pointer leading-none\"\n >\n {label}\n </label>\n </div>\n ))}\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <Label htmlFor=\"report-description\" className=\"text-sm font-medium\">\n Additional details{\" \"}\n <span className=\"text-muted-foreground font-normal\">(optional)</span>\n </Label>\n <Textarea\n id=\"report-description\"\n placeholder=\"Describe the issue in more detail (optional)\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n maxLength={500}\n className=\"resize-none h-24\"\n disabled={submitStep === \"submitting\"}\n />\n <p className=\"text-xs text-muted-foreground text-right\">\n {description.length}/500\n </p>\n </div>\n\n <p className=\"text-xs text-muted-foreground\">\n Reports are reviewed by the Medialane DAO team. Content remains\n accessible onchain and via the permissionless dapp.\n </p>\n </div>\n\n <DialogFooter>\n <Button variant=\"ghost\" onClick={close} disabled={submitStep === \"submitting\"}>\n Cancel\n </Button>\n <Button\n onClick={handleSubmit}\n disabled={categories.length === 0 || submitStep === \"submitting\"}\n >\n {submitStep === \"submitting\" ? <><Loader2 className=\"h-4 w-4 mr-2 animate-spin\" />Submitting…</> : \"Submit Report\"}\n </Button>\n </DialogFooter>\n </>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6FU;AA3FV,mBAAyB;AACzB,0BAAwD;AACxD,iBAAkC;AAClC,oBAA+E;AAC/E,oBAAuB;AACvB,sBAAyB;AACzB,sBAAyB;AACzB,mBAAsB;AACtB,2BAAmD;AACnD,4BAA8B;AAE9B,MAAM,aAAa;AAAA,EACjB,EAAE,OAAO,oBAAoB,OAAO,qBAAqB;AAAA,EACzD,EAAE,OAAO,oBAAoB,OAAO,6BAA6B;AAAA,EACjE,EAAE,OAAO,eAAe,OAAO,cAAc;AAAA,EAC7C,EAAE,OAAO,cAAc,OAAO,eAAe;AAAA,EAC7C,EAAE,OAAO,QAAQ,OAAO,OAAO;AAAA,EAC/B,EAAE,OAAO,QAAQ,OAAO,uBAAuB;AAAA,EAC/C,EAAE,OAAO,SAAS,OAAO,QAAQ;AACnC;AAQO,SAAS,aAAa,EAAE,QAAQ,MAAM,aAAa,GAAsB;AAC9E,QAAM,EAAE,WAAW,eAAe,QAAI,sCAAgB;AACtD,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAmB,CAAC,CAAC;AACzD,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,EAAE;AACjD,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAsD,MAAM;AAChG,QA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,cAAE;AAAA,eAAW,IAAM;AAAA;AAAA,QACrG;AAAA,SACF;AAAA,OACF;AAAA,KAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReportTarget } from './medialane-app.cjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@medialane/sdk/starknet';
|
|
5
|
+
import './fast-mint/types.cjs';
|
|
6
|
+
import 'starknet';
|
|
7
|
+
import '@medialane/sdk';
|
|
8
|
+
import '../utils/ipfs.cjs';
|
|
9
|
+
|
|
10
|
+
interface ReportDialogProps {
|
|
11
|
+
target: ReportTarget;
|
|
12
|
+
open: boolean;
|
|
13
|
+
onOpenChange: (open: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
declare function ReportDialog({ target, open, onOpenChange }: ReportDialogProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { ReportDialog, type ReportDialogProps };
|