@medialane/ui 0.104.0 → 0.106.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/asset-collection-bar.cjs +1 -1
- package/dist/components/asset-collection-bar.cjs.map +1 -1
- package/dist/components/asset-collection-bar.js +1 -1
- package/dist/components/asset-collection-bar.js.map +1 -1
- package/dist/components/asset-lightbox.cjs +66 -0
- package/dist/components/asset-lightbox.cjs.map +1 -0
- package/dist/components/asset-lightbox.d.cts +11 -0
- package/dist/components/asset-lightbox.d.ts +11 -0
- package/dist/components/asset-lightbox.js +42 -0
- package/dist/components/asset-lightbox.js.map +1 -0
- package/dist/components/asset-marketplace-panel.cjs +19 -9
- package/dist/components/asset-marketplace-panel.cjs.map +1 -1
- package/dist/components/asset-marketplace-panel.js +19 -9
- package/dist/components/asset-marketplace-panel.js.map +1 -1
- package/dist/components/club-owner-actions.cjs +56 -0
- package/dist/components/club-owner-actions.cjs.map +1 -0
- package/dist/components/club-owner-actions.d.cts +11 -0
- package/dist/components/club-owner-actions.d.ts +11 -0
- package/dist/components/club-owner-actions.js +22 -0
- package/dist/components/club-owner-actions.js.map +1 -0
- package/dist/components/collection-hero-banner.cjs +114 -0
- package/dist/components/collection-hero-banner.cjs.map +1 -0
- package/dist/components/collection-hero-banner.d.cts +26 -0
- package/dist/components/collection-hero-banner.d.ts +26 -0
- package/dist/components/collection-hero-banner.js +90 -0
- package/dist/components/collection-hero-banner.js.map +1 -0
- package/dist/components/create-form-primitives.cjs +61 -0
- package/dist/components/create-form-primitives.cjs.map +1 -0
- package/dist/components/create-form-primitives.d.cts +16 -0
- package/dist/components/create-form-primitives.d.ts +16 -0
- package/dist/components/create-form-primitives.js +36 -0
- package/dist/components/create-form-primitives.js.map +1 -0
- package/dist/components/creation-record.cjs +86 -0
- package/dist/components/creation-record.cjs.map +1 -0
- package/dist/components/creation-record.d.cts +14 -0
- package/dist/components/creation-record.d.ts +14 -0
- package/dist/components/creation-record.js +52 -0
- package/dist/components/creation-record.js.map +1 -0
- package/dist/components/dialog.d.cts +9 -9
- package/dist/components/dialog.d.ts +9 -9
- package/dist/components/ip-type-fields.cjs +307 -0
- package/dist/components/ip-type-fields.cjs.map +1 -0
- package/dist/components/ip-type-fields.d.cts +17 -0
- package/dist/components/ip-type-fields.d.ts +17 -0
- package/dist/components/ip-type-fields.js +293 -0
- package/dist/components/ip-type-fields.js.map +1 -0
- package/dist/components/json-ld.cjs +39 -0
- package/dist/components/json-ld.cjs.map +1 -0
- package/dist/components/json-ld.d.cts +8 -0
- package/dist/components/json-ld.d.ts +8 -0
- package/dist/components/json-ld.js +15 -0
- package/dist/components/json-ld.js.map +1 -0
- package/dist/components/nav-theme-toggle.cjs +66 -0
- package/dist/components/nav-theme-toggle.cjs.map +1 -0
- package/dist/components/nav-theme-toggle.d.cts +9 -0
- package/dist/components/nav-theme-toggle.d.ts +9 -0
- package/dist/components/nav-theme-toggle.js +42 -0
- package/dist/components/nav-theme-toggle.js.map +1 -0
- package/dist/components/order-sort-control.cjs +58 -0
- package/dist/components/order-sort-control.cjs.map +1 -0
- package/dist/components/order-sort-control.d.cts +13 -0
- package/dist/components/order-sort-control.d.ts +13 -0
- package/dist/components/order-sort-control.js +39 -0
- package/dist/components/order-sort-control.js.map +1 -0
- package/dist/components/price-history-chart.cjs +130 -0
- package/dist/components/price-history-chart.cjs.map +1 -0
- package/dist/components/price-history-chart.d.cts +9 -0
- package/dist/components/price-history-chart.d.ts +9 -0
- package/dist/components/price-history-chart.js +114 -0
- package/dist/components/price-history-chart.js.map +1 -0
- package/dist/components/sheet.cjs +160 -0
- package/dist/components/sheet.cjs.map +1 -0
- package/dist/components/sheet.d.cts +30 -0
- package/dist/components/sheet.d.ts +30 -0
- package/dist/components/sheet.js +117 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/textarea.cjs +57 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +6 -0
- package/dist/components/textarea.d.ts +6 -0
- package/dist/components/textarea.js +23 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/index.cjs +70 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/format-activity.cjs +143 -0
- package/dist/utils/format-activity.cjs.map +1 -0
- package/dist/utils/format-activity.d.cts +14 -0
- package/dist/utils/format-activity.d.ts +14 -0
- package/dist/utils/format-activity.js +116 -0
- package/dist/utils/format-activity.js.map +1 -0
- package/dist/utils/proxy-body.cjs +60 -0
- package/dist/utils/proxy-body.cjs.map +1 -0
- package/dist/utils/proxy-body.d.cts +22 -0
- package/dist/utils/proxy-body.d.ts +22 -0
- package/dist/utils/proxy-body.js +36 -0
- package/dist/utils/proxy-body.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** Segmented two/three-option toggle used across the create flows. */
|
|
4
|
+
declare function ToggleGroup({ value, options, onChange, }: {
|
|
5
|
+
value: string;
|
|
6
|
+
options: readonly string[];
|
|
7
|
+
onChange: (v: string) => void;
|
|
8
|
+
}): react_jsx_runtime.JSX.Element;
|
|
9
|
+
/** Titled card section wrapper for the create forms. */
|
|
10
|
+
declare function Section({ title, icon, children }: {
|
|
11
|
+
title: string;
|
|
12
|
+
icon: React.ReactNode;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Section, ToggleGroup };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../utils/cn.js";
|
|
3
|
+
function ToggleGroup({
|
|
4
|
+
value,
|
|
5
|
+
options,
|
|
6
|
+
onChange
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { className: "flex rounded-lg border border-border overflow-hidden w-full", children: options.map((opt, i) => /* @__PURE__ */ jsx(
|
|
9
|
+
"button",
|
|
10
|
+
{
|
|
11
|
+
type: "button",
|
|
12
|
+
onClick: () => onChange(opt),
|
|
13
|
+
className: cn(
|
|
14
|
+
"flex-1 px-3 py-2 text-sm transition-colors",
|
|
15
|
+
i > 0 && "border-l border-border",
|
|
16
|
+
value === opt ? "bg-primary text-primary-foreground font-medium" : "bg-background hover:bg-muted text-muted-foreground"
|
|
17
|
+
),
|
|
18
|
+
children: opt
|
|
19
|
+
},
|
|
20
|
+
opt
|
|
21
|
+
)) });
|
|
22
|
+
}
|
|
23
|
+
function Section({ title, icon, children }) {
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border bg-card p-5 space-y-4", children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm font-semibold", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary", children: icon }),
|
|
27
|
+
title
|
|
28
|
+
] }),
|
|
29
|
+
children
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
Section,
|
|
34
|
+
ToggleGroup
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=create-form-primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/create-form-primitives.tsx"],"sourcesContent":["import { cn } from \"../utils/cn.js\";\n\n/** Segmented two/three-option toggle used across the create flows. */\nexport function ToggleGroup({\n value, options, onChange,\n}: { value: string; options: readonly string[]; onChange: (v: string) => void }) {\n return (\n <div className=\"flex rounded-lg border border-border overflow-hidden w-full\">\n {options.map((opt, i) => (\n <button\n key={opt}\n type=\"button\"\n onClick={() => onChange(opt)}\n className={cn(\n \"flex-1 px-3 py-2 text-sm transition-colors\",\n i > 0 && \"border-l border-border\",\n value === opt\n ? \"bg-primary text-primary-foreground font-medium\"\n : \"bg-background hover:bg-muted text-muted-foreground\",\n )}\n >\n {opt}\n </button>\n ))}\n </div>\n );\n}\n\n/** Titled card section wrapper for the create forms. */\nexport function Section({ title, icon, children }: {\n title: string; icon: React.ReactNode; children: React.ReactNode;\n}) {\n return (\n <div className=\"rounded-xl border border-border bg-card p-5 space-y-4\">\n <div className=\"flex items-center gap-2 text-sm font-semibold\">\n <span className=\"text-primary\">{icon}</span>\n {title}\n </div>\n {children}\n </div>\n );\n}\n"],"mappings":"AASQ,cAyBF,YAzBE;AATR,SAAS,UAAU;AAGZ,SAAS,YAAY;AAAA,EAC1B;AAAA,EAAO;AAAA,EAAS;AAClB,GAAiF;AAC/E,SACE,oBAAC,SAAI,WAAU,+DACZ,kBAAQ,IAAI,CAAC,KAAK,MACjB;AAAA,IAAC;AAAA;AAAA,MAEC,MAAK;AAAA,MACL,SAAS,MAAM,SAAS,GAAG;AAAA,MAC3B,WAAW;AAAA,QACT;AAAA,QACA,IAAI,KAAK;AAAA,QACT,UAAU,MACN,mDACA;AAAA,MACN;AAAA,MAEC;AAAA;AAAA,IAXI;AAAA,EAYP,CACD,GACH;AAEJ;AAGO,SAAS,QAAQ,EAAE,OAAO,MAAM,SAAS,GAE7C;AACD,SACE,qBAAC,SAAI,WAAU,yDACb;AAAA,yBAAC,SAAI,WAAU,iDACb;AAAA,0BAAC,UAAK,WAAU,gBAAgB,gBAAK;AAAA,MACpC;AAAA,OACH;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var creation_record_exports = {};
|
|
31
|
+
__export(creation_record_exports, {
|
|
32
|
+
CreationRecord: () => CreationRecord
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(creation_record_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_lucide_react = require("lucide-react");
|
|
37
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
38
|
+
var import_sdk = require("@medialane/sdk");
|
|
39
|
+
const EXPLORER_URL = process.env.NEXT_PUBLIC_EXPLORER_URL || "https://voyager.online";
|
|
40
|
+
function CreationRecord({ originalCreator, registeredAt }) {
|
|
41
|
+
const creator = originalCreator ? (0, import_sdk.normalizeAddress)("STARKNET", originalCreator) : "";
|
|
42
|
+
const date = new Date(registeredAt * 1e3);
|
|
43
|
+
const formatted = date.toLocaleDateString(void 0, {
|
|
44
|
+
year: "numeric",
|
|
45
|
+
month: "long",
|
|
46
|
+
day: "numeric"
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-lg bg-amber-500/5 p-4", children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Award, { className: "h-4 w-4 text-amber-500" }),
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold text-amber-500", children: "Creation Record" })
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground mb-3", children: "Immutable on-chain authorship record set at mint and stored permanently for legal evidence of creation (Berne Convention)." }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", { className: "space-y-2 text-sm", children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { className: "text-muted-foreground", children: "Original creator" }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { className: "tabular-nums", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: `/creator/${creator}`, className: "hover:underline", children: [
|
|
58
|
+
creator.slice(0, 6),
|
|
59
|
+
"\u2026",
|
|
60
|
+
creator.slice(-4)
|
|
61
|
+
] }) })
|
|
62
|
+
] }),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { className: "text-muted-foreground", children: "Registered at" }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
66
|
+
"a",
|
|
67
|
+
{
|
|
68
|
+
href: `${EXPLORER_URL}/contract/${creator}`,
|
|
69
|
+
target: "_blank",
|
|
70
|
+
rel: "noreferrer",
|
|
71
|
+
className: "inline-flex items-center gap-1 hover:underline",
|
|
72
|
+
children: [
|
|
73
|
+
formatted,
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ExternalLink, { className: "h-3 w-3" })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
) })
|
|
78
|
+
] })
|
|
79
|
+
] })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
CreationRecord
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=creation-record.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/creation-record.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, ExternalLink } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { normalizeAddress } from \"@medialane/sdk\";\n\nconst EXPLORER_URL = process.env.NEXT_PUBLIC_EXPLORER_URL || \"https://voyager.online\";\n\nexport interface CreationRecordProps {\n originalCreator: string;\n registeredAt: number; // unix seconds\n}\n\n/**\n * Berne Convention authorship record surfaced from IPNft.get_full_token_data.\n * Both fields are immutable on-chain — original_creator is set at mint time\n * and never changes regardless of subsequent ownership transfers.\n */\nexport function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps) {\n const creator = originalCreator ? normalizeAddress(\"STARKNET\", originalCreator) : \"\";\n const date = new Date(registeredAt * 1000);\n const formatted = date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n\n return (\n <div className=\"rounded-lg bg-amber-500/5 p-4\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Award className=\"h-4 w-4 text-amber-500\" />\n <p className=\"text-sm font-semibold text-amber-500\">Creation Record</p>\n </div>\n <p className=\"text-xs text-muted-foreground mb-3\">\n Immutable on-chain authorship record set at mint and stored permanently\n for legal evidence of creation (Berne Convention).\n </p>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Original creator</dt>\n <dd className=\"tabular-nums\">\n <Link href={`/creator/${creator}`} className=\"hover:underline\">\n {creator.slice(0, 6)}…{creator.slice(-4)}\n </Link>\n </dd>\n </div>\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Registered at</dt>\n <dd>\n <a\n href={`${EXPLORER_URL}/contract/${creator}`}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline\"\n >\n {formatted}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n </dd>\n </div>\n </dl>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BM;AA3BN,0BAAoC;AACpC,kBAAiB;AACjB,iBAAiC;AAEjC,MAAM,eAAe,QAAQ,IAAI,4BAA4B;AAYtD,SAAS,eAAe,EAAE,iBAAiB,aAAa,GAAwB;AACrF,QAAM,UAAU,sBAAkB,6BAAiB,YAAY,eAAe,IAAI;AAClF,QAAM,OAAO,IAAI,KAAK,eAAe,GAAI;AACzC,QAAM,YAAY,KAAK,mBAAmB,QAAW;AAAA,IACnD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EACP,CAAC;AAED,SACE,6CAAC,SAAI,WAAU,iCACb;AAAA,iDAAC,SAAI,WAAU,gCACb;AAAA,kDAAC,6BAAM,WAAU,0BAAyB;AAAA,MAC1C,4CAAC,OAAE,WAAU,wCAAuC,6BAAe;AAAA,OACrE;AAAA,IACA,4CAAC,OAAE,WAAU,sCAAqC,wIAGlD;AAAA,IACA,6CAAC,QAAG,WAAU,qBACZ;AAAA,mDAAC,SAAI,WAAU,qCACb;AAAA,oDAAC,QAAG,WAAU,yBAAwB,8BAAgB;AAAA,QACtD,4CAAC,QAAG,WAAU,gBACZ,uDAAC,YAAAA,SAAA,EAAK,MAAM,YAAY,OAAO,IAAI,WAAU,mBAC1C;AAAA,kBAAQ,MAAM,GAAG,CAAC;AAAA,UAAE;AAAA,UAAE,QAAQ,MAAM,EAAE;AAAA,WACzC,GACF;AAAA,SACF;AAAA,MACA,6CAAC,SAAI,WAAU,qCACb;AAAA,oDAAC,QAAG,WAAU,yBAAwB,2BAAa;AAAA,QACnD,4CAAC,QACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,GAAG,YAAY,aAAa,OAAO;AAAA,YACzC,QAAO;AAAA,YACP,KAAI;AAAA,YACJ,WAAU;AAAA,YAET;AAAA;AAAA,cACD,4CAAC,oCAAa,WAAU,WAAU;AAAA;AAAA;AAAA,QACpC,GACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CreationRecordProps {
|
|
4
|
+
originalCreator: string;
|
|
5
|
+
registeredAt: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Berne Convention authorship record surfaced from IPNft.get_full_token_data.
|
|
9
|
+
* Both fields are immutable on-chain — original_creator is set at mint time
|
|
10
|
+
* and never changes regardless of subsequent ownership transfers.
|
|
11
|
+
*/
|
|
12
|
+
declare function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { CreationRecord, type CreationRecordProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface CreationRecordProps {
|
|
4
|
+
originalCreator: string;
|
|
5
|
+
registeredAt: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Berne Convention authorship record surfaced from IPNft.get_full_token_data.
|
|
9
|
+
* Both fields are immutable on-chain — original_creator is set at mint time
|
|
10
|
+
* and never changes regardless of subsequent ownership transfers.
|
|
11
|
+
*/
|
|
12
|
+
declare function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { CreationRecord, type CreationRecordProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Award, ExternalLink } from "lucide-react";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { normalizeAddress } from "@medialane/sdk";
|
|
6
|
+
const EXPLORER_URL = process.env.NEXT_PUBLIC_EXPLORER_URL || "https://voyager.online";
|
|
7
|
+
function CreationRecord({ originalCreator, registeredAt }) {
|
|
8
|
+
const creator = originalCreator ? normalizeAddress("STARKNET", originalCreator) : "";
|
|
9
|
+
const date = new Date(registeredAt * 1e3);
|
|
10
|
+
const formatted = date.toLocaleDateString(void 0, {
|
|
11
|
+
year: "numeric",
|
|
12
|
+
month: "long",
|
|
13
|
+
day: "numeric"
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-amber-500/5 p-4", children: [
|
|
16
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Award, { className: "h-4 w-4 text-amber-500" }),
|
|
18
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-amber-500", children: "Creation Record" })
|
|
19
|
+
] }),
|
|
20
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-3", children: "Immutable on-chain authorship record set at mint and stored permanently for legal evidence of creation (Berne Convention)." }),
|
|
21
|
+
/* @__PURE__ */ jsxs("dl", { className: "space-y-2 text-sm", children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
23
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "Original creator" }),
|
|
24
|
+
/* @__PURE__ */ jsx("dd", { className: "tabular-nums", children: /* @__PURE__ */ jsxs(Link, { href: `/creator/${creator}`, className: "hover:underline", children: [
|
|
25
|
+
creator.slice(0, 6),
|
|
26
|
+
"\u2026",
|
|
27
|
+
creator.slice(-4)
|
|
28
|
+
] }) })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "Registered at" }),
|
|
32
|
+
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsxs(
|
|
33
|
+
"a",
|
|
34
|
+
{
|
|
35
|
+
href: `${EXPLORER_URL}/contract/${creator}`,
|
|
36
|
+
target: "_blank",
|
|
37
|
+
rel: "noreferrer",
|
|
38
|
+
className: "inline-flex items-center gap-1 hover:underline",
|
|
39
|
+
children: [
|
|
40
|
+
formatted,
|
|
41
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
) })
|
|
45
|
+
] })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
CreationRecord
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=creation-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/creation-record.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, ExternalLink } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { normalizeAddress } from \"@medialane/sdk\";\n\nconst EXPLORER_URL = process.env.NEXT_PUBLIC_EXPLORER_URL || \"https://voyager.online\";\n\nexport interface CreationRecordProps {\n originalCreator: string;\n registeredAt: number; // unix seconds\n}\n\n/**\n * Berne Convention authorship record surfaced from IPNft.get_full_token_data.\n * Both fields are immutable on-chain — original_creator is set at mint time\n * and never changes regardless of subsequent ownership transfers.\n */\nexport function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps) {\n const creator = originalCreator ? normalizeAddress(\"STARKNET\", originalCreator) : \"\";\n const date = new Date(registeredAt * 1000);\n const formatted = date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n\n return (\n <div className=\"rounded-lg bg-amber-500/5 p-4\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Award className=\"h-4 w-4 text-amber-500\" />\n <p className=\"text-sm font-semibold text-amber-500\">Creation Record</p>\n </div>\n <p className=\"text-xs text-muted-foreground mb-3\">\n Immutable on-chain authorship record set at mint and stored permanently\n for legal evidence of creation (Berne Convention).\n </p>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Original creator</dt>\n <dd className=\"tabular-nums\">\n <Link href={`/creator/${creator}`} className=\"hover:underline\">\n {creator.slice(0, 6)}…{creator.slice(-4)}\n </Link>\n </dd>\n </div>\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Registered at</dt>\n <dd>\n <a\n href={`${EXPLORER_URL}/contract/${creator}`}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline\"\n >\n {formatted}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n </dd>\n </div>\n </dl>\n </div>\n );\n}\n"],"mappings":";AA6BM,SACE,KADF;AA3BN,SAAS,OAAO,oBAAoB;AACpC,OAAO,UAAU;AACjB,SAAS,wBAAwB;AAEjC,MAAM,eAAe,QAAQ,IAAI,4BAA4B;AAYtD,SAAS,eAAe,EAAE,iBAAiB,aAAa,GAAwB;AACrF,QAAM,UAAU,kBAAkB,iBAAiB,YAAY,eAAe,IAAI;AAClF,QAAM,OAAO,IAAI,KAAK,eAAe,GAAI;AACzC,QAAM,YAAY,KAAK,mBAAmB,QAAW;AAAA,IACnD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EACP,CAAC;AAED,SACE,qBAAC,SAAI,WAAU,iCACb;AAAA,yBAAC,SAAI,WAAU,gCACb;AAAA,0BAAC,SAAM,WAAU,0BAAyB;AAAA,MAC1C,oBAAC,OAAE,WAAU,wCAAuC,6BAAe;AAAA,OACrE;AAAA,IACA,oBAAC,OAAE,WAAU,sCAAqC,wIAGlD;AAAA,IACA,qBAAC,QAAG,WAAU,qBACZ;AAAA,2BAAC,SAAI,WAAU,qCACb;AAAA,4BAAC,QAAG,WAAU,yBAAwB,8BAAgB;AAAA,QACtD,oBAAC,QAAG,WAAU,gBACZ,+BAAC,QAAK,MAAM,YAAY,OAAO,IAAI,WAAU,mBAC1C;AAAA,kBAAQ,MAAM,GAAG,CAAC;AAAA,UAAE;AAAA,UAAE,QAAQ,MAAM,EAAE;AAAA,WACzC,GACF;AAAA,SACF;AAAA,MACA,qBAAC,SAAI,WAAU,qCACb;AAAA,4BAAC,QAAG,WAAU,yBAAwB,2BAAa;AAAA,QACnD,oBAAC,QACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,GAAG,YAAY,aAAa,OAAO;AAAA,YACzC,QAAO;AAAA,YACP,KAAI;AAAA,YACJ,WAAU;AAAA,YAET;AAAA;AAAA,cACD,oBAAC,gBAAa,WAAU,WAAU;AAAA;AAAA;AAAA,QACpC,GACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import * as
|
|
3
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
4
4
|
|
|
5
|
-
declare const Dialog: React.FC<
|
|
6
|
-
declare const DialogTrigger: React.ForwardRefExoticComponent<
|
|
7
|
-
declare const DialogPortal: React.FC<
|
|
8
|
-
declare const DialogClose: React.ForwardRefExoticComponent<
|
|
9
|
-
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<
|
|
10
|
-
interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof
|
|
5
|
+
declare const Dialog: React.FC<SheetPrimitive.DialogProps>;
|
|
6
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
|
+
declare const DialogClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> {
|
|
11
11
|
hideClose?: boolean;
|
|
12
12
|
}
|
|
13
13
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -19,7 +19,7 @@ declare const DialogFooter: {
|
|
|
19
19
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
20
20
|
displayName: string;
|
|
21
21
|
};
|
|
22
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<
|
|
23
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<
|
|
22
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
23
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
24
24
|
|
|
25
25
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import * as
|
|
3
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
4
4
|
|
|
5
|
-
declare const Dialog: React.FC<
|
|
6
|
-
declare const DialogTrigger: React.ForwardRefExoticComponent<
|
|
7
|
-
declare const DialogPortal: React.FC<
|
|
8
|
-
declare const DialogClose: React.ForwardRefExoticComponent<
|
|
9
|
-
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<
|
|
10
|
-
interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof
|
|
5
|
+
declare const Dialog: React.FC<SheetPrimitive.DialogProps>;
|
|
6
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
|
+
declare const DialogClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> {
|
|
11
11
|
hideClose?: boolean;
|
|
12
12
|
}
|
|
13
13
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -19,7 +19,7 @@ declare const DialogFooter: {
|
|
|
19
19
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
20
20
|
displayName: string;
|
|
21
21
|
};
|
|
22
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<
|
|
23
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<
|
|
22
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
23
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
24
24
|
|
|
25
25
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var ip_type_fields_exports = {};
|
|
21
|
+
__export(ip_type_fields_exports, {
|
|
22
|
+
IPTypeFields: () => IPTypeFields
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(ip_type_fields_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import_ip_templates = require("../data/ip-templates.js");
|
|
28
|
+
var import_label = require("./label.js");
|
|
29
|
+
var import_input = require("./input.js");
|
|
30
|
+
var import_button = require("./button.js");
|
|
31
|
+
var import_select = require("./select.js");
|
|
32
|
+
var import_lucide_react = require("lucide-react");
|
|
33
|
+
const createId = () => globalThis.crypto?.randomUUID?.() ?? `trait-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
34
|
+
const looksLikeUrl = (v) => /^https?:\/\/\S+/i.test(v.trim());
|
|
35
|
+
function IPTypeFields({ ipType, onChange, uploadDocument }) {
|
|
36
|
+
const template = ipType ? import_ip_templates.IP_TEMPLATES[ipType] : null;
|
|
37
|
+
const [embedValues, setEmbedValues] = (0, import_react.useState)({});
|
|
38
|
+
const [socialValues, setSocialValues] = (0, import_react.useState)({});
|
|
39
|
+
const [traits, setTraits] = (0, import_react.useState)([]);
|
|
40
|
+
const [docUri, setDocUri] = (0, import_react.useState)(null);
|
|
41
|
+
const [docName, setDocName] = (0, import_react.useState)(null);
|
|
42
|
+
const [docUploading, setDocUploading] = (0, import_react.useState)(false);
|
|
43
|
+
const [docError, setDocError] = (0, import_react.useState)(null);
|
|
44
|
+
const docInputRef = (0, import_react.useRef)(null);
|
|
45
|
+
(0, import_react.useEffect)(() => {
|
|
46
|
+
setEmbedValues({});
|
|
47
|
+
setSocialValues({});
|
|
48
|
+
setDocUri(null);
|
|
49
|
+
setDocName(null);
|
|
50
|
+
setDocError(null);
|
|
51
|
+
}, [ipType]);
|
|
52
|
+
const docTraitType = template?.docUpload?.traitType ?? null;
|
|
53
|
+
const metadataFields = (0, import_react.useMemo)(() => {
|
|
54
|
+
const fields = [];
|
|
55
|
+
const seen = /* @__PURE__ */ new Set();
|
|
56
|
+
const add = (traitType, value) => {
|
|
57
|
+
const t = traitType.trim();
|
|
58
|
+
const v = value.trim();
|
|
59
|
+
const k = t.toLowerCase();
|
|
60
|
+
if (!t || !v || seen.has(k)) return;
|
|
61
|
+
seen.add(k);
|
|
62
|
+
fields.push({ traitType: t, value: v });
|
|
63
|
+
};
|
|
64
|
+
if (docTraitType && docUri) add(docTraitType, docUri);
|
|
65
|
+
Object.entries(embedValues).forEach(([key, value]) => add(key, value));
|
|
66
|
+
Object.entries(socialValues).forEach(([key, value]) => add(key, value));
|
|
67
|
+
traits.forEach((row) => add(row.key, row.value));
|
|
68
|
+
return fields;
|
|
69
|
+
}, [embedValues, socialValues, traits, docTraitType, docUri]);
|
|
70
|
+
(0, import_react.useEffect)(() => {
|
|
71
|
+
onChange(metadataFields);
|
|
72
|
+
}, [metadataFields, onChange]);
|
|
73
|
+
const addedKeys = (0, import_react.useMemo)(
|
|
74
|
+
() => new Set(traits.map((t) => t.key.trim().toLowerCase())),
|
|
75
|
+
[traits]
|
|
76
|
+
);
|
|
77
|
+
const addSuggestion = (s) => {
|
|
78
|
+
setTraits((cur) => [
|
|
79
|
+
...cur,
|
|
80
|
+
{ id: createId(), key: s.key, value: "", options: s.options }
|
|
81
|
+
]);
|
|
82
|
+
};
|
|
83
|
+
const addCustomTrait = () => setTraits((cur) => [...cur, { id: createId(), key: "", value: "" }]);
|
|
84
|
+
const updateTrait = (id, patch) => setTraits((cur) => cur.map((t) => t.id === id ? { ...t, ...patch } : t));
|
|
85
|
+
const removeTrait = (id) => setTraits((cur) => cur.filter((t) => t.id !== id));
|
|
86
|
+
if (!template) return null;
|
|
87
|
+
const Icon = template.icon;
|
|
88
|
+
const docUpload = template.docUpload;
|
|
89
|
+
const handleDocPick = async (file) => {
|
|
90
|
+
if (!uploadDocument || !docUpload) return;
|
|
91
|
+
if (file.size > docUpload.maxMb * 1024 * 1024) {
|
|
92
|
+
setDocError(`File must be under ${docUpload.maxMb} MB`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
setDocError(null);
|
|
96
|
+
setDocUploading(true);
|
|
97
|
+
try {
|
|
98
|
+
const uri = await uploadDocument(file);
|
|
99
|
+
setDocUri(uri);
|
|
100
|
+
setDocName(file.name);
|
|
101
|
+
} catch (err) {
|
|
102
|
+
setDocError(err instanceof Error ? err.message : "Document upload failed");
|
|
103
|
+
} finally {
|
|
104
|
+
setDocUploading(false);
|
|
105
|
+
if (docInputRef.current) docInputRef.current.value = "";
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const clearDoc = () => {
|
|
109
|
+
setDocUri(null);
|
|
110
|
+
setDocName(null);
|
|
111
|
+
setDocError(null);
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-5", children: [
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: `h-4 w-4 ${template.color.text}` }),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm font-semibold", children: [
|
|
117
|
+
template.label,
|
|
118
|
+
" Details"
|
|
119
|
+
] })
|
|
120
|
+
] }),
|
|
121
|
+
docUpload && uploadDocument && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-2", children: [
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[11px] font-semibold text-muted-foreground", children: "Document" }),
|
|
123
|
+
docUri ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-emerald-500/30 bg-emerald-500/5 px-4 py-3", children: [
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.FileText, { className: "h-5 w-5 text-emerald-500 shrink-0" }),
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
126
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium truncate", children: docName }),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground truncate", children: docUri })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
130
|
+
import_button.Button,
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
variant: "ghost",
|
|
134
|
+
size: "icon",
|
|
135
|
+
className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive",
|
|
136
|
+
onClick: clearDoc,
|
|
137
|
+
"aria-label": "Remove document",
|
|
138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4" })
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
|
+
"input",
|
|
144
|
+
{
|
|
145
|
+
ref: docInputRef,
|
|
146
|
+
type: "file",
|
|
147
|
+
accept: docUpload.accept,
|
|
148
|
+
className: "hidden",
|
|
149
|
+
onChange: (e) => {
|
|
150
|
+
const f = e.target.files?.[0];
|
|
151
|
+
if (f) void handleDocPick(f);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
|
+
import_button.Button,
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
variant: "outline",
|
|
160
|
+
size: "sm",
|
|
161
|
+
disabled: docUploading,
|
|
162
|
+
onClick: () => docInputRef.current?.click(),
|
|
163
|
+
children: docUploading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "mr-1.5 h-3.5 w-3.5 animate-spin" }),
|
|
165
|
+
"Uploading\u2026"
|
|
166
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.FileUp, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
168
|
+
"Upload document"
|
|
169
|
+
] })
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
docError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: docError }),
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground leading-relaxed", children: docUpload.hint })
|
|
174
|
+
] })
|
|
175
|
+
] }),
|
|
176
|
+
template.embeds && template.embeds.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[11px] font-semibold text-muted-foreground", children: "Embeds" }),
|
|
178
|
+
template.embeds.map((platform) => {
|
|
179
|
+
const meta = import_ip_templates.EMBED_PLATFORM_META[platform];
|
|
180
|
+
const PIcon = meta.icon;
|
|
181
|
+
const value = embedValues[meta.traitKey] ?? "";
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.Label, { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PIcon, { className: "h-3.5 w-3.5" }),
|
|
185
|
+
meta.label,
|
|
186
|
+
looksLikeUrl(value) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "ml-1 inline-flex items-center gap-0.5 text-[10px] font-medium text-emerald-400", children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "h-3 w-3" }),
|
|
188
|
+
" connected"
|
|
189
|
+
] })
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
192
|
+
import_input.Input,
|
|
193
|
+
{
|
|
194
|
+
type: "url",
|
|
195
|
+
inputMode: "url",
|
|
196
|
+
placeholder: meta.placeholder,
|
|
197
|
+
value,
|
|
198
|
+
onChange: (e) => setEmbedValues((cur) => ({ ...cur, [meta.traitKey]: e.target.value })),
|
|
199
|
+
className: "h-10 text-sm"
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] }, platform);
|
|
203
|
+
})
|
|
204
|
+
] }),
|
|
205
|
+
template.socials && template.socials.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[11px] font-semibold text-muted-foreground", children: "Social links" }),
|
|
207
|
+
template.socials.map((platform) => {
|
|
208
|
+
const meta = import_ip_templates.SOCIAL_PLATFORM_META[platform];
|
|
209
|
+
const PIcon = meta.icon;
|
|
210
|
+
const value = socialValues[meta.traitKey] ?? "";
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
212
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.Label, { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
213
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PIcon, { className: "h-3.5 w-3.5" }),
|
|
214
|
+
meta.label
|
|
215
|
+
] }),
|
|
216
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
217
|
+
import_input.Input,
|
|
218
|
+
{
|
|
219
|
+
type: "url",
|
|
220
|
+
inputMode: "url",
|
|
221
|
+
placeholder: meta.placeholder,
|
|
222
|
+
value,
|
|
223
|
+
onChange: (e) => setSocialValues((cur) => ({ ...cur, [meta.traitKey]: e.target.value })),
|
|
224
|
+
className: "h-10 text-sm"
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
] }, platform);
|
|
228
|
+
})
|
|
229
|
+
] }),
|
|
230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3 border-t border-border/60 pt-4", children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: "Traits" }),
|
|
232
|
+
template.traitSuggestions && template.traitSuggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: template.traitSuggestions.filter((s) => !addedKeys.has(s.key.toLowerCase())).map((s) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
233
|
+
"button",
|
|
234
|
+
{
|
|
235
|
+
type: "button",
|
|
236
|
+
onClick: () => addSuggestion(s),
|
|
237
|
+
className: "inline-flex items-center gap-1 rounded-full border border-border bg-muted/40 px-3 py-1 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:text-foreground",
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "h-3 w-3" }),
|
|
240
|
+
s.key
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
s.key
|
|
244
|
+
)) }),
|
|
245
|
+
traits.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", children: traits.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
className: "grid grid-cols-[1fr_1fr_auto] items-center gap-2",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
251
|
+
import_input.Input,
|
|
252
|
+
{
|
|
253
|
+
value: row.key,
|
|
254
|
+
onChange: (e) => updateTrait(row.id, { key: e.target.value }),
|
|
255
|
+
placeholder: "Trait name",
|
|
256
|
+
className: "h-9 text-sm",
|
|
257
|
+
maxLength: 64
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
row.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
261
|
+
import_select.Select,
|
|
262
|
+
{
|
|
263
|
+
value: row.value,
|
|
264
|
+
onValueChange: (v) => updateTrait(row.id, { value: v }),
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectTrigger, { className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectValue, { placeholder: "Value" }) }),
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectContent, { children: row.options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_select.SelectItem, { value: opt, children: opt }, opt)) })
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
271
|
+
import_input.Input,
|
|
272
|
+
{
|
|
273
|
+
value: row.value,
|
|
274
|
+
onChange: (e) => updateTrait(row.id, { value: e.target.value }),
|
|
275
|
+
placeholder: "Value",
|
|
276
|
+
className: "h-9 text-sm",
|
|
277
|
+
maxLength: 512
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
281
|
+
import_button.Button,
|
|
282
|
+
{
|
|
283
|
+
type: "button",
|
|
284
|
+
variant: "ghost",
|
|
285
|
+
size: "icon",
|
|
286
|
+
className: "h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",
|
|
287
|
+
onClick: () => removeTrait(row.id),
|
|
288
|
+
"aria-label": "Remove trait",
|
|
289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Trash2, { className: "h-4 w-4" })
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
row.id
|
|
295
|
+
)) }),
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { type: "button", variant: "outline", size: "sm", onClick: addCustomTrait, children: [
|
|
297
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Plus, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
298
|
+
"Add custom trait"
|
|
299
|
+
] })
|
|
300
|
+
] })
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
303
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
304
|
+
0 && (module.exports = {
|
|
305
|
+
IPTypeFields
|
|
306
|
+
});
|
|
307
|
+
//# sourceMappingURL=ip-type-fields.cjs.map
|