@medialane/ui 0.259.0 → 0.260.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/activities-feed.cjs +5 -1
- package/dist/components/activities-feed.cjs.map +1 -1
- package/dist/components/activities-feed.js +5 -1
- package/dist/components/activities-feed.js.map +1 -1
- package/dist/components/activity-feed-shell.cjs +3 -1
- package/dist/components/activity-feed-shell.cjs.map +1 -1
- package/dist/components/activity-feed-shell.js +3 -1
- package/dist/components/activity-feed-shell.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/coins-explorer.cjs +5 -1
- package/dist/components/coins-explorer.cjs.map +1 -1
- package/dist/components/coins-explorer.js +6 -2
- package/dist/components/coins-explorer.js.map +1 -1
- package/dist/components/comments-section.cjs +2 -2
- 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/discover-community-section.cjs +5 -1
- package/dist/components/discover-community-section.cjs.map +1 -1
- package/dist/components/discover-community-section.js +5 -1
- package/dist/components/discover-community-section.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +5 -1
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.js +5 -1
- package/dist/components/discover-feed-section.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/fast-mint/success-view.cjs +2 -2
- package/dist/components/fast-mint/success-view.cjs.map +1 -1
- package/dist/components/fast-mint/success-view.js +2 -2
- package/dist/components/fast-mint/success-view.js.map +1 -1
- package/dist/components/ip-type-page.cjs +3 -2
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +3 -2
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/marketplace-dialog-primitives.cjs +1 -1
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.js +1 -1
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-activity.cjs +5 -1
- package/dist/components/media-wallet/media-wallet-activity.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-activity.js +5 -1
- package/dist/components/media-wallet/media-wallet-activity.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.cjs +3 -2
- package/dist/components/media-wallet/media-wallet-home.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-home.js +3 -2
- package/dist/components/media-wallet/media-wallet-home.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.cjs +5 -2
- package/dist/components/media-wallet/media-wallet-send.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.js +5 -2
- package/dist/components/media-wallet/media-wallet-send.js.map +1 -1
- package/dist/components/media-wallet/success-dialog.cjs +5 -11
- package/dist/components/media-wallet/success-dialog.cjs.map +1 -1
- package/dist/components/media-wallet/success-dialog.js +5 -11
- package/dist/components/media-wallet/success-dialog.js.map +1 -1
- package/dist/components/pop-claim-button.cjs +2 -2
- package/dist/components/pop-claim-button.cjs.map +1 -1
- package/dist/components/pop-claim-button.js +2 -2
- package/dist/components/pop-claim-button.js.map +1 -1
- package/dist/components/pop-manage-page.cjs +3 -2
- package/dist/components/pop-manage-page.cjs.map +1 -1
- package/dist/components/pop-manage-page.js +3 -2
- package/dist/components/pop-manage-page.js.map +1 -1
- package/dist/components/portfolio-sponsorships.cjs +14 -7
- package/dist/components/portfolio-sponsorships.cjs.map +1 -1
- package/dist/components/portfolio-sponsorships.js +14 -7
- package/dist/components/portfolio-sponsorships.js.map +1 -1
- package/dist/components/service-collections-page.cjs +2 -2
- package/dist/components/service-collections-page.cjs.map +1 -1
- package/dist/components/service-collections-page.d.cts +2 -2
- package/dist/components/service-collections-page.d.ts +2 -2
- package/dist/components/service-collections-page.js +2 -2
- package/dist/components/service-collections-page.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sponsorship-offer-page.cjs +4 -4
- package/dist/components/sponsorship-offer-page.cjs.map +1 -1
- package/dist/components/sponsorship-offer-page.js +4 -4
- package/dist/components/sponsorship-offer-page.js.map +1 -1
- package/dist/components/transaction-success.cjs +2 -5
- package/dist/components/transaction-success.cjs.map +1 -1
- package/dist/components/transaction-success.js +3 -6
- package/dist/components/transaction-success.js.map +1 -1
- package/dist/components/transfer-collection-ownership.cjs +2 -5
- package/dist/components/transfer-collection-ownership.cjs.map +1 -1
- package/dist/components/transfer-collection-ownership.js +2 -5
- package/dist/components/transfer-collection-ownership.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/empty-messages.cjs +62 -0
- package/dist/utils/empty-messages.cjs.map +1 -0
- package/dist/utils/empty-messages.d.cts +40 -0
- package/dist/utils/empty-messages.d.ts +40 -0
- package/dist/utils/empty-messages.js +38 -0
- package/dist/utils/empty-messages.js.map +1 -0
- package/dist/utils/success-messages.cjs +52 -0
- package/dist/utils/success-messages.cjs.map +1 -1
- package/dist/utils/success-messages.d.cts +27 -0
- package/dist/utils/success-messages.d.ts +27 -0
- package/dist/utils/success-messages.js +52 -0
- package/dist/utils/success-messages.js.map +1 -1
- package/package.json +1 -1
|
@@ -44,16 +44,10 @@ function SuccessDialog({
|
|
|
44
44
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_modal.CanvasPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "absolute inset-0 z-[70] grid place-items-center p-6", onClick: onClose, children: [
|
|
45
45
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_modal.ActionBackdrop, {}),
|
|
46
46
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "card-base relative z-10 w-full max-w-[320px] p-6 text-center", onClick: (e) => e.stopPropagation(), children: [
|
|
47
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
48
|
-
"
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
style: { background: BRAND_GRADIENT },
|
|
52
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { width: "30", height: "30", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.6", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M20 6L9 17l-5-5" }) })
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "mt-4 font-[family-name:var(--font-display)] text-xl font-extrabold tracking-tight", children: title }),
|
|
56
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1.5 text-sm leading-relaxed text-muted-foreground", children: message }),
|
|
47
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { role: "status", children: [
|
|
48
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "font-[family-name:var(--font-display)] text-xl font-extrabold tracking-tight", children: title }),
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1.5 text-sm leading-relaxed text-muted-foreground", children: message })
|
|
50
|
+
] }),
|
|
57
51
|
txHash && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
52
|
"a",
|
|
59
53
|
{
|
|
@@ -61,7 +55,7 @@ function SuccessDialog({
|
|
|
61
55
|
target: "_blank",
|
|
62
56
|
rel: "noopener noreferrer",
|
|
63
57
|
className: "mt-3 inline-block text-xs text-brand-blue hover:underline",
|
|
64
|
-
children: "View
|
|
58
|
+
children: "View transaction \u2197"
|
|
65
59
|
}
|
|
66
60
|
),
|
|
67
61
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_action_button.ActionButton, { big: true, onClick: onClose, className: "mt-5 w-full", style: { "--ml-grad": BRAND_GRADIENT }, children: actionLabel })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/media-wallet/success-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { ActionButton } from \"../action-button.js\";\nimport { ActionBackdrop, CanvasPortal } from \"./action-modal.js\";\nimport { fireConfetti } from \"../../utils/media-wallet/confetti.js\";\nimport { explorerTxUrl } from \"../../utils/media-wallet/wallet-format.js\";\nimport { useMediaWalletApp } from \"./types.js\";\n\nconst BRAND_GRADIENT = \"linear-gradient(115deg, #3b7bff, #8a5cf6, #f6608f, #fb8b46, #3b7bff)\";\n\nexport function SuccessDialog({\n title,\n message,\n actionLabel = \"Done\",\n txHash,\n onClose,\n}: {\n title: string;\n message: string;\n actionLabel?: string;\n txHash?: string;\n onClose: () => void;\n}) {\n const { explorerUrl } = useMediaWalletApp();\n useEffect(() => {\n fireConfetti();\n }, []);\n return (\n <CanvasPortal>\n <div className=\"absolute inset-0 z-[70] grid place-items-center p-6\" onClick={onClose}>\n <ActionBackdrop />\n <div className=\"card-base relative z-10 w-full max-w-[320px] p-6 text-center\" onClick={(e) => e.stopPropagation()}>\n <div
|
|
1
|
+
{"version":3,"sources":["../../../src/components/media-wallet/success-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { ActionButton } from \"../action-button.js\";\nimport { ActionBackdrop, CanvasPortal } from \"./action-modal.js\";\nimport { fireConfetti } from \"../../utils/media-wallet/confetti.js\";\nimport { explorerTxUrl } from \"../../utils/media-wallet/wallet-format.js\";\nimport { useMediaWalletApp } from \"./types.js\";\n\nconst BRAND_GRADIENT = \"linear-gradient(115deg, #3b7bff, #8a5cf6, #f6608f, #fb8b46, #3b7bff)\";\n\nexport function SuccessDialog({\n title,\n message,\n actionLabel = \"Done\",\n txHash,\n onClose,\n}: {\n title: string;\n message: string;\n actionLabel?: string;\n txHash?: string;\n onClose: () => void;\n}) {\n const { explorerUrl } = useMediaWalletApp();\n useEffect(() => {\n fireConfetti();\n }, []);\n return (\n <CanvasPortal>\n <div className=\"absolute inset-0 z-[70] grid place-items-center p-6\" onClick={onClose}>\n <ActionBackdrop />\n <div className=\"card-base relative z-10 w-full max-w-[320px] p-6 text-center\" onClick={(e) => e.stopPropagation()}>\n <div role=\"status\">\n <h2 className=\"font-[family-name:var(--font-display)] text-xl font-extrabold tracking-tight\">{title}</h2>\n <p className=\"mt-1.5 text-sm leading-relaxed text-muted-foreground\">{message}</p>\n </div>\n {txHash && (\n <a\n href={explorerTxUrl(explorerUrl, txHash)}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"mt-3 inline-block text-xs text-brand-blue hover:underline\"\n >\n View transaction ↗\n </a>\n )}\n <ActionButton big onClick={onClose} className=\"mt-5 w-full\" style={{ \"--ml-grad\": BRAND_GRADIENT } as React.CSSProperties}>\n {actionLabel}\n </ActionButton>\n </div>\n </div>\n </CanvasPortal>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BQ;AA7BR,mBAA0B;AAC1B,2BAA6B;AAC7B,0BAA6C;AAC7C,sBAA6B;AAC7B,2BAA8B;AAC9B,mBAAkC;AAElC,MAAM,iBAAiB;AAEhB,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AACF,GAMG;AACD,QAAM,EAAE,YAAY,QAAI,gCAAkB;AAC1C,8BAAU,MAAM;AACd,sCAAa;AAAA,EACf,GAAG,CAAC,CAAC;AACL,SACE,4CAAC,oCACC,uDAAC,SAAI,WAAU,uDAAsD,SAAS,SAC5E;AAAA,gDAAC,sCAAe;AAAA,IAChB,6CAAC,SAAI,WAAU,gEAA+D,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAC9G;AAAA,mDAAC,SAAI,MAAK,UACR;AAAA,oDAAC,QAAG,WAAU,gFAAgF,iBAAM;AAAA,QACpG,4CAAC,OAAE,WAAU,wDAAwD,mBAAQ;AAAA,SAC/E;AAAA,MACC,UACC;AAAA,QAAC;AAAA;AAAA,UACC,UAAM,oCAAc,aAAa,MAAM;AAAA,UACvC,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA,UACX;AAAA;AAAA,MAED;AAAA,MAEF,4CAAC,qCAAa,KAAG,MAAC,SAAS,SAAS,WAAU,eAAc,OAAO,EAAE,aAAa,eAAe,GAC9F,uBACH;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -21,16 +21,10 @@ function SuccessDialog({
|
|
|
21
21
|
return /* @__PURE__ */ jsx(CanvasPortal, { children: /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 z-[70] grid place-items-center p-6", onClick: onClose, children: [
|
|
22
22
|
/* @__PURE__ */ jsx(ActionBackdrop, {}),
|
|
23
23
|
/* @__PURE__ */ jsxs("div", { className: "card-base relative z-10 w-full max-w-[320px] p-6 text-center", onClick: (e) => e.stopPropagation(), children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
"
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
style: { background: BRAND_GRADIENT },
|
|
29
|
-
children: /* @__PURE__ */ jsx("svg", { width: "30", height: "30", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.6", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M20 6L9 17l-5-5" }) })
|
|
30
|
-
}
|
|
31
|
-
),
|
|
32
|
-
/* @__PURE__ */ jsx("h2", { className: "mt-4 font-[family-name:var(--font-display)] text-xl font-extrabold tracking-tight", children: title }),
|
|
33
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1.5 text-sm leading-relaxed text-muted-foreground", children: message }),
|
|
24
|
+
/* @__PURE__ */ jsxs("div", { role: "status", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("h2", { className: "font-[family-name:var(--font-display)] text-xl font-extrabold tracking-tight", children: title }),
|
|
26
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1.5 text-sm leading-relaxed text-muted-foreground", children: message })
|
|
27
|
+
] }),
|
|
34
28
|
txHash && /* @__PURE__ */ jsx(
|
|
35
29
|
"a",
|
|
36
30
|
{
|
|
@@ -38,7 +32,7 @@ function SuccessDialog({
|
|
|
38
32
|
target: "_blank",
|
|
39
33
|
rel: "noopener noreferrer",
|
|
40
34
|
className: "mt-3 inline-block text-xs text-brand-blue hover:underline",
|
|
41
|
-
children: "View
|
|
35
|
+
children: "View transaction \u2197"
|
|
42
36
|
}
|
|
43
37
|
),
|
|
44
38
|
/* @__PURE__ */ jsx(ActionButton, { big: true, onClick: onClose, className: "mt-5 w-full", style: { "--ml-grad": BRAND_GRADIENT }, children: actionLabel })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/media-wallet/success-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { ActionButton } from \"../action-button.js\";\nimport { ActionBackdrop, CanvasPortal } from \"./action-modal.js\";\nimport { fireConfetti } from \"../../utils/media-wallet/confetti.js\";\nimport { explorerTxUrl } from \"../../utils/media-wallet/wallet-format.js\";\nimport { useMediaWalletApp } from \"./types.js\";\n\nconst BRAND_GRADIENT = \"linear-gradient(115deg, #3b7bff, #8a5cf6, #f6608f, #fb8b46, #3b7bff)\";\n\nexport function SuccessDialog({\n title,\n message,\n actionLabel = \"Done\",\n txHash,\n onClose,\n}: {\n title: string;\n message: string;\n actionLabel?: string;\n txHash?: string;\n onClose: () => void;\n}) {\n const { explorerUrl } = useMediaWalletApp();\n useEffect(() => {\n fireConfetti();\n }, []);\n return (\n <CanvasPortal>\n <div className=\"absolute inset-0 z-[70] grid place-items-center p-6\" onClick={onClose}>\n <ActionBackdrop />\n <div className=\"card-base relative z-10 w-full max-w-[320px] p-6 text-center\" onClick={(e) => e.stopPropagation()}>\n <div
|
|
1
|
+
{"version":3,"sources":["../../../src/components/media-wallet/success-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect } from \"react\";\nimport { ActionButton } from \"../action-button.js\";\nimport { ActionBackdrop, CanvasPortal } from \"./action-modal.js\";\nimport { fireConfetti } from \"../../utils/media-wallet/confetti.js\";\nimport { explorerTxUrl } from \"../../utils/media-wallet/wallet-format.js\";\nimport { useMediaWalletApp } from \"./types.js\";\n\nconst BRAND_GRADIENT = \"linear-gradient(115deg, #3b7bff, #8a5cf6, #f6608f, #fb8b46, #3b7bff)\";\n\nexport function SuccessDialog({\n title,\n message,\n actionLabel = \"Done\",\n txHash,\n onClose,\n}: {\n title: string;\n message: string;\n actionLabel?: string;\n txHash?: string;\n onClose: () => void;\n}) {\n const { explorerUrl } = useMediaWalletApp();\n useEffect(() => {\n fireConfetti();\n }, []);\n return (\n <CanvasPortal>\n <div className=\"absolute inset-0 z-[70] grid place-items-center p-6\" onClick={onClose}>\n <ActionBackdrop />\n <div className=\"card-base relative z-10 w-full max-w-[320px] p-6 text-center\" onClick={(e) => e.stopPropagation()}>\n <div role=\"status\">\n <h2 className=\"font-[family-name:var(--font-display)] text-xl font-extrabold tracking-tight\">{title}</h2>\n <p className=\"mt-1.5 text-sm leading-relaxed text-muted-foreground\">{message}</p>\n </div>\n {txHash && (\n <a\n href={explorerTxUrl(explorerUrl, txHash)}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"mt-3 inline-block text-xs text-brand-blue hover:underline\"\n >\n View transaction ↗\n </a>\n )}\n <ActionButton big onClick={onClose} className=\"mt-5 w-full\" style={{ \"--ml-grad\": BRAND_GRADIENT } as React.CSSProperties}>\n {actionLabel}\n </ActionButton>\n </div>\n </div>\n </CanvasPortal>\n );\n}\n"],"mappings":";AA+BQ,cAEE,YAFF;AA7BR,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,oBAAoB;AAC7C,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAElC,MAAM,iBAAiB;AAEhB,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AACF,GAMG;AACD,QAAM,EAAE,YAAY,IAAI,kBAAkB;AAC1C,YAAU,MAAM;AACd,iBAAa;AAAA,EACf,GAAG,CAAC,CAAC;AACL,SACE,oBAAC,gBACC,+BAAC,SAAI,WAAU,uDAAsD,SAAS,SAC5E;AAAA,wBAAC,kBAAe;AAAA,IAChB,qBAAC,SAAI,WAAU,gEAA+D,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAC9G;AAAA,2BAAC,SAAI,MAAK,UACR;AAAA,4BAAC,QAAG,WAAU,gFAAgF,iBAAM;AAAA,QACpG,oBAAC,OAAE,WAAU,wDAAwD,mBAAQ;AAAA,SAC/E;AAAA,MACC,UACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,cAAc,aAAa,MAAM;AAAA,UACvC,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA,UACX;AAAA;AAAA,MAED;AAAA,MAEF,oBAAC,gBAAa,KAAG,MAAC,SAAS,SAAS,WAAU,eAAc,OAAO,EAAE,aAAa,eAAe,GAC9F,uBACH;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -34,6 +34,7 @@ var import_medialane_app = require("./medialane-app.js");
|
|
|
34
34
|
var import_claim_proof = require("../utils/drop/claim-proof.js");
|
|
35
35
|
var import_run_intent_calls = require("../utils/run-intent-calls.js");
|
|
36
36
|
var import_use_pop = require("../utils/use-pop.js");
|
|
37
|
+
var import_success_messages = require("../utils/success-messages.js");
|
|
37
38
|
var import_use_transaction = require("../utils/use-transaction.js");
|
|
38
39
|
function PopClaimButton({ collectionAddress }) {
|
|
39
40
|
const app = (0, import_medialane_app.useMedialaneApp)();
|
|
@@ -77,8 +78,7 @@ function PopClaimButton({ collectionAddress }) {
|
|
|
77
78
|
import_transaction_success.TransactionSuccess,
|
|
78
79
|
{
|
|
79
80
|
name: "Credential",
|
|
80
|
-
|
|
81
|
-
description: "Your proof of participation is now on-chain.",
|
|
81
|
+
...import_success_messages.successMessages.claimed(),
|
|
82
82
|
txHash: tx.txHash,
|
|
83
83
|
actions: [{ label: "Done", onClick: tx.reset }],
|
|
84
84
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: "claim_pop" })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-claim-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Award, Loader2 } from \"lucide-react\";\nimport { popClaimState, type PopClaimInfo } from \"@medialane/sdk/starknet\";\nimport { Button } from \"./button.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { claimProofFor } from \"../utils/drop/claim-proof.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { usePopClaimStatus } from \"../utils/use-pop.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport function PopClaimButton({ collectionAddress }: { collectionAddress: string }) {\n const app = useMedialaneApp();\n const { walletAddress } = app;\n const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);\n const [proof, setProof] = useState<string[] | null>(null);\n const [info, setInfo] = useState<PopClaimInfo | null>(null);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n let storage: Storage | null = null;\n try {\n storage = window.sessionStorage;\n } catch {\n storage = null;\n }\n setProof(claimProofFor(storage, collectionAddress, window.location.hash));\n app.getClient().api.chainReads.popClaimInfo(collectionAddress)\n .then(setInfo)\n .catch(() => setInfo(null));\n }, [app, collectionAddress]);\n\n useEffect(() => {\n if (tx.phase === \"success\") void mutate();\n }, [tx.phase, mutate]);\n\n const state = popClaimState({\n hasClaimed,\n proof,\n wallet: walletAddress,\n info: info && { ...info, now: Math.floor(Date.now() / 1000) },\n });\n\n const claim = () => {\n if (!proof) return;\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-claim\", { claimer: signer.address, collection: collectionAddress, proof }));\n });\n };\n\n return (\n <>\n {(state === \"ready\" || busy) && (\n <Button size=\"sm\" className=\"w-full gap-1.5\" onClick={claim} disabled={busy}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : <Award className=\"h-3.5 w-3.5\" />}\n {busy ? \"Claiming…\" : \"Claim credential\"}\n </Button>\n )}\n <TransactionDialog tx={tx} title=\"Claim credential\" workingLabel=\"Claiming your credential…\" firstStepLabel=\"Prepare claim\">\n <TransactionSuccess\n name=\"Credential\"\n
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-claim-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Award, Loader2 } from \"lucide-react\";\nimport { popClaimState, type PopClaimInfo } from \"@medialane/sdk/starknet\";\nimport { Button } from \"./button.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { claimProofFor } from \"../utils/drop/claim-proof.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { usePopClaimStatus } from \"../utils/use-pop.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport function PopClaimButton({ collectionAddress }: { collectionAddress: string }) {\n const app = useMedialaneApp();\n const { walletAddress } = app;\n const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);\n const [proof, setProof] = useState<string[] | null>(null);\n const [info, setInfo] = useState<PopClaimInfo | null>(null);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n let storage: Storage | null = null;\n try {\n storage = window.sessionStorage;\n } catch {\n storage = null;\n }\n setProof(claimProofFor(storage, collectionAddress, window.location.hash));\n app.getClient().api.chainReads.popClaimInfo(collectionAddress)\n .then(setInfo)\n .catch(() => setInfo(null));\n }, [app, collectionAddress]);\n\n useEffect(() => {\n if (tx.phase === \"success\") void mutate();\n }, [tx.phase, mutate]);\n\n const state = popClaimState({\n hasClaimed,\n proof,\n wallet: walletAddress,\n info: info && { ...info, now: Math.floor(Date.now() / 1000) },\n });\n\n const claim = () => {\n if (!proof) return;\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-claim\", { claimer: signer.address, collection: collectionAddress, proof }));\n });\n };\n\n return (\n <>\n {(state === \"ready\" || busy) && (\n <Button size=\"sm\" className=\"w-full gap-1.5\" onClick={claim} disabled={busy}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : <Award className=\"h-3.5 w-3.5\" />}\n {busy ? \"Claiming…\" : \"Claim credential\"}\n </Button>\n )}\n <TransactionDialog tx={tx} title=\"Claim credential\" workingLabel=\"Claiming your credential…\" firstStepLabel=\"Prepare claim\">\n <TransactionSuccess\n name=\"Credential\"\n {...successMessages.claimed()}\n txHash={tx.txHash}\n actions={[{ label: \"Done\", onClick: tx.reset }]}\n >\n <RewardEarned actionType=\"claim_pop\" />\n </TransactionSuccess>\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDI;AAvDJ,mBAAoC;AACpC,0BAA+B;AAC/B,sBAAiD;AACjD,oBAAuB;AACvB,gCAAkC;AAClC,iCAAmC;AACnC,2BAA6B;AAC7B,2BAAgC;AAChC,yBAA8B;AAC9B,8BAA+B;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AAAA,IACvJ,CAAC;AAAA,EACH;AAEA,SACE,4EACI;AAAA,eAAU,WAAW,SACrB,6CAAC,wBAAO,MAAK,MAAK,WAAU,kBAAiB,SAAS,OAAO,UAAU,MACpE;AAAA,aAAO,4CAAC,+BAAQ,WAAU,4BAA2B,IAAK,4CAAC,6BAAM,WAAU,eAAc;AAAA,MACzF,OAAO,mBAAc;AAAA,OACxB;AAAA,IAEF,4CAAC,+CAAkB,IAAQ,OAAM,oBAAmB,cAAa,kCAA4B,gBAAe,iBAC1G;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACJ,GAAG,wCAAgB,QAAQ;AAAA,QAC5B,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,QAAQ,SAAS,GAAG,MAAM,CAAC;AAAA,QAE9C,sDAAC,qCAAa,YAAW,aAAY;AAAA;AAAA,IACvC,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -11,6 +11,7 @@ import { useMedialaneApp } from "./medialane-app.js";
|
|
|
11
11
|
import { claimProofFor } from "../utils/drop/claim-proof.js";
|
|
12
12
|
import { runIntentCalls } from "../utils/run-intent-calls.js";
|
|
13
13
|
import { usePopClaimStatus } from "../utils/use-pop.js";
|
|
14
|
+
import { successMessages } from "../utils/success-messages.js";
|
|
14
15
|
import { useTransaction } from "../utils/use-transaction.js";
|
|
15
16
|
function PopClaimButton({ collectionAddress }) {
|
|
16
17
|
const app = useMedialaneApp();
|
|
@@ -54,8 +55,7 @@ function PopClaimButton({ collectionAddress }) {
|
|
|
54
55
|
TransactionSuccess,
|
|
55
56
|
{
|
|
56
57
|
name: "Credential",
|
|
57
|
-
|
|
58
|
-
description: "Your proof of participation is now on-chain.",
|
|
58
|
+
...successMessages.claimed(),
|
|
59
59
|
txHash: tx.txHash,
|
|
60
60
|
actions: [{ label: "Done", onClick: tx.reset }],
|
|
61
61
|
children: /* @__PURE__ */ jsx(RewardEarned, { actionType: "claim_pop" })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-claim-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Award, Loader2 } from \"lucide-react\";\nimport { popClaimState, type PopClaimInfo } from \"@medialane/sdk/starknet\";\nimport { Button } from \"./button.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { claimProofFor } from \"../utils/drop/claim-proof.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { usePopClaimStatus } from \"../utils/use-pop.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport function PopClaimButton({ collectionAddress }: { collectionAddress: string }) {\n const app = useMedialaneApp();\n const { walletAddress } = app;\n const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);\n const [proof, setProof] = useState<string[] | null>(null);\n const [info, setInfo] = useState<PopClaimInfo | null>(null);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n let storage: Storage | null = null;\n try {\n storage = window.sessionStorage;\n } catch {\n storage = null;\n }\n setProof(claimProofFor(storage, collectionAddress, window.location.hash));\n app.getClient().api.chainReads.popClaimInfo(collectionAddress)\n .then(setInfo)\n .catch(() => setInfo(null));\n }, [app, collectionAddress]);\n\n useEffect(() => {\n if (tx.phase === \"success\") void mutate();\n }, [tx.phase, mutate]);\n\n const state = popClaimState({\n hasClaimed,\n proof,\n wallet: walletAddress,\n info: info && { ...info, now: Math.floor(Date.now() / 1000) },\n });\n\n const claim = () => {\n if (!proof) return;\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-claim\", { claimer: signer.address, collection: collectionAddress, proof }));\n });\n };\n\n return (\n <>\n {(state === \"ready\" || busy) && (\n <Button size=\"sm\" className=\"w-full gap-1.5\" onClick={claim} disabled={busy}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : <Award className=\"h-3.5 w-3.5\" />}\n {busy ? \"Claiming…\" : \"Claim credential\"}\n </Button>\n )}\n <TransactionDialog tx={tx} title=\"Claim credential\" workingLabel=\"Claiming your credential…\" firstStepLabel=\"Prepare claim\">\n <TransactionSuccess\n name=\"Credential\"\n
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-claim-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { Award, Loader2 } from \"lucide-react\";\nimport { popClaimState, type PopClaimInfo } from \"@medialane/sdk/starknet\";\nimport { Button } from \"./button.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { RewardEarned } from \"./rewards/reward-earned.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { claimProofFor } from \"../utils/drop/claim-proof.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { usePopClaimStatus } from \"../utils/use-pop.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nexport function PopClaimButton({ collectionAddress }: { collectionAddress: string }) {\n const app = useMedialaneApp();\n const { walletAddress } = app;\n const { hasClaimed, mutate } = usePopClaimStatus(collectionAddress, walletAddress);\n const [proof, setProof] = useState<string[] | null>(null);\n const [info, setInfo] = useState<PopClaimInfo | null>(null);\n const tx = useTransaction();\n const busy = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n useEffect(() => {\n let storage: Storage | null = null;\n try {\n storage = window.sessionStorage;\n } catch {\n storage = null;\n }\n setProof(claimProofFor(storage, collectionAddress, window.location.hash));\n app.getClient().api.chainReads.popClaimInfo(collectionAddress)\n .then(setInfo)\n .catch(() => setInfo(null));\n }, [app, collectionAddress]);\n\n useEffect(() => {\n if (tx.phase === \"success\") void mutate();\n }, [tx.phase, mutate]);\n\n const state = popClaimState({\n hasClaimed,\n proof,\n wallet: walletAddress,\n info: info && { ...info, now: Math.floor(Date.now() / 1000) },\n });\n\n const claim = () => {\n if (!proof) return;\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-claim\", { claimer: signer.address, collection: collectionAddress, proof }));\n });\n };\n\n return (\n <>\n {(state === \"ready\" || busy) && (\n <Button size=\"sm\" className=\"w-full gap-1.5\" onClick={claim} disabled={busy}>\n {busy ? <Loader2 className=\"h-3.5 w-3.5 animate-spin\" /> : <Award className=\"h-3.5 w-3.5\" />}\n {busy ? \"Claiming…\" : \"Claim credential\"}\n </Button>\n )}\n <TransactionDialog tx={tx} title=\"Claim credential\" workingLabel=\"Claiming your credential…\" firstStepLabel=\"Prepare claim\">\n <TransactionSuccess\n name=\"Credential\"\n {...successMessages.claimed()}\n txHash={tx.txHash}\n actions={[{ label: \"Done\", onClick: tx.reset }]}\n >\n <RewardEarned actionType=\"claim_pop\" />\n </TransactionSuccess>\n </TransactionDialog>\n </>\n );\n}\n"],"mappings":";AAyDI,mBAGc,KADV,YAFJ;AAvDJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,OAAO,eAAe;AAC/B,SAAS,qBAAwC;AACjD,SAAS,cAAc;AACvB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAExB,SAAS,eAAe,EAAE,kBAAkB,GAAkC;AACnF,QAAM,MAAM,gBAAgB;AAC5B,QAAM,EAAE,cAAc,IAAI;AAC1B,QAAM,EAAE,YAAY,OAAO,IAAI,kBAAkB,mBAAmB,aAAa;AACjF,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA0B,IAAI;AACxD,QAAM,CAAC,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M,oBAAmB,cAAa,kCAA4B,gBAAe,iBAC1G;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACJ,GAAG,gBAAgB,QAAQ;AAAA,QAC5B,QAAQ,GAAG;AAAA,QACX,SAAS,CAAC,EAAE,OAAO,QAAQ,SAAS,GAAG,MAAM,CAAC;AAAA,QAE9C,8BAAC,gBAAa,YAAW,aAAY;AAAA;AAAA,IACvC,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -47,6 +47,7 @@ var import_transaction_dialog = require("./transaction-dialog.js");
|
|
|
47
47
|
var import_transaction_success = require("./transaction-success.js");
|
|
48
48
|
var import_wallet_required = require("./wallet-required.js");
|
|
49
49
|
var import_run_intent_calls = require("../utils/run-intent-calls.js");
|
|
50
|
+
var import_success_messages = require("../utils/success-messages.js");
|
|
50
51
|
var import_use_collections = require("../utils/use-collections.js");
|
|
51
52
|
var import_use_transaction = require("../utils/use-transaction.js");
|
|
52
53
|
function parseAddresses(raw) {
|
|
@@ -164,7 +165,7 @@ function PopManagePage({ contract }) {
|
|
|
164
165
|
const isSubmitting = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
|
|
165
166
|
const isOwner = walletAddress && collection?.owner && (0, import_sdk.normalizeAddress)("STARKNET", walletAddress) === (0, import_sdk.normalizeAddress)("STARKNET", collection.owner);
|
|
166
167
|
const issue = (recipient) => {
|
|
167
|
-
setDone(
|
|
168
|
+
setDone(import_success_messages.successMessages.credentialIssued());
|
|
168
169
|
void tx.run(async (signer) => {
|
|
169
170
|
await (0, import_run_intent_calls.runIntentCalls)(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "issue", recipient }));
|
|
170
171
|
});
|
|
@@ -172,7 +173,7 @@ function PopManagePage({ contract }) {
|
|
|
172
173
|
const publish = (addresses) => {
|
|
173
174
|
const list = (0, import_starknet.buildPopAllowlist)(addresses);
|
|
174
175
|
const count = Object.keys(list.proofs).length;
|
|
175
|
-
setDone({
|
|
176
|
+
setDone(import_success_messages.successMessages.participantsPublished({ count }));
|
|
176
177
|
void tx.run(async (signer) => {
|
|
177
178
|
await (0, import_run_intent_calls.runIntentCalls)(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "set_allowlist_root", root: list.root }));
|
|
178
179
|
}).then((ok) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Issue directly</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Send the credential straight to one wallet — for a late participant, without republishing the list or\n changing anyone's claim link.\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n Issue credential\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Participants</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {parsed.length} address{parsed.length !== 1 ? \"es\" : \"\"}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Paste every participant's wallet address. Publishing replaces the previous list and every link\n sent before it — send the new links to everyone who hasn't claimed yet. The list stays in this\n browser: download the claim links and send each participant theirs.\n </p>\n <Textarea\n placeholder={\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\"}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n Publishing…\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Publish {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : \"participants\"}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n Download claim links (CSV)\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone({ title: \"Credential issued\", description: \"The credential is now in their wallet.\" });\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone({ title: \"Participants published\", description: `Published ${count} participant${count !== 1 ? \"s\" : \"\"}.` });\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title=\"Connect your wallet\" description=\"Connect to manage your event.\">\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">Collection not found.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">You are not the organizer of this event.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back to events</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title=\"Manage event\" workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: \"Done\", onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n All events\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n Organizer\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">Manage Event</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">\n Only participants on your <strong className=\"text-foreground\">published list</strong> can claim,\n with the link you send them.\n </p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CM;AA5CN,mBAAyB;AACzB,iBAAiC;AACjC,sBAAsF;AACtF,0BAA4F;AAC5F,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,+BAAuB;AACvB,sBAAyB;AACzB,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,6BAA+B;AAC/B,8BAA+B;AAC/B,6BAA8B;AAC9B,6BAA+B;AAE/B,SAAS,eAAe,KAAuB;AAC7C,SAAO,IACJ,MAAM,UAAU,EAChB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,mBAAmB,KAAK,CAAC,CAAC;AAC7C;AAEA,SAAS,YAAY,OAAuB;AAC1C,QAAM,OAAO,IAAI,gBAAgB,IAAI,KAAK,KAAC,kCAAiB,KAAK,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC,CAAC;AAC1F,QAAM,SAAS,OAAO,OAAO,SAAS,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6BAAM,WAAU,WAAU;AAAA,QAAE;AAAA,SAE/B;AAAA,MACA,4CAAC,QAAG,WAAU,2BAA0B,0BAAY;AAAA,MACpD,4CAAC,OAAE,WAAU,iCAAiC,qBAAW,QAAQ,UAAS;AAAA,OAC5E,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,uDAAC,SAAI,WAAU,0CACb;AAAA,kDAAC,6BAAM,WAAU,mCAAkC;AAAA,MACnD,6CAAC,OAAE,WAAU,iCAAgC;AAAA;AAAA,QACjB,4CAAC,YAAO,WAAU,mBAAkB,4BAAc;AAAA,QAAS;AAAA,SAEvF;AAAA,OACF,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Issue directly</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Send the credential straight to one wallet — for a late participant, without republishing the list or\n changing anyone's claim link.\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n Issue credential\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Participants</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {parsed.length} address{parsed.length !== 1 ? \"es\" : \"\"}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Paste every participant's wallet address. Publishing replaces the previous list and every link\n sent before it — send the new links to everyone who hasn't claimed yet. The list stays in this\n browser: download the claim links and send each participant theirs.\n </p>\n <Textarea\n placeholder={\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\"}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n Publishing…\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Publish {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : \"participants\"}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n Download claim links (CSV)\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.credentialIssued());\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title=\"Connect your wallet\" description=\"Connect to manage your event.\">\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">Collection not found.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">You are not the organizer of this event.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back to events</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title=\"Manage event\" workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: \"Done\", onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n All events\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n Organizer\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">Manage Event</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">\n Only participants on your <strong className=\"text-foreground\">published list</strong> can claim,\n with the link you send them.\n </p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CM;AA7CN,mBAAyB;AACzB,iBAAiC;AACjC,sBAAsF;AACtF,0BAA4F;AAC5F,oBAAuB;AACvB,kBAAiB;AACjB,2BAAgC;AAChC,+BAAuB;AACvB,sBAAyB;AACzB,sBAAyB;AACzB,gCAAkC;AAClC,iCAAmC;AACnC,6BAA+B;AAC/B,8BAA+B;AAC/B,8BAAgC;A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GAC9K;AAAA,IAEA,4CAAC,mCACC,sDAAC,wBAAO,SAAO,MAAC,SAAQ,SAAQ,MAAK,MAAK,WAAU,SAClD,uDAAC,YAAAA,SAAA,EAAK,MAAK,kBACT;AAAA,kDAAC,iCAAU,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAE9C,GACF,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,uDAAC,SACC;AAAA,mDAAC,UAAK,WAAU,uCACd;AAAA,oDAAC,6BAAM,WAAU,WAAU;AAAA,QAAE;AAAA,SAE/B;AAAA,MACA,4CAAC,QAAG,WAAU,2BAA0B,0BAAY;AAAA,MACpD,4CAAC,OAAE,WAAU,iCAAiC,qBAAW,QAAQ,UAAS;AAAA,OAC5E,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,uDAAC,SAAI,WAAU,0CACb;AAAA,kDAAC,6BAAM,WAAU,mCAAkC;AAAA,MACnD,6CAAC,OAAE,WAAU,iCAAgC;AAAA;AAAA,QACjB,4CAAC,YAAO,WAAU,mBAAkB,4BAAc;AAAA,QAAS;AAAA,SAEvF;AAAA,OACF,GACF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,4CAAC,mCAAO,OAAO,MACb,sDAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":["Link"]}
|
|
@@ -14,6 +14,7 @@ import { TransactionDialog } from "./transaction-dialog.js";
|
|
|
14
14
|
import { TransactionSuccess } from "./transaction-success.js";
|
|
15
15
|
import { WalletRequired } from "./wallet-required.js";
|
|
16
16
|
import { runIntentCalls } from "../utils/run-intent-calls.js";
|
|
17
|
+
import { successMessages } from "../utils/success-messages.js";
|
|
17
18
|
import { useCollection } from "../utils/use-collections.js";
|
|
18
19
|
import { useTransaction } from "../utils/use-transaction.js";
|
|
19
20
|
function parseAddresses(raw) {
|
|
@@ -131,7 +132,7 @@ function PopManagePage({ contract }) {
|
|
|
131
132
|
const isSubmitting = tx.phase === "preparing" || tx.phase === "submitting" || tx.phase === "confirming";
|
|
132
133
|
const isOwner = walletAddress && collection?.owner && normalizeAddress("STARKNET", walletAddress) === normalizeAddress("STARKNET", collection.owner);
|
|
133
134
|
const issue = (recipient) => {
|
|
134
|
-
setDone(
|
|
135
|
+
setDone(successMessages.credentialIssued());
|
|
135
136
|
void tx.run(async (signer) => {
|
|
136
137
|
await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "issue", recipient }));
|
|
137
138
|
});
|
|
@@ -139,7 +140,7 @@ function PopManagePage({ contract }) {
|
|
|
139
140
|
const publish = (addresses) => {
|
|
140
141
|
const list = buildPopAllowlist(addresses);
|
|
141
142
|
const count = Object.keys(list.proofs).length;
|
|
142
|
-
setDone({
|
|
143
|
+
setDone(successMessages.participantsPublished({ count }));
|
|
143
144
|
void tx.run(async (signer) => {
|
|
144
145
|
await runIntentCalls(signer, () => app.getClient().api.intents.create("pop-manage", { owner: signer.address, collection: contract, action: "set_allowlist_root", root: list.root }));
|
|
145
146
|
}).then((ok) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Issue directly</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Send the credential straight to one wallet — for a late participant, without republishing the list or\n changing anyone's claim link.\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n Issue credential\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Participants</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {parsed.length} address{parsed.length !== 1 ? \"es\" : \"\"}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Paste every participant's wallet address. Publishing replaces the previous list and every link\n sent before it — send the new links to everyone who hasn't claimed yet. The list stays in this\n browser: download the claim links and send each participant theirs.\n </p>\n <Textarea\n placeholder={\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\"}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n Publishing…\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Publish {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : \"participants\"}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n Download claim links (CSV)\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone({ title: \"Credential issued\", description: \"The credential is now in their wallet.\" });\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone({ title: \"Participants published\", description: `Published ${count} participant${count !== 1 ? \"s\" : \"\"}.` });\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title=\"Connect your wallet\" description=\"Connect to manage your event.\">\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">Collection not found.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">You are not the organizer of this event.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back to events</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title=\"Manage event\" workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: \"Done\", onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n All events\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n Organizer\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">Manage Event</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">\n Only participants on your <strong className=\"text-foreground\">published list</strong> can claim,\n with the link you send them.\n </p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";AA8CM,SA0EI,UAzEF,KADF;AA5CN,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB,eAAe,wBAA2C;AACtF,SAAS,WAA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IAEA,qBAAC,SAAI,WAAU,+CACb;AAAA,wBAAC,qBAAkB,IAAQ,OAAM,gBAAe,cAAa,6BAAuB,gBAAe,WACjG,8BAAC,sBAAmB,MAAM,WAAW,QAAQ,SAAS,OAAO,KAAK,OAAO,aAAa,KAAK,aAAa,QAAQ,GAAG,QAAQ,SAAS,CAAC,EAAE,OAAO,QAAQ,SAAS,GAAG,MAAM,CAAC,GAAG,GAC9K;AAAA,IAEA,oBAAC,UACC,8BAAC,UAAO,SAAO,MAAC,SAAQ,SAAQ,MAAK,MAAK,WAAU,SAClD,+BAAC,QAAK,MAAK,kBACT;AAAA,0BAAC,aAAU,WAAU,sBAAqB;AAAA,MAAE;AAAA,OAE9C,GACF,GACF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,+BAAC,SACC;AAAA,2BAAC,UAAK,WAAU,uCACd;AAAA,4BAAC,SAAM,WAAU,WAAU;AAAA,QAAE;AAAA,SAE/B;AAAA,MACA,oBAAC,QAAG,WAAU,2BAA0B,0BAAY;AAAA,MACpD,oBAAC,OAAE,WAAU,iCAAiC,qBAAW,QAAQ,UAAS;AAAA,OAC5E,GACF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,+BAAC,SAAI,WAAU,0CACb;AAAA,0BAAC,SAAM,WAAU,mCAAkC;AAAA,MACnD,qBAAC,OAAE,WAAU,iCAAgC;AAAA;AAAA,QACjB,oBAAC,YAAO,WAAU,mBAAkB,4BAAc;AAAA,QAAS;AAAA,SAEvF;AAAA,OACF,GACF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/pop-manage-page.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { buildPopAllowlist, popClaimLinks, popClaimLinksCsv, type PopClaimLink } from \"@medialane/sdk/starknet\";\nimport { ArrowLeft, Award, AlertCircle, CheckCircle2, Download, Loader2, Send, Users } from \"lucide-react\";\nimport { Button } from \"./button.js\";\nimport Link from \"./link.js\";\nimport { useMedialaneApp } from \"./medialane-app.js\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { Skeleton } from \"./skeleton.js\";\nimport { Textarea } from \"./textarea.js\";\nimport { TransactionDialog } from \"./transaction-dialog.js\";\nimport { TransactionSuccess } from \"./transaction-success.js\";\nimport { WalletRequired } from \"./wallet-required.js\";\nimport { runIntentCalls } from \"../utils/run-intent-calls.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\nimport { useCollection } from \"../utils/use-collections.js\";\nimport { useTransaction } from \"../utils/use-transaction.js\";\n\nfunction parseAddresses(raw: string): string[] {\n return raw\n .split(/[\\n,\\s]+/)\n .map((a) => a.trim())\n .filter((a) => /^0x[0-9a-fA-F]+$/.test(a));\n}\n\nfunction downloadCsv(links: PopClaimLink[]) {\n const href = URL.createObjectURL(new Blob([popClaimLinksCsv(links)], { type: \"text/csv\" }));\n const anchor = Object.assign(document.createElement(\"a\"), { href, download: \"claim-links.csv\" });\n anchor.click();\n URL.revokeObjectURL(href);\n}\n\nfunction IssueSection({\n onIssue,\n isSubmitting,\n}: {\n onIssue: (address: string) => void;\n isSubmitting: boolean;\n}) {\n const [raw, setRaw] = useState(\"\");\n const address = raw.trim();\n const valid = /^0x[0-9a-fA-F]{1,64}$/.test(address);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Award className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Issue directly</span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Send the credential straight to one wallet — for a late participant, without republishing the list or\n changing anyone's claim link.\n </p>\n <input\n type=\"text\"\n placeholder=\"0x...\"\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm tabular-nums placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring\"\n />\n <Button\n size=\"sm\"\n variant=\"outline\"\n className=\"w-full\"\n disabled={!valid || isSubmitting}\n onClick={() => {\n onIssue(address);\n setRaw(\"\");\n }}\n >\n <Send className=\"h-3.5 w-3.5 mr-1.5\" />\n Issue credential\n </Button>\n </div>\n );\n}\n\nfunction AllowlistSection({\n onPublish,\n isSubmitting,\n links,\n}: {\n onPublish: (addresses: string[]) => void;\n isSubmitting: boolean;\n links: PopClaimLink[] | null;\n}) {\n const [raw, setRaw] = useState(\"\");\n const parsed = parseAddresses(raw);\n\n return (\n <div className=\"bento-cell p-5 space-y-3\">\n <div className=\"flex items-center gap-2\">\n <Users className=\"h-4 w-4 text-green-500\" />\n <span className=\"font-semibold text-sm\">Participants</span>\n {parsed.length > 0 && (\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {parsed.length} address{parsed.length !== 1 ? \"es\" : \"\"}\n </span>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Paste every participant's wallet address. Publishing replaces the previous list and every link\n sent before it — send the new links to everyone who hasn't claimed yet. The list stays in this\n browser: download the claim links and send each participant theirs.\n </p>\n <Textarea\n placeholder={\"Paste Starknet addresses, one per line:\\n0x04a...\\n0x06b...\"}\n rows={8}\n value={raw}\n onChange={(e) => setRaw(e.target.value)}\n className=\"tabular-nums text-xs resize-none\"\n />\n <Button\n size=\"sm\"\n className=\"w-full bg-green-600 hover:bg-green-700 text-white\"\n disabled={parsed.length === 0 || isSubmitting}\n onClick={() => onPublish(parsed)}\n >\n {isSubmitting ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin mr-1.5\" />\n Publishing…\n </>\n ) : (\n <>\n <CheckCircle2 className=\"h-3.5 w-3.5 mr-1.5\" />\n Publish {parsed.length > 0 ? `${parsed.length} participant${parsed.length !== 1 ? \"s\" : \"\"}` : \"participants\"}\n </>\n )}\n </Button>\n {links && (\n <div className=\"space-y-2 pt-2\">\n <Button variant=\"outline\" size=\"sm\" className=\"w-full\" onClick={() => downloadCsv(links)}>\n <Download className=\"h-3.5 w-3.5 mr-1.5\" />\n Download claim links (CSV)\n </Button>\n <ul className=\"max-h-48 overflow-auto text-xs tabular-nums space-y-1 text-muted-foreground\">\n {links.map((link) => (\n <li key={link.address} className=\"truncate\">{link.address}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\nexport function PopManagePage({ contract }: { contract: string }) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const { collection, isLoading } = useCollection(contract);\n const tx = useTransaction();\n const [done, setDone] = useState({ title: \"\", description: \"\" });\n const [links, setLinks] = useState<PopClaimLink[] | null>(null);\n const isSubmitting = tx.phase === \"preparing\" || tx.phase === \"submitting\" || tx.phase === \"confirming\";\n\n const isOwner =\n walletAddress &&\n collection?.owner &&\n normalizeAddress(\"STARKNET\", walletAddress) === normalizeAddress(\"STARKNET\", collection.owner);\n\n const issue = (recipient: string) => {\n setDone(successMessages.credentialIssued());\n void tx.run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"issue\", recipient }));\n });\n };\n\n const publish = (addresses: string[]) => {\n const list = buildPopAllowlist(addresses);\n const count = Object.keys(list.proofs).length;\n setDone(successMessages.participantsPublished({ count }));\n void tx\n .run(async (signer) => {\n await runIntentCalls(signer, () => app.getClient().api.intents.create(\"pop-manage\", { owner: signer.address, collection: contract, action: \"set_allowlist_root\", root: list.root }));\n })\n .then((ok) => {\n if (ok) setLinks(popClaimLinks(window.location.origin, contract, list));\n });\n };\n\n return (\n <WalletRequired icon={Award} title=\"Connect your wallet\" description=\"Connect to manage your event.\">\n {isLoading ? (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-4\">\n <Skeleton className=\"h-6 w-24\" />\n <Skeleton className=\"h-32 w-full rounded-2xl\" />\n <Skeleton className=\"h-64 w-full rounded-2xl\" />\n </div>\n ) : !collection ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <AlertCircle className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">Collection not found.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back</Link>\n </Button>\n </div>\n ) : !isOwner ? (\n <div className=\"max-w-xl mx-auto px-4 pt-24 pb-8 text-center space-y-4\">\n <Award className=\"h-10 w-10 text-muted-foreground/20 mx-auto\" />\n <p className=\"text-muted-foreground\">You are not the organizer of this event.</p>\n <Button asChild variant=\"outline\" size=\"sm\">\n <Link href=\"/launchpad/pop\">← Back to events</Link>\n </Button>\n </div>\n ) : (\n <div className=\"max-w-xl mx-auto px-4 pt-10 pb-16 space-y-6\">\n <TransactionDialog tx={tx} title=\"Manage event\" workingLabel=\"Updating your event…\" firstStepLabel=\"Prepare\">\n <TransactionSuccess name={collection.name ?? \"Event\"} title={done.title} description={done.description} txHash={tx.txHash} actions={[{ label: \"Done\", onClick: tx.reset }]} />\n </TransactionDialog>\n\n <FadeIn>\n <Button asChild variant=\"ghost\" size=\"sm\" className=\"-ml-2\">\n <Link href=\"/launchpad/pop\">\n <ArrowLeft className=\"h-3.5 w-3.5 mr-1.5\" />\n All events\n </Link>\n </Button>\n </FadeIn>\n\n <FadeIn delay={0.04}>\n <div>\n <span className=\"pill-badge inline-flex gap-1.5 mb-2\">\n <Award className=\"h-3 w-3\" />\n Organizer\n </span>\n <h1 className=\"text-2xl font-bold mt-1\">Manage Event</h1>\n <p className=\"text-sm text-muted-foreground\">{collection.name ?? contract}</p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.08}>\n <div className=\"bento-cell p-4 flex items-center gap-3\">\n <Award className=\"h-4 w-4 text-green-500 shrink-0\" />\n <p className=\"text-xs text-muted-foreground\">\n Only participants on your <strong className=\"text-foreground\">published list</strong> can claim,\n with the link you send them.\n </p>\n </div>\n </FadeIn>\n\n <FadeIn delay={0.12}>\n <AllowlistSection onPublish={publish} isSubmitting={isSubmitting} links={links} />\n </FadeIn>\n\n <FadeIn delay={0.16}>\n <IssueSection onIssue={issue} isSubmitting={isSubmitting} />\n </FadeIn>\n </div>\n )}\n </WalletRequired>\n );\n}\n"],"mappings":";AA+CM,SA0EI,UAzEF,KADF;AA7CN,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,mBAAmB,eAAe,wBAA2C;AACtF,SAAS,WAAW,OAAO,aAAa,cAAc,UAAU,SAAS,MAAM,aAAa;AAC5F,SAAS,cAAc;AACvB,OAAO,UAAU;AACjB,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAE/B,SAAS,eAAe,KAAuB;AAC7C,SAAO,IACJ,MAAM,UAAU,EAChB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,mBAAmB,KAAK,CAAC,CAAC;AAC7C;AAEA,SAAS,YAAY,OAAuB;AAC1C,QAAM,OAAO,IAAI,gBAAgB,IAAI,KAAK,CAAC,iBAAiB,KAAK,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC,CAAC;AAC1F,QAAM,SAAS,OAAO,OAAO,SAAS,cAAc,GAAG,GAAG,EAAE,MAAM,UAAU,kBAAkB,CAAC;AAC/F,SAAO,MAAM;AACb,MAAI,gBAAgB,IAAI;AAC1B;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGG;AACD,QAAM,CAAC,KAAK,MAAM,IAAI,SAAS,EAAE;AACjC,QAAM,UAAU,IAAI,KAAK;AACzB,Q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A,SAEvF;AAAA,OACF,GACF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,oBAAiB,WAAW,SAAS,cAA4B,OAAc,GAClF;AAAA,IAEA,oBAAC,UAAO,OAAO,MACb,8BAAC,gBAAa,SAAS,OAAO,cAA4B,GAC5D;AAAA,KACF,GAEJ;AAEJ;","names":[]}
|
|
@@ -45,6 +45,8 @@ var import_transaction_dialog = require("./transaction-dialog.js");
|
|
|
45
45
|
var import_transaction_success = require("./transaction-success.js");
|
|
46
46
|
var import_run_intent_calls = require("../utils/run-intent-calls.js");
|
|
47
47
|
var import_use_sponsorship = require("../utils/use-sponsorship.js");
|
|
48
|
+
var import_empty_messages = require("../utils/empty-messages.js");
|
|
49
|
+
var import_success_messages = require("../utils/success-messages.js");
|
|
48
50
|
var import_use_transaction = require("../utils/use-transaction.js");
|
|
49
51
|
function useRowAction(copy) {
|
|
50
52
|
const app = (0, import_medialane_app.useMedialaneApp)();
|
|
@@ -57,7 +59,7 @@ function useRowAction(copy) {
|
|
|
57
59
|
await (0, import_run_intent_calls.runIntentCalls)(signer, () => create(app.getClient().api));
|
|
58
60
|
}).then((ok) => ok ? then() : void 0).finally(() => setActiveId(null));
|
|
59
61
|
};
|
|
60
|
-
const dialog = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: copy.title, workingLabel: copy.working, firstStepLabel: "Prepare", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_success.TransactionSuccess, { name: copy.title,
|
|
62
|
+
const dialog = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: copy.title, workingLabel: copy.working, firstStepLabel: "Prepare", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_success.TransactionSuccess, { name: copy.title, ...copy.message, txHash: tx.txHash, actions: [{ label: "Done", onClick: tx.reset }] }) });
|
|
61
63
|
return { run, dialog, busy, activeId };
|
|
62
64
|
}
|
|
63
65
|
function Spinner({ active, idle, className }) {
|
|
@@ -66,7 +68,7 @@ function Spinner({ active, idle, className }) {
|
|
|
66
68
|
function OfferBidsRow({ offer }) {
|
|
67
69
|
const { walletAddress } = (0, import_medialane_app.useMedialaneApp)();
|
|
68
70
|
const { bids, isLoading, mutate } = (0, import_use_sponsorship.useSponsorshipBids)(offer.offerId);
|
|
69
|
-
const action = useRowAction({ title: "Accept bid", working: "Accepting the bid\u2026",
|
|
71
|
+
const action = useRowAction({ title: "Accept bid", working: "Accepting the bid\u2026", message: import_success_messages.successMessages.bidAccepted() });
|
|
70
72
|
if (isLoading || bids.length === 0) return null;
|
|
71
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5 rounded-lg bg-muted/30 p-3", children: [
|
|
72
74
|
action.dialog,
|
|
@@ -96,7 +98,7 @@ function OfferBidsRow({ offer }) {
|
|
|
96
98
|
}
|
|
97
99
|
function ReceivedProposals({ walletAddress }) {
|
|
98
100
|
const { proposals, isLoading, mutate } = (0, import_use_sponsorship.useSponsorshipProposals)({ owner: walletAddress, open: true });
|
|
99
|
-
const action = useRowAction({ title: "Respond to proposal", working: "Sending your response\u2026",
|
|
101
|
+
const action = useRowAction({ title: "Respond to proposal", working: "Sending your response\u2026", message: import_success_messages.successMessages.responseSent() });
|
|
100
102
|
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-20 w-full rounded-xl" });
|
|
101
103
|
if (proposals.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "No proposals awaiting your decision." });
|
|
102
104
|
const respond = (proposalId, decision) => action.run(
|
|
@@ -124,7 +126,7 @@ function ReceivedProposals({ walletAddress }) {
|
|
|
124
126
|
}
|
|
125
127
|
function SentProposals({ walletAddress }) {
|
|
126
128
|
const { proposals, isLoading, mutate } = (0, import_use_sponsorship.useSponsorshipProposals)({ proposer: walletAddress, open: true });
|
|
127
|
-
const action = useRowAction({ title: "Withdraw proposal", working: "Withdrawing your proposal\u2026",
|
|
129
|
+
const action = useRowAction({ title: "Withdraw proposal", working: "Withdrawing your proposal\u2026", message: import_success_messages.successMessages.proposalWithdrawn() });
|
|
128
130
|
if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-20 w-full rounded-xl" });
|
|
129
131
|
if (proposals.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "No pending proposals sent." });
|
|
130
132
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
|
|
@@ -155,7 +157,12 @@ function SentProposals({ walletAddress }) {
|
|
|
155
157
|
}
|
|
156
158
|
function LicenseList({ loading, empty, children }) {
|
|
157
159
|
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_skeleton.Skeleton, { className: "h-16 w-full rounded-xl" });
|
|
158
|
-
if (children.length === 0)
|
|
160
|
+
if (children.length === 0) {
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium", children: empty.title }),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: empty.description })
|
|
164
|
+
] });
|
|
165
|
+
}
|
|
159
166
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", children });
|
|
160
167
|
}
|
|
161
168
|
function PortfolioSponsorships() {
|
|
@@ -182,7 +189,7 @@ function PortfolioSponsorships() {
|
|
|
182
189
|
] }),
|
|
183
190
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
184
191
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-bold", children: "Licenses you hold" }),
|
|
185
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: heldLoading, empty:
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: heldLoading, empty: import_empty_messages.emptyMessages.heldLicenses, children: held.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4", children: [
|
|
186
193
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", l.assetContract, l.assetTokenId), className: "hover:underline", children: "License on this asset" }) }),
|
|
187
194
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
188
195
|
"from ",
|
|
@@ -192,7 +199,7 @@ function PortfolioSponsorships() {
|
|
|
192
199
|
] }),
|
|
193
200
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
194
201
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "text-sm font-bold", children: "Licenses issued on your work" }),
|
|
195
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: issuedLoading, empty:
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LicenseList, { loading: issuedLoading, empty: import_empty_messages.emptyMessages.issuedLicenses, children: issued.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "bento-cell p-4", children: [
|
|
196
203
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: (0, import_sdk.assetHref)("STARKNET", l.assetContract, l.assetTokenId), className: "hover:underline", children: "License on this asset" }) }),
|
|
197
204
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground", children: [
|
|
198
205
|
"held by ",
|