@medialane/ui 0.346.0 → 0.347.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/asset-overview-content.cjs +27 -17
- package/dist/components/asset-overview-content.cjs.map +1 -1
- package/dist/components/asset-overview-content.js +27 -17
- package/dist/components/asset-overview-content.js.map +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
- package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as input_otp from 'input-otp';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
4
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (newValue: string) => unknown;
|
|
7
7
|
maxLength: number;
|
|
@@ -14,7 +14,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
14
14
|
} & {
|
|
15
15
|
render: (props: input_otp.RenderProps) => React.ReactNode;
|
|
16
16
|
children?: never;
|
|
17
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
18
18
|
value?: string;
|
|
19
19
|
onChange?: (newValue: string) => unknown;
|
|
20
20
|
maxLength: number;
|
|
@@ -62,19 +62,28 @@ const SPAN_LG_3 = {
|
|
|
62
62
|
2: "lg:col-span-2",
|
|
63
63
|
3: "lg:col-span-3"
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
function detailSpans(count) {
|
|
66
|
+
const out = [];
|
|
67
|
+
while (out.length < count) {
|
|
68
|
+
const left = count - out.length;
|
|
69
|
+
if (left >= 5) out.push(1, 2, 1);
|
|
70
|
+
else if (left === 4 || left === 2) out.push(...Array(left).fill(2));
|
|
71
|
+
else if (left === 3) out.push(1, 2, 1);
|
|
72
|
+
else out.push(4);
|
|
73
|
+
}
|
|
74
|
+
return out.slice(0, count);
|
|
75
|
+
}
|
|
76
|
+
const DETAIL_DOTS = ["bg-brand-blue", "bg-brand-rose", "bg-brand-purple", "bg-brand-orange"];
|
|
77
|
+
function Cell({ label, value, dot, className }) {
|
|
72
78
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
79
|
"div",
|
|
74
80
|
{
|
|
75
|
-
className: `flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? ""}`,
|
|
81
|
+
className: `flex flex-col justify-end gap-1.5 rounded-3xl bg-foreground/[0.06] px-5 py-4 min-h-[5.5rem] ${className ?? ""}`,
|
|
76
82
|
children: [
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "flex items-center gap-2 text-xs font-medium text-muted-foreground", title: label, children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: `h-2 w-2 shrink-0 rounded-full ${dot}` }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate", children: label })
|
|
86
|
+
] }),
|
|
78
87
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-lg font-semibold leading-tight tracking-tight text-foreground break-words", children: value })
|
|
79
88
|
]
|
|
80
89
|
}
|
|
@@ -102,7 +111,7 @@ function AssetOverviewContent({
|
|
|
102
111
|
const facts = [
|
|
103
112
|
{ icon: import_lucide_react.DollarSign, label: "Commercial use", value: commercialUse, tile: "bg-brand-orange text-white", pill: "bg-white/20" },
|
|
104
113
|
{ icon: import_lucide_react.GitBranch, label: "Derivatives", value: derivatives, tile: "bg-brand-rose text-white", pill: "bg-white/20" },
|
|
105
|
-
{ icon: import_lucide_react.UserCheck, label: "Attribution", value: attribution, tile: "bg-
|
|
114
|
+
{ icon: import_lucide_react.UserCheck, label: "Attribution", value: attribution, tile: "bg-[hsl(250_45%_14%)] text-white ring-1 ring-white/10", pill: "bg-white/15" },
|
|
106
115
|
{ icon: import_lucide_react.Globe, label: "Territory", value: territory, tile: "bg-brand-blue text-white", pill: "bg-white/20" },
|
|
107
116
|
{ icon: import_lucide_react.Bot, label: "AI & data mining", value: aiPolicy, tile: "bg-brand-purple text-white", pill: "bg-white/20" },
|
|
108
117
|
{ icon: import_lucide_react.Percent, label: "Royalty", value: royalty, tile: "bg-brand-orange text-white", pill: "bg-white/20" }
|
|
@@ -111,7 +120,7 @@ function AssetOverviewContent({
|
|
|
111
120
|
const factSpansLg = bentoSpans(facts.length);
|
|
112
121
|
const detailUnits = displayAttributes.map((attribute) => isAddressLike(attribute.value) ? 2 : 1);
|
|
113
122
|
const detailSpans2 = fillSpans(detailUnits, 2);
|
|
114
|
-
const detailSpansSm =
|
|
123
|
+
const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));
|
|
115
124
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 space-y-7", children: [
|
|
116
125
|
content ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
117
126
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Content" }),
|
|
@@ -139,7 +148,7 @@ function AssetOverviewContent({
|
|
|
139
148
|
{
|
|
140
149
|
className: `relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`,
|
|
141
150
|
children: [
|
|
142
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": true, className: "pointer-events-none absolute -
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": true, className: "pointer-events-none absolute -right-3 -top-3 h-20 w-20 opacity-15" }),
|
|
143
152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`, children: [
|
|
144
153
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-3.5 w-3.5" }),
|
|
145
154
|
label
|
|
@@ -149,10 +158,10 @@ function AssetOverviewContent({
|
|
|
149
158
|
},
|
|
150
159
|
label
|
|
151
160
|
)) }),
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose
|
|
153
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Scale, { "aria-hidden": true, className: "pointer-events-none absolute -right-
|
|
154
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-
|
|
155
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "relative
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-gradient-to-r from-brand-rose to-brand-orange p-5 text-white sm:p-6", children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Scale, { "aria-hidden": true, className: "pointer-events-none absolute -right-3 -top-4 h-24 w-24 -rotate-12 text-white/15" }),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-white/25", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Scale, { className: "h-5 w-5" }) }),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "relative pr-16 text-sm leading-relaxed text-white/95", children: "Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries." })
|
|
156
165
|
] })
|
|
157
166
|
] })
|
|
158
167
|
] }) : null,
|
|
@@ -162,7 +171,8 @@ function AssetOverviewContent({
|
|
|
162
171
|
Cell,
|
|
163
172
|
{
|
|
164
173
|
label: attribute.trait_type ?? "Trait",
|
|
165
|
-
|
|
174
|
+
dot: DETAIL_DOTS[index % DETAIL_DOTS.length],
|
|
175
|
+
className: `${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`,
|
|
166
176
|
value: isAddressLike(attribute.value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_address_display.AddressDisplay, { address: attribute.value, chars: 4, className: "text-base font-semibold" }) : attribute.value ?? "\u2014"
|
|
167
177
|
},
|
|
168
178
|
index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nconst DETAIL_TINTS = [\n \"bg-brand-blue/10 [&_p]:text-brand-blue\",\n \"bg-brand-rose/10 [&_p]:text-brand-rose\",\n \"bg-brand-purple/10 [&_p]:text-brand-purple\",\n \"bg-brand-orange/10 [&_p]:text-brand-orange\",\n];\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <div\n className={`flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}\n >\n <p className=\"text-xs font-medium truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const facts = [\n { icon: DollarSign, label: \"Commercial use\", value: commercialUse, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n { icon: GitBranch, label: \"Derivatives\", value: derivatives, tile: \"bg-brand-rose text-white\", pill: \"bg-white/20\" },\n { icon: UserCheck, label: \"Attribution\", value: attribution, tile: \"bg-foreground text-background\", pill: \"bg-background/15\" },\n { icon: Globe, label: \"Territory\", value: territory, tile: \"bg-brand-blue text-white\", pill: \"bg-white/20\" },\n { icon: Bot, label: \"AI & data mining\", value: aiPolicy, tile: \"bg-brand-purple text-white\", pill: \"bg-white/20\" },\n { icon: Percent, label: \"Royalty\", value: royalty, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n ].filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = fillSpans(detailUnits, 4);\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Content</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Rights</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <div className=\"relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8\">\n <span aria-hidden className=\"pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10\" />\n <span aria-hidden className=\"pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70\" />\n <div className=\"relative space-y-3\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-white/80\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm\">\n {summary}\n </p>\n ) : null}\n </div>\n </div>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tile, pill }, index) => (\n <div\n key={label}\n className={`relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Icon aria-hidden className=\"pointer-events-none absolute -bottom-5 -right-4 h-28 w-28 opacity-15\" />\n <span className={`relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n <p className=\"relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words\">{value}</p>\n </div>\n ))}\n </div>\n\n <div className=\"relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose/10 p-5 sm:p-6\">\n <Scale aria-hidden className=\"pointer-events-none absolute -right-4 -bottom-8 h-32 w-32 -rotate-12 text-brand-rose/15\" />\n <span className=\"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand-rose text-white\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"relative max-w-3xl text-sm leading-relaxed text-foreground/80\">\n Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\n </p>\n </div>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n className={`${DETAIL_TINTS[index % DETAIL_TINTS.length]} ${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuEI;AApEJ,0BAA2F;AAC3F,6BAA8B;AAC9B,6BAA+B;AAC/B,2BAA6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B;AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,4CAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nfunction detailSpans(count: number): number[] {\n const out: number[] = [];\n while (out.length < count) {\n const left = count - out.length;\n if (left >= 5) out.push(1, 2, 1);\n else if (left === 4 || left === 2) out.push(...Array(left).fill(2));\n else if (left === 3) out.push(1, 2, 1);\n else out.push(4);\n }\n return out.slice(0, count);\n}\n\nconst DETAIL_DOTS = [\"bg-brand-blue\", \"bg-brand-rose\", \"bg-brand-purple\", \"bg-brand-orange\"];\n\nfunction Cell({ label, value, dot, className }: { label: string; value: ReactNode; dot: string; className?: string }) {\n return (\n <div\n className={`flex flex-col justify-end gap-1.5 rounded-3xl bg-foreground/[0.06] px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}\n >\n <p className=\"flex items-center gap-2 text-xs font-medium text-muted-foreground\" title={label}>\n <span aria-hidden className={`h-2 w-2 shrink-0 rounded-full ${dot}`} />\n <span className=\"truncate\">{label}</span>\n </p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const facts = [\n { icon: DollarSign, label: \"Commercial use\", value: commercialUse, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n { icon: GitBranch, label: \"Derivatives\", value: derivatives, tile: \"bg-brand-rose text-white\", pill: \"bg-white/20\" },\n { icon: UserCheck, label: \"Attribution\", value: attribution, tile: \"bg-[hsl(250_45%_14%)] text-white ring-1 ring-white/10\", pill: \"bg-white/15\" },\n { icon: Globe, label: \"Territory\", value: territory, tile: \"bg-brand-blue text-white\", pill: \"bg-white/20\" },\n { icon: Bot, label: \"AI & data mining\", value: aiPolicy, tile: \"bg-brand-purple text-white\", pill: \"bg-white/20\" },\n { icon: Percent, label: \"Royalty\", value: royalty, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n ].filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Content</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Rights</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <div className=\"relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8\">\n <span aria-hidden className=\"pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10\" />\n <span aria-hidden className=\"pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70\" />\n <div className=\"relative space-y-3\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-white/80\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm\">\n {summary}\n </p>\n ) : null}\n </div>\n </div>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tile, pill }, index) => (\n <div\n key={label}\n className={`relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Icon aria-hidden className=\"pointer-events-none absolute -right-3 -top-3 h-20 w-20 opacity-15\" />\n <span className={`relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n <p className=\"relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words\">{value}</p>\n </div>\n ))}\n </div>\n\n <div className=\"relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-gradient-to-r from-brand-rose to-brand-orange p-5 text-white sm:p-6\">\n <Scale aria-hidden className=\"pointer-events-none absolute -right-3 -top-4 h-24 w-24 -rotate-12 text-white/15\" />\n <span className=\"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-white/25\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"relative pr-16 text-sm leading-relaxed text-white/95\">\n Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\n </p>\n </div>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n dot={DETAIL_DOTS[index % DETAIL_DOTS.length]}\n className={`${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiFM;AA9EN,0BAA2F;AAC3F,6BAA8B;AAC9B,6BAA+B;AAC/B,2BAA6B;AAC7B,6BAA+B;AAC/B,gBAA8B;AAe9B,SAAS,aAAa,OAAuB;AAC3C,QAAM,QAAQ,wBAAc,KAAK,CAAC,YAAY,QAAQ,UAAU,KAAK,GAAG,SAAS;AACjF,SAAO,MAAM,MAAM,UAAK,EAAE,CAAC,KAAK;AAClC;AAEA,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAE/D,SAAS,UAAU,OAAiB,MAAwB;AAC1D,QAAM,MAAM,MAAM,IAAI,CAAC,SAAS,KAAK,IAAI,MAAM,IAAI,CAAC;AACpD,QAAM,OAAO,IAAI,OAA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,IAAI,UAAU,cAAc,KAAK,CAAC,CAAC;AAAA,UAC5E,OACE,cAAc,UAAU,KAAK,IAC3B,4CAAC,yCAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,2BAA0B,IAEzF,UAAU,SAAS;AAAA;AAAA,QARlB;AAAA,MAWP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,4CAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -39,19 +39,28 @@ const SPAN_LG_3 = {
|
|
|
39
39
|
2: "lg:col-span-2",
|
|
40
40
|
3: "lg:col-span-3"
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
function detailSpans(count) {
|
|
43
|
+
const out = [];
|
|
44
|
+
while (out.length < count) {
|
|
45
|
+
const left = count - out.length;
|
|
46
|
+
if (left >= 5) out.push(1, 2, 1);
|
|
47
|
+
else if (left === 4 || left === 2) out.push(...Array(left).fill(2));
|
|
48
|
+
else if (left === 3) out.push(1, 2, 1);
|
|
49
|
+
else out.push(4);
|
|
50
|
+
}
|
|
51
|
+
return out.slice(0, count);
|
|
52
|
+
}
|
|
53
|
+
const DETAIL_DOTS = ["bg-brand-blue", "bg-brand-rose", "bg-brand-purple", "bg-brand-orange"];
|
|
54
|
+
function Cell({ label, value, dot, className }) {
|
|
49
55
|
return /* @__PURE__ */ jsxs(
|
|
50
56
|
"div",
|
|
51
57
|
{
|
|
52
|
-
className: `flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? ""}`,
|
|
58
|
+
className: `flex flex-col justify-end gap-1.5 rounded-3xl bg-foreground/[0.06] px-5 py-4 min-h-[5.5rem] ${className ?? ""}`,
|
|
53
59
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-xs font-medium text-muted-foreground", title: label, children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: `h-2 w-2 shrink-0 rounded-full ${dot}` }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: label })
|
|
63
|
+
] }),
|
|
55
64
|
/* @__PURE__ */ jsx("div", { className: "text-lg font-semibold leading-tight tracking-tight text-foreground break-words", children: value })
|
|
56
65
|
]
|
|
57
66
|
}
|
|
@@ -79,7 +88,7 @@ function AssetOverviewContent({
|
|
|
79
88
|
const facts = [
|
|
80
89
|
{ icon: DollarSign, label: "Commercial use", value: commercialUse, tile: "bg-brand-orange text-white", pill: "bg-white/20" },
|
|
81
90
|
{ icon: GitBranch, label: "Derivatives", value: derivatives, tile: "bg-brand-rose text-white", pill: "bg-white/20" },
|
|
82
|
-
{ icon: UserCheck, label: "Attribution", value: attribution, tile: "bg-
|
|
91
|
+
{ icon: UserCheck, label: "Attribution", value: attribution, tile: "bg-[hsl(250_45%_14%)] text-white ring-1 ring-white/10", pill: "bg-white/15" },
|
|
83
92
|
{ icon: Globe, label: "Territory", value: territory, tile: "bg-brand-blue text-white", pill: "bg-white/20" },
|
|
84
93
|
{ icon: Bot, label: "AI & data mining", value: aiPolicy, tile: "bg-brand-purple text-white", pill: "bg-white/20" },
|
|
85
94
|
{ icon: Percent, label: "Royalty", value: royalty, tile: "bg-brand-orange text-white", pill: "bg-white/20" }
|
|
@@ -88,7 +97,7 @@ function AssetOverviewContent({
|
|
|
88
97
|
const factSpansLg = bentoSpans(facts.length);
|
|
89
98
|
const detailUnits = displayAttributes.map((attribute) => isAddressLike(attribute.value) ? 2 : 1);
|
|
90
99
|
const detailSpans2 = fillSpans(detailUnits, 2);
|
|
91
|
-
const detailSpansSm =
|
|
100
|
+
const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));
|
|
92
101
|
return /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-7", children: [
|
|
93
102
|
content ? /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
94
103
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground", children: "Content" }),
|
|
@@ -116,7 +125,7 @@ function AssetOverviewContent({
|
|
|
116
125
|
{
|
|
117
126
|
className: `relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`,
|
|
118
127
|
children: [
|
|
119
|
-
/* @__PURE__ */ jsx(Icon, { "aria-hidden": true, className: "pointer-events-none absolute -
|
|
128
|
+
/* @__PURE__ */ jsx(Icon, { "aria-hidden": true, className: "pointer-events-none absolute -right-3 -top-3 h-20 w-20 opacity-15" }),
|
|
120
129
|
/* @__PURE__ */ jsxs("span", { className: `relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`, children: [
|
|
121
130
|
/* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" }),
|
|
122
131
|
label
|
|
@@ -126,10 +135,10 @@ function AssetOverviewContent({
|
|
|
126
135
|
},
|
|
127
136
|
label
|
|
128
137
|
)) }),
|
|
129
|
-
/* @__PURE__ */ jsxs("div", { className: "relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose
|
|
130
|
-
/* @__PURE__ */ jsx(Scale, { "aria-hidden": true, className: "pointer-events-none absolute -right-
|
|
131
|
-
/* @__PURE__ */ jsx("span", { className: "relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-
|
|
132
|
-
/* @__PURE__ */ jsx("p", { className: "relative
|
|
138
|
+
/* @__PURE__ */ jsxs("div", { className: "relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-gradient-to-r from-brand-rose to-brand-orange p-5 text-white sm:p-6", children: [
|
|
139
|
+
/* @__PURE__ */ jsx(Scale, { "aria-hidden": true, className: "pointer-events-none absolute -right-3 -top-4 h-24 w-24 -rotate-12 text-white/15" }),
|
|
140
|
+
/* @__PURE__ */ jsx("span", { className: "relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-white/25", children: /* @__PURE__ */ jsx(Scale, { className: "h-5 w-5" }) }),
|
|
141
|
+
/* @__PURE__ */ jsx("p", { className: "relative pr-16 text-sm leading-relaxed text-white/95", children: "Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries." })
|
|
133
142
|
] })
|
|
134
143
|
] })
|
|
135
144
|
] }) : null,
|
|
@@ -139,7 +148,8 @@ function AssetOverviewContent({
|
|
|
139
148
|
Cell,
|
|
140
149
|
{
|
|
141
150
|
label: attribute.trait_type ?? "Trait",
|
|
142
|
-
|
|
151
|
+
dot: DETAIL_DOTS[index % DETAIL_DOTS.length],
|
|
152
|
+
className: `${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`,
|
|
143
153
|
value: isAddressLike(attribute.value) ? /* @__PURE__ */ jsx(AddressDisplay, { address: attribute.value, chars: 4, className: "text-base font-semibold" }) : attribute.value ?? "\u2014"
|
|
144
154
|
},
|
|
145
155
|
index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nconst DETAIL_TINTS = [\n \"bg-brand-blue/10 [&_p]:text-brand-blue\",\n \"bg-brand-rose/10 [&_p]:text-brand-rose\",\n \"bg-brand-purple/10 [&_p]:text-brand-purple\",\n \"bg-brand-orange/10 [&_p]:text-brand-orange\",\n];\n\nfunction Cell({ label, value, className }: { label: string; value: ReactNode; className?: string }) {\n return (\n <div\n className={`flex flex-col justify-end gap-1 rounded-3xl px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}\n >\n <p className=\"text-xs font-medium truncate\" title={label}>\n {label}\n </p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const facts = [\n { icon: DollarSign, label: \"Commercial use\", value: commercialUse, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n { icon: GitBranch, label: \"Derivatives\", value: derivatives, tile: \"bg-brand-rose text-white\", pill: \"bg-white/20\" },\n { icon: UserCheck, label: \"Attribution\", value: attribution, tile: \"bg-foreground text-background\", pill: \"bg-background/15\" },\n { icon: Globe, label: \"Territory\", value: territory, tile: \"bg-brand-blue text-white\", pill: \"bg-white/20\" },\n { icon: Bot, label: \"AI & data mining\", value: aiPolicy, tile: \"bg-brand-purple text-white\", pill: \"bg-white/20\" },\n { icon: Percent, label: \"Royalty\", value: royalty, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n ].filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = fillSpans(detailUnits, 4);\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Content</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Rights</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <div className=\"relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8\">\n <span aria-hidden className=\"pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10\" />\n <span aria-hidden className=\"pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70\" />\n <div className=\"relative space-y-3\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-white/80\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm\">\n {summary}\n </p>\n ) : null}\n </div>\n </div>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tile, pill }, index) => (\n <div\n key={label}\n className={`relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Icon aria-hidden className=\"pointer-events-none absolute -bottom-5 -right-4 h-28 w-28 opacity-15\" />\n <span className={`relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n <p className=\"relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words\">{value}</p>\n </div>\n ))}\n </div>\n\n <div className=\"relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-brand-rose/10 p-5 sm:p-6\">\n <Scale aria-hidden className=\"pointer-events-none absolute -right-4 -bottom-8 h-32 w-32 -rotate-12 text-brand-rose/15\" />\n <span className=\"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand-rose text-white\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"relative max-w-3xl text-sm leading-relaxed text-foreground/80\">\n Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\n </p>\n </div>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n className={`${DETAIL_TINTS[index % DETAIL_TINTS.length]} ${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAuEI,SAGE,KAHF;AApEJ,SAAS,KAAK,YAAY,cAAc,WAAW,OAAO,SAAS,OAAO,iBAAiB;AAC3F,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB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AAAA,MAUP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,oBAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-overview-content.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Bot, DollarSign, ExternalLink, GitBranch, Globe, Percent, Scale, UserCheck } from \"lucide-react\";\nimport { IPTypeDisplay } from \"./ip-type-display.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { MarkdownText } from \"./markdown-text.js\";\nimport { licenseSummary } from \"../utils/license-summary.js\";\nimport { LICENSE_TYPES } from \"../data/ip.js\";\n\ninterface AssetAttribute {\n trait_type?: string;\n value?: string;\n}\n\ninterface AssetOverviewContentProps {\n attributes: AssetAttribute[];\n hasTemplateData: boolean;\n isDisplayAttr: (attribute: AssetAttribute) => boolean;\n content?: string | null;\n link?: string | null;\n}\n\nfunction licenseLabel(value: string): string {\n const label = LICENSE_TYPES.find((license) => license.value === value)?.label ?? value;\n return label.split(\" — \")[1] ?? label;\n}\n\nconst isAddressLike = (v?: unknown): boolean =>\n typeof v === \"string\" && /^0x[0-9a-fA-F]{16,}$/.test(v.trim());\n\nfunction fillSpans(units: number[], cols: number): number[] {\n const out = units.map((unit) => Math.min(unit, cols));\n const rest = out.reduce((sum, unit) => sum + unit, 0) % cols;\n if (rest && out.length) out[out.length - 1] += cols - rest;\n return out;\n}\n\nfunction bentoSpans(count: number): number[] {\n const out: number[] = [];\n const rows = [[2, 1], [1, 2]];\n for (let row = 0; out.length < count; row++) {\n const left = count - out.length;\n if (left === 1) out.push(3);\n else out.push(...rows[row % 2]);\n }\n return out;\n}\n\nconst SPAN_2: Record<number, string> = { 1: \"col-span-1\", 2: \"col-span-2\" };\nconst SPAN_SM_4: Record<number, string> = {\n 1: \"sm:col-span-1\",\n 2: \"sm:col-span-2\",\n 3: \"sm:col-span-3\",\n 4: \"sm:col-span-4\",\n};\nconst SPAN_LG_3: Record<number, string> = {\n 1: \"lg:col-span-1\",\n 2: \"lg:col-span-2\",\n 3: \"lg:col-span-3\",\n};\n\nfunction detailSpans(count: number): number[] {\n const out: number[] = [];\n while (out.length < count) {\n const left = count - out.length;\n if (left >= 5) out.push(1, 2, 1);\n else if (left === 4 || left === 2) out.push(...Array(left).fill(2));\n else if (left === 3) out.push(1, 2, 1);\n else out.push(4);\n }\n return out.slice(0, count);\n}\n\nconst DETAIL_DOTS = [\"bg-brand-blue\", \"bg-brand-rose\", \"bg-brand-purple\", \"bg-brand-orange\"];\n\nfunction Cell({ label, value, dot, className }: { label: string; value: ReactNode; dot: string; className?: string }) {\n return (\n <div\n className={`flex flex-col justify-end gap-1.5 rounded-3xl bg-foreground/[0.06] px-5 py-4 min-h-[5.5rem] ${className ?? \"\"}`}\n >\n <p className=\"flex items-center gap-2 text-xs font-medium text-muted-foreground\" title={label}>\n <span aria-hidden className={`h-2 w-2 shrink-0 rounded-full ${dot}`} />\n <span className=\"truncate\">{label}</span>\n </p>\n <div className=\"text-lg font-semibold leading-tight tracking-tight text-foreground break-words\">{value}</div>\n </div>\n );\n}\n\nexport function AssetOverviewContent({\n attributes,\n hasTemplateData,\n isDisplayAttr,\n content,\n link,\n}: AssetOverviewContentProps) {\n const attr = (trait: string) => attributes.find((attribute) => attribute.trait_type === trait)?.value;\n const licenseType = attr(\"License\");\n const commercialUse = attr(\"Commercial Use\");\n const derivatives = attr(\"Derivatives\");\n const attribution = attr(\"Attribution\");\n const territory = attr(\"Territory\");\n const aiPolicy = attr(\"AI Policy\");\n const royalty = attr(\"Royalty\");\n const summary = licenseSummary(attributes);\n const hasLicenseData = !!(licenseType || commercialUse || derivatives || attribution);\n const displayAttributes = attributes.filter((attribute) => isDisplayAttr(attribute));\n\n const licenseDescription = LICENSE_TYPES.find((license) => license.value === licenseType)?.description;\n\n const facts = [\n { icon: DollarSign, label: \"Commercial use\", value: commercialUse, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n { icon: GitBranch, label: \"Derivatives\", value: derivatives, tile: \"bg-brand-rose text-white\", pill: \"bg-white/20\" },\n { icon: UserCheck, label: \"Attribution\", value: attribution, tile: \"bg-[hsl(250_45%_14%)] text-white ring-1 ring-white/10\", pill: \"bg-white/15\" },\n { icon: Globe, label: \"Territory\", value: territory, tile: \"bg-brand-blue text-white\", pill: \"bg-white/20\" },\n { icon: Bot, label: \"AI & data mining\", value: aiPolicy, tile: \"bg-brand-purple text-white\", pill: \"bg-white/20\" },\n { icon: Percent, label: \"Royalty\", value: royalty, tile: \"bg-brand-orange text-white\", pill: \"bg-white/20\" },\n ].filter((row) => !!row.value);\n\n const factSpans2 = fillSpans(facts.map(() => 1), 2);\n const factSpansLg = bentoSpans(facts.length);\n const detailUnits = displayAttributes.map((attribute) => (isAddressLike(attribute.value) ? 2 : 1));\n const detailSpans2 = fillSpans(detailUnits, 2);\n const detailSpansSm = detailSpans(displayAttributes.length).map((span, index) => Math.max(span, detailUnits[index]));\n\n return (\n <div className=\"mt-4 space-y-7\">\n {content ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Content</h3>\n <MarkdownText text={content} />\n </section>\n ) : null}\n\n {link ? (\n <a href={link} target=\"_blank\" rel=\"noopener noreferrer\" className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\">\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n ) : null}\n\n {hasTemplateData ? <IPTypeDisplay attributes={attributes} /> : null}\n\n {hasLicenseData ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Rights</h3>\n <div className=\"grid grid-cols-2 lg:grid-cols-6 gap-3\">\n <div className=\"relative col-span-2 lg:col-span-3 flex min-h-[15rem] flex-col justify-end overflow-hidden rounded-[2rem] bg-gradient-to-br from-brand-purple via-brand-blue to-brand-blue p-6 text-white sm:p-8\">\n <span aria-hidden className=\"pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full ring-[28px] ring-white/10\" />\n <span aria-hidden className=\"pointer-events-none absolute right-10 top-12 h-20 w-20 rounded-full bg-brand-rose/70\" />\n <div className=\"relative space-y-3\">\n {licenseType ? (\n <p className=\"text-3xl sm:text-4xl font-semibold tracking-tight leading-[1.05]\">\n {licenseLabel(licenseType)}\n </p>\n ) : null}\n {licenseDescription ? (\n <p className=\"max-w-md text-sm text-white/80\">{licenseDescription}</p>\n ) : null}\n {summary ? (\n <p className=\"inline-block rounded-full bg-white/20 px-4 py-2 text-sm font-medium leading-snug backdrop-blur-sm\">\n {summary}\n </p>\n ) : null}\n </div>\n </div>\n\n <div className=\"col-span-2 lg:col-span-3 grid grid-cols-2 lg:grid-cols-3 gap-3 auto-rows-[minmax(8.5rem,1fr)]\">\n {facts.map(({ icon: Icon, label, value, tile, pill }, index) => (\n <div\n key={label}\n className={`relative flex flex-col justify-between gap-4 overflow-hidden rounded-[1.75rem] p-5 ${tile} ${SPAN_2[factSpans2[index]]} ${SPAN_LG_3[factSpansLg[index]]}`}\n >\n <Icon aria-hidden className=\"pointer-events-none absolute -right-3 -top-3 h-20 w-20 opacity-15\" />\n <span className={`relative inline-flex w-fit items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium ${pill}`}>\n <Icon className=\"h-3.5 w-3.5\" />\n {label}\n </span>\n <p className=\"relative text-2xl sm:text-3xl font-semibold leading-none tracking-tight break-words\">{value}</p>\n </div>\n ))}\n </div>\n\n <div className=\"relative col-span-2 lg:col-span-6 flex items-center gap-4 overflow-hidden rounded-[2rem] bg-gradient-to-r from-brand-rose to-brand-orange p-5 text-white sm:p-6\">\n <Scale aria-hidden className=\"pointer-events-none absolute -right-3 -top-4 h-24 w-24 -rotate-12 text-white/15\" />\n <span className=\"relative flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-white/25\">\n <Scale className=\"h-5 w-5\" />\n </span>\n <p className=\"relative pr-16 text-sm leading-relaxed text-white/95\">\n Creative work is protected with international copyright law. The Berne Convention for the Protection of Literary and Artistic Works is the foundational international copyright treaty, ratified by 181 signatory countries.\n </p>\n </div>\n </div>\n </section>\n ) : null}\n\n {displayAttributes.length > 0 ? (\n <section className=\"space-y-3\">\n <h3 className=\"text-sm font-semibold text-muted-foreground\">Details</h3>\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3 [grid-auto-flow:dense]\">\n {displayAttributes.map((attribute, index) => (\n <Cell\n key={index}\n label={attribute.trait_type ?? \"Trait\"}\n dot={DETAIL_DOTS[index % DETAIL_DOTS.length]}\n className={`${SPAN_2[detailSpans2[index]]} ${SPAN_SM_4[detailSpansSm[index]]}`}\n value={\n isAddressLike(attribute.value) ? (\n <AddressDisplay address={attribute.value!} chars={4} className=\"text-base font-semibold\" />\n ) : (\n attribute.value ?? \"—\"\n )\n }\n />\n ))}\n </div>\n </section>\n ) : null}\n\n {!hasTemplateData && !hasLicenseData && displayAttributes.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">No additional details available.</p>\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAiFM,SACE,KADF;AA9EN,SAAS,KAAK,YAAY,cAAc,WAAW,OAAO,SAAS,OAAO,iBAAiB;AAC3F,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAe9B,SAAS,aAAa,OAAuB;AAC3C,QAAM,QAAQ,cAAc,KAAK,CAAC,YAAY,QAAQ,UAAU,KAAK,GAAG,SAAS;AACjF,SAAO,MAAM,MAAM,UAAK,EAAE,CAAC,KAAK;AAClC;AAEA,MAAM,gBAAgB,CAAC,MACrB,OAAO,MAAM,YAAY,uBAAuB,KAAK,EAAE,KAAK,CAAC;AAE/D,SAAS,UAAU,OAAiB,MAAwB;AAC1D,QAAM,MAAM,MAAM,IAAI,CAAC,SAAS,KAAK,IAAI,MAAM,IAAI,C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Aa,KAAK,CAAC,CAAC,IAAI,UAAU,cAAc,KAAK,CAAC,CAAC;AAAA,UAC5E,OACE,cAAc,UAAU,KAAK,IAC3B,oBAAC,kBAAe,SAAS,UAAU,OAAQ,OAAO,GAAG,WAAU,2BAA0B,IAEzF,UAAU,SAAS;AAAA;AAAA,QARlB;AAAA,MAWP,CACD,GACH;AAAA,OACF,IACE;AAAA,IAEH,CAAC,mBAAmB,CAAC,kBAAkB,kBAAkB,WAAW,IACnE,oBAAC,OAAE,WAAU,iCAAgC,8CAAgC,IAC3E;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
7
|
-
size?: "
|
|
6
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | "premium" | "tonal" | "gradient-border" | "gradient-fill" | null | undefined;
|
|
7
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
10
|
asChild?: boolean;
|
|
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
19
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
20
|
licenseType: string;
|
|
21
21
|
commercialUse: "Yes" | "No";
|
|
22
|
-
value: string;
|
|
23
|
-
recipient: string;
|
|
24
22
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
25
23
|
attribution: "Required" | "Not Required";
|
|
26
24
|
geographicScope: string;
|
|
27
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
28
26
|
royalty: number;
|
|
27
|
+
value: string;
|
|
28
|
+
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
33
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
34
|
licenseType: string;
|
|
35
35
|
commercialUse: "Yes" | "No";
|
|
36
|
-
value: string;
|
|
37
|
-
recipient: string;
|
|
38
36
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
39
37
|
attribution: "Required" | "Not Required";
|
|
40
38
|
geographicScope: string;
|
|
41
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
42
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
|
+
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
45
45
|
}>;
|
|
@@ -19,13 +19,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
19
19
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
20
20
|
licenseType: string;
|
|
21
21
|
commercialUse: "Yes" | "No";
|
|
22
|
-
value: string;
|
|
23
|
-
recipient: string;
|
|
24
22
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
25
23
|
attribution: "Required" | "Not Required";
|
|
26
24
|
geographicScope: string;
|
|
27
25
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
28
26
|
royalty: number;
|
|
27
|
+
value: string;
|
|
28
|
+
recipient: string;
|
|
29
29
|
description?: string | undefined;
|
|
30
30
|
external_url?: string | undefined;
|
|
31
31
|
}, {
|
|
@@ -33,13 +33,13 @@ declare const editionMintSchema: z.ZodObject<{
|
|
|
33
33
|
ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
|
|
34
34
|
licenseType: string;
|
|
35
35
|
commercialUse: "Yes" | "No";
|
|
36
|
-
value: string;
|
|
37
|
-
recipient: string;
|
|
38
36
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
39
37
|
attribution: "Required" | "Not Required";
|
|
40
38
|
geographicScope: string;
|
|
41
39
|
aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
|
|
42
40
|
royalty: number;
|
|
41
|
+
value: string;
|
|
42
|
+
recipient: string;
|
|
43
43
|
description?: string | undefined;
|
|
44
44
|
external_url?: string | undefined;
|
|
45
45
|
}>;
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 8 | 6 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 8 | 6 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|