@medialane/ui 0.77.0 → 0.78.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-picker-cell.cjs +69 -0
- package/dist/components/asset-picker-cell.cjs.map +1 -0
- package/dist/components/asset-picker-cell.d.cts +15 -0
- package/dist/components/asset-picker-cell.d.ts +15 -0
- package/dist/components/asset-picker-cell.js +34 -0
- package/dist/components/asset-picker-cell.js.map +1 -0
- package/dist/components/asset-picker.cjs +10 -33
- package/dist/components/asset-picker.cjs.map +1 -1
- package/dist/components/asset-picker.js +11 -24
- package/dist/components/asset-picker.js.map +1 -1
- package/dist/components/asset-search-picker.cjs +10 -33
- package/dist/components/asset-search-picker.cjs.map +1 -1
- package/dist/components/asset-search-picker.js +11 -24
- package/dist/components/asset-search-picker.js.map +1 -1
- package/dist/components/license-terms-builder.cjs +287 -39
- package/dist/components/license-terms-builder.cjs.map +1 -1
- package/dist/components/license-terms-builder.d.cts +30 -6
- package/dist/components/license-terms-builder.d.ts +30 -6
- package/dist/components/license-terms-builder.js +284 -38
- package/dist/components/license-terms-builder.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -20,22 +20,93 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var license_terms_builder_exports = {};
|
|
21
21
|
__export(license_terms_builder_exports, {
|
|
22
22
|
EMPTY_SPONSORSHIP_TERMS: () => EMPTY_SPONSORSHIP_TERMS,
|
|
23
|
-
LicenseTermsBuilder: () => LicenseTermsBuilder
|
|
23
|
+
LicenseTermsBuilder: () => LicenseTermsBuilder,
|
|
24
|
+
MEDIA_TYPES: () => MEDIA_TYPES,
|
|
25
|
+
toLicenseMetadata: () => toLicenseMetadata
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(license_terms_builder_exports);
|
|
26
28
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_lucide_react = require("lucide-react");
|
|
27
31
|
var import_cn = require("../utils/cn.js");
|
|
32
|
+
var import_currency_icon = require("./currency-icon.js");
|
|
33
|
+
var import_ip = require("../data/ip.js");
|
|
34
|
+
const MEDIA_TYPES = [
|
|
35
|
+
"Social Media",
|
|
36
|
+
"Video",
|
|
37
|
+
"Photo",
|
|
38
|
+
"Article/Blog",
|
|
39
|
+
"Print",
|
|
40
|
+
"Broadcast",
|
|
41
|
+
"Podcast/Audio",
|
|
42
|
+
"Livestream"
|
|
43
|
+
];
|
|
28
44
|
const EMPTY_SPONSORSHIP_TERMS = {
|
|
29
45
|
amount: "",
|
|
30
46
|
paymentTokenSymbol: "",
|
|
31
47
|
durationDays: "30",
|
|
32
48
|
transferable: true,
|
|
33
49
|
royaltyPercent: "5",
|
|
34
|
-
licenseText: ""
|
|
50
|
+
licenseText: "",
|
|
51
|
+
licenseType: "CC BY-SA",
|
|
52
|
+
commercialUse: "Yes",
|
|
53
|
+
derivatives: "Share-Alike",
|
|
54
|
+
attribution: "Required",
|
|
55
|
+
territory: "Worldwide",
|
|
56
|
+
aiPolicy: "Allowed",
|
|
57
|
+
scope: "",
|
|
58
|
+
deliverables: "",
|
|
59
|
+
exclusive: false,
|
|
60
|
+
approvalRequired: false,
|
|
61
|
+
media: [],
|
|
62
|
+
mediaOther: ""
|
|
35
63
|
};
|
|
64
|
+
function toLicenseMetadata(terms) {
|
|
65
|
+
return {
|
|
66
|
+
terms: terms.licenseText,
|
|
67
|
+
transferable: terms.transferable,
|
|
68
|
+
royaltyPercent: Number(terms.royaltyPercent || "0"),
|
|
69
|
+
licenseType: terms.licenseType,
|
|
70
|
+
commercialUse: terms.commercialUse,
|
|
71
|
+
derivatives: terms.derivatives,
|
|
72
|
+
attribution: terms.attribution,
|
|
73
|
+
territory: terms.territory,
|
|
74
|
+
aiPolicy: terms.aiPolicy,
|
|
75
|
+
scope: terms.scope,
|
|
76
|
+
deliverables: terms.deliverables,
|
|
77
|
+
exclusive: terms.exclusive,
|
|
78
|
+
approvalRequired: terms.approvalRequired,
|
|
79
|
+
media: terms.media,
|
|
80
|
+
mediaOther: terms.mediaOther
|
|
81
|
+
};
|
|
82
|
+
}
|
|
36
83
|
const FIELD_LABEL = "text-xs font-semibold text-foreground";
|
|
37
84
|
const FIELD_HELP = "text-xs text-muted-foreground";
|
|
38
85
|
const INPUT_BASE = "w-full h-10 rounded-xl border border-border bg-card px-3 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand-purple/40 focus:border-brand-purple/40 disabled:opacity-50";
|
|
86
|
+
function ToggleGroup({ value, options, onChange, disabled }) {
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex rounded-lg border border-border overflow-hidden w-full", children: options.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
disabled,
|
|
92
|
+
onClick: () => onChange(opt),
|
|
93
|
+
className: (0, import_cn.cn)(
|
|
94
|
+
"flex-1 px-3 py-2 text-xs sm:text-sm transition-colors disabled:opacity-50",
|
|
95
|
+
i > 0 && "border-l border-border",
|
|
96
|
+
value === opt ? "bg-primary text-primary-foreground font-medium" : "bg-background hover:bg-muted text-muted-foreground"
|
|
97
|
+
),
|
|
98
|
+
children: opt
|
|
99
|
+
},
|
|
100
|
+
opt
|
|
101
|
+
)) });
|
|
102
|
+
}
|
|
103
|
+
function YesNoToggle({ label, help, checked, onChange, disabled }) {
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: label }),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: checked ? "Yes" : "No", options: ["Yes", "No"], onChange: (v) => onChange(v === "Yes"), disabled }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: FIELD_HELP, children: help })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
39
110
|
function LicenseTermsBuilder({
|
|
40
111
|
value,
|
|
41
112
|
onChange,
|
|
@@ -44,9 +115,23 @@ function LicenseTermsBuilder({
|
|
|
44
115
|
disabled,
|
|
45
116
|
className
|
|
46
117
|
}) {
|
|
118
|
+
const [panelOpen, setPanelOpen] = (0, import_react.useState)(false);
|
|
47
119
|
const set = (key, v) => onChange({ ...value, [key]: v });
|
|
120
|
+
const handleLicenseTypeChange = (licenseType) => {
|
|
121
|
+
const def = import_ip.LICENSE_TYPES.find((l) => l.value === licenseType);
|
|
122
|
+
onChange({
|
|
123
|
+
...value,
|
|
124
|
+
licenseType,
|
|
125
|
+
...def ? { commercialUse: def.commercialUse, derivatives: def.derivatives, attribution: def.attribution } : {}
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const selectedLicense = import_ip.LICENSE_TYPES.find((l) => l.value === value.licenseType);
|
|
129
|
+
const toggleMedia = (m) => {
|
|
130
|
+
const next = value.media.includes(m) ? value.media.filter((x) => x !== m) : [...value.media, m];
|
|
131
|
+
set("media", next);
|
|
132
|
+
};
|
|
48
133
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("space-y-4", className), children: [
|
|
49
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-[1fr_auto] gap-2", children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-[1fr_auto] gap-2 items-end", children: [
|
|
50
135
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
51
136
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: amountLabel }),
|
|
52
137
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -66,36 +151,25 @@ function LicenseTermsBuilder({
|
|
|
66
151
|
] }),
|
|
67
152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
68
153
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "Currency" }),
|
|
69
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
70
|
-
"
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex gap-1 flex-wrap justify-end max-w-[220px]", children: tokenOptions.map((symbol) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
155
|
+
"button",
|
|
71
156
|
{
|
|
157
|
+
type: "button",
|
|
72
158
|
disabled,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
159
|
+
onClick: () => set("paymentTokenSymbol", symbol),
|
|
160
|
+
className: (0, import_cn.cn)(
|
|
161
|
+
"h-10 px-2.5 rounded-xl border text-xs font-semibold flex items-center gap-1.5 transition-colors disabled:opacity-50",
|
|
162
|
+
value.paymentTokenSymbol === symbol ? "border-brand-purple bg-brand-purple/10 text-foreground" : "border-border bg-card text-muted-foreground hover:text-foreground"
|
|
163
|
+
),
|
|
76
164
|
children: [
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
-
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol, size: 14 }),
|
|
166
|
+
symbol
|
|
79
167
|
]
|
|
80
|
-
}
|
|
81
|
-
|
|
168
|
+
},
|
|
169
|
+
symbol
|
|
170
|
+
)) })
|
|
82
171
|
] })
|
|
83
172
|
] }),
|
|
84
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
85
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "License length (days)" }),
|
|
86
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
-
"input",
|
|
88
|
-
{
|
|
89
|
-
type: "number",
|
|
90
|
-
min: 1,
|
|
91
|
-
disabled,
|
|
92
|
-
value: value.durationDays,
|
|
93
|
-
onChange: (e) => set("durationDays", e.target.value),
|
|
94
|
-
className: INPUT_BASE
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: FIELD_HELP, children: "Counted from the moment the deal is accepted, not from today." })
|
|
98
|
-
] }),
|
|
99
173
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
100
174
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "Resale royalty (%)" }),
|
|
101
175
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -129,26 +203,200 @@ function LicenseTermsBuilder({
|
|
|
129
203
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)(FIELD_HELP, "block"), children: "Off means it's meant to stay with the sponsor who accepts it \u2014 resale still isn't blocked on-chain, this is just the stated intent." })
|
|
130
204
|
] })
|
|
131
205
|
] }),
|
|
132
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
134
|
-
|
|
135
|
-
"textarea",
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl border border-border overflow-hidden", children: [
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
208
|
+
"button",
|
|
136
209
|
{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
210
|
+
type: "button",
|
|
211
|
+
onClick: () => setPanelOpen((o) => !o),
|
|
212
|
+
className: "w-full flex items-center justify-between px-4 py-3 text-sm font-semibold",
|
|
213
|
+
children: [
|
|
214
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "How long, where, and what for" }),
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, { className: (0, import_cn.cn)("h-4 w-4 transition-transform text-muted-foreground", panelOpen && "rotate-180") })
|
|
216
|
+
]
|
|
143
217
|
}
|
|
144
218
|
),
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
219
|
+
panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "px-4 pb-4 space-y-4 border-t border-border pt-4", children: [
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "License length (days)" }),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
223
|
+
"input",
|
|
224
|
+
{
|
|
225
|
+
type: "number",
|
|
226
|
+
min: 1,
|
|
227
|
+
disabled,
|
|
228
|
+
value: value.durationDays,
|
|
229
|
+
onChange: (e) => set("durationDays", e.target.value),
|
|
230
|
+
className: INPUT_BASE
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: FIELD_HELP, children: "Counted from the moment the deal is accepted, not from today." })
|
|
234
|
+
] }),
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
236
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "License type" }),
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
238
|
+
"select",
|
|
239
|
+
{
|
|
240
|
+
disabled,
|
|
241
|
+
value: value.licenseType,
|
|
242
|
+
onChange: (e) => handleLicenseTypeChange(e.target.value),
|
|
243
|
+
className: INPUT_BASE,
|
|
244
|
+
children: import_ip.LICENSE_TYPES.map((l) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: l.value, children: l.label }, l.value))
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
selectedLicense ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: FIELD_HELP, children: selectedLicense.description }) : null
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "Commercial use" }),
|
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: value.commercialUse, options: ["Yes", "No"], onChange: (v) => set("commercialUse", v), disabled })
|
|
252
|
+
] }),
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "Derivatives" }),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: value.derivatives, options: ["Allowed", "Not Allowed", "Share-Alike"], onChange: (v) => set("derivatives", v), disabled })
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "Attribution" }),
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup, { value: value.attribution, options: ["Required", "Not Required"], onChange: (v) => set("attribution", v), disabled })
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
262
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "Territory" }),
|
|
263
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
264
|
+
"select",
|
|
265
|
+
{
|
|
266
|
+
disabled,
|
|
267
|
+
value: value.territory,
|
|
268
|
+
onChange: (e) => set("territory", e.target.value),
|
|
269
|
+
className: INPUT_BASE,
|
|
270
|
+
children: import_ip.GEOGRAPHIC_SCOPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: t, children: t }, t))
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: FIELD_LABEL, children: "AI policy" }),
|
|
276
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
277
|
+
"select",
|
|
278
|
+
{
|
|
279
|
+
disabled,
|
|
280
|
+
value: value.aiPolicy,
|
|
281
|
+
onChange: (e) => set("aiPolicy", e.target.value),
|
|
282
|
+
className: INPUT_BASE,
|
|
283
|
+
children: import_ip.AI_POLICIES.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: p, children: p }, p))
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: FIELD_HELP, children: "Whether this work can be used to train AI models." })
|
|
287
|
+
] }),
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
289
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: FIELD_LABEL, children: [
|
|
290
|
+
"Scope ",
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
292
|
+
] }),
|
|
293
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
294
|
+
"input",
|
|
295
|
+
{
|
|
296
|
+
type: "text",
|
|
297
|
+
disabled,
|
|
298
|
+
value: value.scope,
|
|
299
|
+
onChange: (e) => set("scope", e.target.value),
|
|
300
|
+
placeholder: "e.g. Instagram + YouTube only",
|
|
301
|
+
className: INPUT_BASE
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
] }),
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: FIELD_LABEL, children: [
|
|
307
|
+
"Deliverables ",
|
|
308
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
311
|
+
"textarea",
|
|
312
|
+
{
|
|
313
|
+
disabled,
|
|
314
|
+
value: value.deliverables,
|
|
315
|
+
onChange: (e) => set("deliverables", e.target.value),
|
|
316
|
+
placeholder: "e.g. 3 posts, 1 video",
|
|
317
|
+
rows: 2,
|
|
318
|
+
className: (0, import_cn.cn)(INPUT_BASE, "h-auto py-2.5 resize-y")
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
] }),
|
|
322
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
323
|
+
YesNoToggle,
|
|
324
|
+
{
|
|
325
|
+
label: "Exclusive to this sponsor",
|
|
326
|
+
help: "No other sponsors during the license term.",
|
|
327
|
+
checked: value.exclusive,
|
|
328
|
+
onChange: (v) => set("exclusive", v),
|
|
329
|
+
disabled
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
333
|
+
YesNoToggle,
|
|
334
|
+
{
|
|
335
|
+
label: "Content approval required",
|
|
336
|
+
help: "Sponsor reviews content before it's published.",
|
|
337
|
+
checked: value.approvalRequired,
|
|
338
|
+
onChange: (v) => set("approvalRequired", v),
|
|
339
|
+
disabled
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: FIELD_LABEL, children: [
|
|
344
|
+
"Media ",
|
|
345
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
346
|
+
] }),
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: MEDIA_TYPES.map((m) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
348
|
+
"button",
|
|
349
|
+
{
|
|
350
|
+
type: "button",
|
|
351
|
+
disabled,
|
|
352
|
+
onClick: () => toggleMedia(m),
|
|
353
|
+
className: (0, import_cn.cn)(
|
|
354
|
+
"h-8 px-2.5 rounded-full border text-xs font-medium transition-colors disabled:opacity-50",
|
|
355
|
+
value.media.includes(m) ? "border-brand-purple bg-brand-purple/10 text-foreground" : "border-border bg-card text-muted-foreground hover:text-foreground"
|
|
356
|
+
),
|
|
357
|
+
children: m
|
|
358
|
+
},
|
|
359
|
+
m
|
|
360
|
+
)) }),
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
362
|
+
"input",
|
|
363
|
+
{
|
|
364
|
+
type: "text",
|
|
365
|
+
disabled,
|
|
366
|
+
value: value.mediaOther,
|
|
367
|
+
onChange: (e) => set("mediaOther", e.target.value),
|
|
368
|
+
placeholder: "Other media type",
|
|
369
|
+
className: (0, import_cn.cn)(INPUT_BASE, "mt-1.5")
|
|
370
|
+
}
|
|
371
|
+
)
|
|
372
|
+
] }),
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: FIELD_LABEL, children: [
|
|
375
|
+
"Additional terms ",
|
|
376
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
377
|
+
] }),
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
379
|
+
"textarea",
|
|
380
|
+
{
|
|
381
|
+
disabled,
|
|
382
|
+
value: value.licenseText,
|
|
383
|
+
onChange: (e) => set("licenseText", e.target.value),
|
|
384
|
+
placeholder: "Anything else worth spelling out.",
|
|
385
|
+
rows: 3,
|
|
386
|
+
className: (0, import_cn.cn)(INPUT_BASE, "h-auto py-2.5 resize-y")
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: FIELD_HELP, children: "Saved permanently and shown to anyone who holds the license." })
|
|
390
|
+
] })
|
|
391
|
+
] }) : null
|
|
146
392
|
] })
|
|
147
393
|
] });
|
|
148
394
|
}
|
|
149
395
|
// Annotate the CommonJS export names for ESM import in node:
|
|
150
396
|
0 && (module.exports = {
|
|
151
397
|
EMPTY_SPONSORSHIP_TERMS,
|
|
152
|
-
LicenseTermsBuilder
|
|
398
|
+
LicenseTermsBuilder,
|
|
399
|
+
MEDIA_TYPES,
|
|
400
|
+
toLicenseMetadata
|
|
153
401
|
});
|
|
154
402
|
//# sourceMappingURL=license-terms-builder.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/license-terms-builder.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn.js\";\n\n/**\n * The deal terms a sponsorship offer/proposal needs, in plain-language shape\n * — no bps, no IPFS, no ByteArray. `royaltyPercent` is a plain 0–100 number\n * (multiply by 100 for the contract's basis-points argument); `licenseText`\n * is the terms document's raw content — the caller pins it to IPFS (via\n * their own existing upload helper) and passes the resulting `ipfs://` URI\n * to the SDK call. This component only collects and validates the data, it\n * never fetches or uploads anything itself.\n */\nexport interface SponsorshipTerms {\n amount: string;\n paymentTokenSymbol: string;\n durationDays: string;\n transferable: boolean;\n royaltyPercent: string;\n licenseText: string;\n}\n\nexport const EMPTY_SPONSORSHIP_TERMS: SponsorshipTerms = {\n amount: \"\",\n paymentTokenSymbol: \"\",\n durationDays: \"30\",\n transferable: true,\n royaltyPercent: \"5\",\n licenseText: \"\",\n};\n\nexport interface LicenseTermsBuilderProps {\n value: SponsorshipTerms;\n onChange: (next: SponsorshipTerms) => void;\n /** Payment token symbols to offer — e.g. from SUPPORTED_TOKENS. */\n tokenOptions: string[];\n /** Copy override for the amount field — \"Minimum bid\" for an owner's\n * offer, \"Amount you'll pay\" for a sponsor's proposal. Default: \"Amount\". */\n amountLabel?: string;\n disabled?: boolean;\n className?: string;\n}\n\nconst FIELD_LABEL = \"text-xs font-semibold text-foreground\";\nconst FIELD_HELP = \"text-xs text-muted-foreground\";\nconst INPUT_BASE =\n \"w-full h-10 rounded-xl border border-border bg-card px-3 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand-purple/40 focus:border-brand-purple/40 disabled:opacity-50\";\n\nexport function LicenseTermsBuilder({\n value, onChange, tokenOptions, amountLabel = \"Amount\", disabled, className,\n}: LicenseTermsBuilderProps) {\n const set = <K extends keyof SponsorshipTerms>(key: K, v: SponsorshipTerms[K]) =>\n onChange({ ...value, [key]: v });\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n <div className=\"grid grid-cols-[1fr_auto] gap-2\">\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>{amountLabel}</label>\n <input\n type=\"number\"\n min={0}\n step=\"0.01\"\n inputMode=\"decimal\"\n disabled={disabled}\n value={value.amount}\n onChange={(e) => set(\"amount\", e.target.value)}\n placeholder=\"0.00\"\n className={INPUT_BASE}\n />\n </div>\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Currency</label>\n <select\n disabled={disabled}\n value={value.paymentTokenSymbol}\n onChange={(e) => set(\"paymentTokenSymbol\", e.target.value)}\n className={cn(INPUT_BASE, \"w-24\")}\n >\n <option value=\"\" disabled>—</option>\n {tokenOptions.map((symbol) => (\n <option key={symbol} value={symbol}>{symbol}</option>\n ))}\n </select>\n </div>\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>License length (days)</label>\n <input\n type=\"number\"\n min={1}\n disabled={disabled}\n value={value.durationDays}\n onChange={(e) => set(\"durationDays\", e.target.value)}\n className={INPUT_BASE}\n />\n <p className={FIELD_HELP}>Counted from the moment the deal is accepted, not from today.</p>\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Resale royalty (%)</label>\n <input\n type=\"number\"\n min={0}\n max={100}\n step=\"0.1\"\n disabled={disabled}\n value={value.royaltyPercent}\n onChange={(e) => set(\"royaltyPercent\", e.target.value)}\n className={INPUT_BASE}\n />\n <p className={FIELD_HELP}>You get this share automatically if the license is ever resold.</p>\n </div>\n\n <label className=\"flex items-start gap-2.5 cursor-pointer select-none\">\n <input\n type=\"checkbox\"\n disabled={disabled}\n checked={value.transferable}\n onChange={(e) => set(\"transferable\", e.target.checked)}\n className=\"mt-0.5 h-4 w-4 rounded border-border text-brand-purple focus:ring-brand-purple/40\"\n />\n <span className=\"text-sm\">\n <span className=\"font-medium\">Sponsor can resell this license</span>\n <span className={cn(FIELD_HELP, \"block\")}>Off means it's meant to stay with the sponsor who accepts it — resale still isn't blocked on-chain, this is just the stated intent.</span>\n </span>\n </label>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>License terms</label>\n <textarea\n disabled={disabled}\n value={value.licenseText}\n onChange={(e) => set(\"licenseText\", e.target.value)}\n placeholder=\"What can the sponsor do with this license? Usage rights, credit requirements, territory, anything else worth spelling out.\"\n rows={4}\n className={cn(INPUT_BASE, \"h-auto py-2.5 resize-y\")}\n />\n <p className={FIELD_HELP}>Saved permanently and shown to anyone who holds the license.</p>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDQ;AAvDR,gBAAmB;AAoBZ,MAAM,0BAA4C;AAAA,EACvD,QAAQ;AAAA,EACR,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,aAAa;AACf;AAcA,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,MAAM,aACJ;AAEK,SAAS,oBAAoB;AAAA,EAClC;AAAA,EAAO;AAAA,EAAU;AAAA,EAAc,cAAc;AAAA,EAAU;AAAA,EAAU;AACnE,GAA6B;AAC3B,QAAM,MAAM,CAAmC,KAAQ,MACrD,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC;AAEjC,SACE,6CAAC,SAAI,eAAW,cAAG,aAAa,SAAS,GACvC;AAAA,iDAAC,SAAI,WAAU,mCACb;AAAA,mDAAC,SAAI,WAAU,eACb;AAAA,oDAAC,WAAM,WAAW,aAAc,uBAAY;AAAA,QAC5C;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,KAAK;AAAA,YACL,MAAK;AAAA,YACL,WAAU;AAAA,YACV;AAAA,YACA,OAAO,MAAM;AAAA,YACb,UAAU,CAAC,MAAM,IAAI,UAAU,EAAE,OAAO,KAAK;AAAA,YAC7C,aAAY;AAAA,YACZ,WAAW;AAAA;AAAA,QACb;AAAA,SACF;AAAA,MACA,6CAAC,SAAI,WAAU,eACb;AAAA,oDAAC,WAAM,WAAW,aAAa,sBAAQ;AAAA,QACvC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,OAAO,MAAM;AAAA,YACb,UAAU,CAAC,MAAM,IAAI,sBAAsB,EAAE,OAAO,KAAK;AA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,cAAG,YAAY,OAAO,GAAG,sJAA6I;AAAA,SACzL;AAAA,OACF;AAAA,IAEA,6CAAC,SAAI,WAAU,eACb;AAAA,kDAAC,WAAM,WAAW,aAAa,2BAAa;AAAA,MAC5C;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,OAAO,MAAM;AAAA,UACb,UAAU,CAAC,MAAM,IAAI,eAAe,EAAE,OAAO,KAAK;AAAA,UAClD,aAAY;AAAA,UACZ,MAAM;AAAA,UACN,eAAW,cAAG,YAAY,wBAAwB;AAAA;AAAA,MACpD;AAAA,MACA,4CAAC,OAAE,WAAW,YAAY,0EAA4D;AAAA,OACxF;AAAA,KACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/license-terms-builder.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport { LICENSE_TYPES, GEOGRAPHIC_SCOPES, AI_POLICIES } from \"../data/ip.js\";\n\n/** Common sponsorship media/channel types — deliberately not part of the\n * general IP taxonomy in `data/ip.ts` (that's about the asset itself;\n * this is about the sponsorship deal's channels), so it stays local here. */\nexport const MEDIA_TYPES = [\n \"Social Media\", \"Video\", \"Photo\", \"Article/Blog\", \"Print\", \"Broadcast\", \"Podcast/Audio\", \"Livestream\",\n] as const;\n\n/**\n * The deal terms a sponsorship offer/proposal needs, in plain-language shape\n * — no bps, no IPFS, no ByteArray. `royaltyPercent` is a plain 0–100 number\n * (multiply by 100 for the contract's basis-points argument). Every field\n * here is declarative metadata carried in the pinned IPFS document (see\n * `toLicenseMetadata`) — the contract never reads any of it, so none of it\n * is enforced beyond the atomic accept-and-mint payment itself. This\n * component only collects and validates the data, it never fetches or\n * uploads anything itself.\n */\nexport interface SponsorshipTerms {\n amount: string;\n paymentTokenSymbol: string;\n durationDays: string;\n transferable: boolean;\n royaltyPercent: string;\n /** Free-text notes that don't fit any structured field below. */\n licenseText: string;\n licenseType: string;\n commercialUse: \"Yes\" | \"No\";\n derivatives: \"Allowed\" | \"Not Allowed\" | \"Share-Alike\";\n attribution: \"Required\" | \"Not Required\";\n territory: string;\n aiPolicy: string;\n /** e.g. \"Instagram + YouTube only\" — too deal-specific to bound into an enum. */\n scope: string;\n /** e.g. \"3 posts, 1 video\" */\n deliverables: string;\n exclusive: boolean;\n approvalRequired: boolean;\n media: string[];\n mediaOther: string;\n}\n\nexport const EMPTY_SPONSORSHIP_TERMS: SponsorshipTerms = {\n amount: \"\",\n paymentTokenSymbol: \"\",\n durationDays: \"30\",\n transferable: true,\n royaltyPercent: \"5\",\n licenseText: \"\",\n licenseType: \"CC BY-SA\",\n commercialUse: \"Yes\",\n derivatives: \"Share-Alike\",\n attribution: \"Required\",\n territory: \"Worldwide\",\n aiPolicy: \"Allowed\",\n scope: \"\",\n deliverables: \"\",\n exclusive: false,\n approvalRequired: false,\n media: [],\n mediaOther: \"\",\n};\n\n/** Shapes the pinned-IPFS-JSON payload — the single place both apps build\n * this object, so it can't drift across call sites. Purely additive; the\n * contract never reads any of it. */\nexport function toLicenseMetadata(terms: SponsorshipTerms): Record<string, unknown> {\n return {\n terms: terms.licenseText,\n transferable: terms.transferable,\n royaltyPercent: Number(terms.royaltyPercent || \"0\"),\n licenseType: terms.licenseType,\n commercialUse: terms.commercialUse,\n derivatives: terms.derivatives,\n attribution: terms.attribution,\n territory: terms.territory,\n aiPolicy: terms.aiPolicy,\n scope: terms.scope,\n deliverables: terms.deliverables,\n exclusive: terms.exclusive,\n approvalRequired: terms.approvalRequired,\n media: terms.media,\n mediaOther: terms.mediaOther,\n };\n}\n\nexport interface LicenseTermsBuilderProps {\n value: SponsorshipTerms;\n onChange: (next: SponsorshipTerms) => void;\n /** Payment token symbols to offer — e.g. from SUPPORTED_TOKENS. */\n tokenOptions: string[];\n /** Copy override for the amount field — \"Minimum bid\" for an owner's\n * offer, \"Amount you'll pay\" for a sponsor's proposal. Default: \"Amount\". */\n amountLabel?: string;\n disabled?: boolean;\n className?: string;\n}\n\nconst FIELD_LABEL = \"text-xs font-semibold text-foreground\";\nconst FIELD_HELP = \"text-xs text-muted-foreground\";\nconst INPUT_BASE =\n \"w-full h-10 rounded-xl border border-border bg-card px-3 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-brand-purple/40 focus:border-brand-purple/40 disabled:opacity-50\";\n\nfunction ToggleGroup({ value, options, onChange, disabled }: { value: string; options: readonly string[]; onChange: (v: string) => void; disabled?: boolean }) {\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 disabled={disabled}\n onClick={() => onChange(opt)}\n className={cn(\n \"flex-1 px-3 py-2 text-xs sm:text-sm transition-colors disabled:opacity-50\",\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\nfunction YesNoToggle({ label, help, checked, onChange, disabled }: { label: string; help: string; checked: boolean; onChange: (v: boolean) => void; disabled?: boolean }) {\n return (\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>{label}</label>\n <ToggleGroup value={checked ? \"Yes\" : \"No\"} options={[\"Yes\", \"No\"]} onChange={(v) => onChange(v === \"Yes\")} disabled={disabled} />\n <p className={FIELD_HELP}>{help}</p>\n </div>\n );\n}\n\nexport function LicenseTermsBuilder({\n value, onChange, tokenOptions, amountLabel = \"Amount\", disabled, className,\n}: LicenseTermsBuilderProps) {\n const [panelOpen, setPanelOpen] = useState(false);\n const set = <K extends keyof SponsorshipTerms>(key: K, v: SponsorshipTerms[K]) =>\n onChange({ ...value, [key]: v });\n\n const handleLicenseTypeChange = (licenseType: string) => {\n const def = LICENSE_TYPES.find((l) => l.value === licenseType);\n onChange({\n ...value,\n licenseType,\n ...(def ? { commercialUse: def.commercialUse, derivatives: def.derivatives, attribution: def.attribution } : {}),\n });\n };\n\n const selectedLicense = LICENSE_TYPES.find((l) => l.value === value.licenseType);\n const toggleMedia = (m: string) => {\n const next = value.media.includes(m) ? value.media.filter((x) => x !== m) : [...value.media, m];\n set(\"media\", next);\n };\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n <div className=\"grid grid-cols-[1fr_auto] gap-2 items-end\">\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>{amountLabel}</label>\n <input\n type=\"number\"\n min={0}\n step=\"0.01\"\n inputMode=\"decimal\"\n disabled={disabled}\n value={value.amount}\n onChange={(e) => set(\"amount\", e.target.value)}\n placeholder=\"0.00\"\n className={INPUT_BASE}\n />\n </div>\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Currency</label>\n <div className=\"flex gap-1 flex-wrap justify-end max-w-[220px]\">\n {tokenOptions.map((symbol) => (\n <button\n key={symbol}\n type=\"button\"\n disabled={disabled}\n onClick={() => set(\"paymentTokenSymbol\", symbol)}\n className={cn(\n \"h-10 px-2.5 rounded-xl border text-xs font-semibold flex items-center gap-1.5 transition-colors disabled:opacity-50\",\n value.paymentTokenSymbol === symbol\n ? \"border-brand-purple bg-brand-purple/10 text-foreground\"\n : \"border-border bg-card text-muted-foreground hover:text-foreground\",\n )}\n >\n <CurrencyIcon symbol={symbol} size={14} />\n {symbol}\n </button>\n ))}\n </div>\n </div>\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Resale royalty (%)</label>\n <input\n type=\"number\"\n min={0}\n max={100}\n step=\"0.1\"\n disabled={disabled}\n value={value.royaltyPercent}\n onChange={(e) => set(\"royaltyPercent\", e.target.value)}\n className={INPUT_BASE}\n />\n <p className={FIELD_HELP}>You get this share automatically if the license is ever resold.</p>\n </div>\n\n <label className=\"flex items-start gap-2.5 cursor-pointer select-none\">\n <input\n type=\"checkbox\"\n disabled={disabled}\n checked={value.transferable}\n onChange={(e) => set(\"transferable\", e.target.checked)}\n className=\"mt-0.5 h-4 w-4 rounded border-border text-brand-purple focus:ring-brand-purple/40\"\n />\n <span className=\"text-sm\">\n <span className=\"font-medium\">Sponsor can resell this license</span>\n <span className={cn(FIELD_HELP, \"block\")}>Off means it's meant to stay with the sponsor who accepts it — resale still isn't blocked on-chain, this is just the stated intent.</span>\n </span>\n </label>\n\n <div className=\"rounded-xl border border-border overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setPanelOpen((o) => !o)}\n className=\"w-full flex items-center justify-between px-4 py-3 text-sm font-semibold\"\n >\n <span>How long, where, and what for</span>\n <ChevronDown className={cn(\"h-4 w-4 transition-transform text-muted-foreground\", panelOpen && \"rotate-180\")} />\n </button>\n\n {panelOpen ? (\n <div className=\"px-4 pb-4 space-y-4 border-t border-border pt-4\">\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>License length (days)</label>\n <input\n type=\"number\"\n min={1}\n disabled={disabled}\n value={value.durationDays}\n onChange={(e) => set(\"durationDays\", e.target.value)}\n className={INPUT_BASE}\n />\n <p className={FIELD_HELP}>Counted from the moment the deal is accepted, not from today.</p>\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>License type</label>\n <select\n disabled={disabled}\n value={value.licenseType}\n onChange={(e) => handleLicenseTypeChange(e.target.value)}\n className={INPUT_BASE}\n >\n {LICENSE_TYPES.map((l) => (\n <option key={l.value} value={l.value}>{l.label}</option>\n ))}\n </select>\n {selectedLicense ? <p className={FIELD_HELP}>{selectedLicense.description}</p> : null}\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Commercial use</label>\n <ToggleGroup value={value.commercialUse} options={[\"Yes\", \"No\"]} onChange={(v) => set(\"commercialUse\", v as SponsorshipTerms[\"commercialUse\"])} disabled={disabled} />\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Derivatives</label>\n <ToggleGroup value={value.derivatives} options={[\"Allowed\", \"Not Allowed\", \"Share-Alike\"]} onChange={(v) => set(\"derivatives\", v as SponsorshipTerms[\"derivatives\"])} disabled={disabled} />\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Attribution</label>\n <ToggleGroup value={value.attribution} options={[\"Required\", \"Not Required\"]} onChange={(v) => set(\"attribution\", v as SponsorshipTerms[\"attribution\"])} disabled={disabled} />\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Territory</label>\n <select\n disabled={disabled}\n value={value.territory}\n onChange={(e) => set(\"territory\", e.target.value)}\n className={INPUT_BASE}\n >\n {GEOGRAPHIC_SCOPES.map((t) => (\n <option key={t} value={t}>{t}</option>\n ))}\n </select>\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>AI policy</label>\n <select\n disabled={disabled}\n value={value.aiPolicy}\n onChange={(e) => set(\"aiPolicy\", e.target.value)}\n className={INPUT_BASE}\n >\n {AI_POLICIES.map((p) => (\n <option key={p} value={p}>{p}</option>\n ))}\n </select>\n <p className={FIELD_HELP}>Whether this work can be used to train AI models.</p>\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Scope <span className=\"font-normal text-muted-foreground\">(optional)</span></label>\n <input\n type=\"text\"\n disabled={disabled}\n value={value.scope}\n onChange={(e) => set(\"scope\", e.target.value)}\n placeholder=\"e.g. Instagram + YouTube only\"\n className={INPUT_BASE}\n />\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Deliverables <span className=\"font-normal text-muted-foreground\">(optional)</span></label>\n <textarea\n disabled={disabled}\n value={value.deliverables}\n onChange={(e) => set(\"deliverables\", e.target.value)}\n placeholder=\"e.g. 3 posts, 1 video\"\n rows={2}\n className={cn(INPUT_BASE, \"h-auto py-2.5 resize-y\")}\n />\n </div>\n\n <YesNoToggle\n label=\"Exclusive to this sponsor\"\n help=\"No other sponsors during the license term.\"\n checked={value.exclusive}\n onChange={(v) => set(\"exclusive\", v)}\n disabled={disabled}\n />\n\n <YesNoToggle\n label=\"Content approval required\"\n help=\"Sponsor reviews content before it's published.\"\n checked={value.approvalRequired}\n onChange={(v) => set(\"approvalRequired\", v)}\n disabled={disabled}\n />\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Media <span className=\"font-normal text-muted-foreground\">(optional)</span></label>\n <div className=\"flex flex-wrap gap-1.5\">\n {MEDIA_TYPES.map((m) => (\n <button\n key={m}\n type=\"button\"\n disabled={disabled}\n onClick={() => toggleMedia(m)}\n className={cn(\n \"h-8 px-2.5 rounded-full border text-xs font-medium transition-colors disabled:opacity-50\",\n value.media.includes(m)\n ? \"border-brand-purple bg-brand-purple/10 text-foreground\"\n : \"border-border bg-card text-muted-foreground hover:text-foreground\",\n )}\n >\n {m}\n </button>\n ))}\n </div>\n <input\n type=\"text\"\n disabled={disabled}\n value={value.mediaOther}\n onChange={(e) => set(\"mediaOther\", e.target.value)}\n placeholder=\"Other media type\"\n className={cn(INPUT_BASE, \"mt-1.5\")}\n />\n </div>\n\n <div className=\"space-y-1.5\">\n <label className={FIELD_LABEL}>Additional terms <span className=\"font-normal text-muted-foreground\">(optional)</span></label>\n <textarea\n disabled={disabled}\n value={value.licenseText}\n onChange={(e) => set(\"licenseText\", e.target.value)}\n placeholder=\"Anything else worth spelling out.\"\n rows={3}\n className={cn(INPUT_BASE, \"h-auto py-2.5 resize-y\")}\n />\n <p className={FIELD_HELP}>Saved permanently and shown to anyone who holds the license.</p>\n </div>\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkHQ;AAhHR,mBAAyB;AACzB,0BAA4B;AAC5B,gBAAmB;AACnB,2BAA6B;AAC7B,gBAA8D;AAKvD,MAAM,cAAc;AAAA,EACzB;AAAA,EAAgB;AAAA,EAAS;AAAA,EAAS;AAAA,EAAgB;AAAA,EAAS;AAAA,EAAa;AAAA,EAAiB;AAC3F;AAoCO,MA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4CAAC,UAAK,WAAU,qCAAoC,wBAAU;AAAA,aAAO;AAAA,UAC1G,4CAAC,SAAI,WAAU,0BACZ,sBAAY,IAAI,CAAC,MAChB;AAAA,YAAC;AAAA;AAAA,cAEC,MAAK;AAAA,cACL;AAAA,cACA,SAAS,MAAM,YAAY,CAAC;AAAA,cAC5B,eAAW;AAAA,gBACT;AAAA,gBACA,MAAM,MAAM,SAAS,CAAC,IAClB,2DACA;AAAA,cACN;AAAA,cAEC;AAAA;AAAA,YAXI;AAAA,UAYP,CACD,GACH;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL;AAAA,cACA,OAAO,MAAM;AAAA,cACb,UAAU,CAAC,MAAM,IAAI,cAAc,EAAE,OAAO,KAAK;AAAA,cACjD,aAAY;AAAA,cACZ,eAAW,cAAG,YAAY,QAAQ;AAAA;AAAA,UACpC;AAAA,WACF;AAAA,QAEA,6CAAC,SAAI,WAAU,eACb;AAAA,uDAAC,WAAM,WAAW,aAAa;AAAA;AAAA,YAAiB,4CAAC,UAAK,WAAU,qCAAoC,wBAAU;AAAA,aAAO;AAAA,UACrH;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,OAAO,MAAM;AAAA,cACb,UAAU,CAAC,MAAM,IAAI,eAAe,EAAE,OAAO,KAAK;AAAA,cAClD,aAAY;AAAA,cACZ,MAAM;AAAA,cACN,eAAW,cAAG,YAAY,wBAAwB;AAAA;AAAA,UACpD;AAAA,UACA,4CAAC,OAAE,WAAW,YAAY,0EAA4D;AAAA,WACxF;AAAA,SACF,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
+
/** Common sponsorship media/channel types — deliberately not part of the
|
|
4
|
+
* general IP taxonomy in `data/ip.ts` (that's about the asset itself;
|
|
5
|
+
* this is about the sponsorship deal's channels), so it stays local here. */
|
|
6
|
+
declare const MEDIA_TYPES: readonly ["Social Media", "Video", "Photo", "Article/Blog", "Print", "Broadcast", "Podcast/Audio", "Livestream"];
|
|
3
7
|
/**
|
|
4
8
|
* The deal terms a sponsorship offer/proposal needs, in plain-language shape
|
|
5
9
|
* — no bps, no IPFS, no ByteArray. `royaltyPercent` is a plain 0–100 number
|
|
6
|
-
* (multiply by 100 for the contract's basis-points argument)
|
|
7
|
-
* is
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* never fetches or
|
|
10
|
+
* (multiply by 100 for the contract's basis-points argument). Every field
|
|
11
|
+
* here is declarative metadata carried in the pinned IPFS document (see
|
|
12
|
+
* `toLicenseMetadata`) — the contract never reads any of it, so none of it
|
|
13
|
+
* is enforced beyond the atomic accept-and-mint payment itself. This
|
|
14
|
+
* component only collects and validates the data, it never fetches or
|
|
15
|
+
* uploads anything itself.
|
|
11
16
|
*/
|
|
12
17
|
interface SponsorshipTerms {
|
|
13
18
|
amount: string;
|
|
@@ -15,9 +20,28 @@ interface SponsorshipTerms {
|
|
|
15
20
|
durationDays: string;
|
|
16
21
|
transferable: boolean;
|
|
17
22
|
royaltyPercent: string;
|
|
23
|
+
/** Free-text notes that don't fit any structured field below. */
|
|
18
24
|
licenseText: string;
|
|
25
|
+
licenseType: string;
|
|
26
|
+
commercialUse: "Yes" | "No";
|
|
27
|
+
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
28
|
+
attribution: "Required" | "Not Required";
|
|
29
|
+
territory: string;
|
|
30
|
+
aiPolicy: string;
|
|
31
|
+
/** e.g. "Instagram + YouTube only" — too deal-specific to bound into an enum. */
|
|
32
|
+
scope: string;
|
|
33
|
+
/** e.g. "3 posts, 1 video" */
|
|
34
|
+
deliverables: string;
|
|
35
|
+
exclusive: boolean;
|
|
36
|
+
approvalRequired: boolean;
|
|
37
|
+
media: string[];
|
|
38
|
+
mediaOther: string;
|
|
19
39
|
}
|
|
20
40
|
declare const EMPTY_SPONSORSHIP_TERMS: SponsorshipTerms;
|
|
41
|
+
/** Shapes the pinned-IPFS-JSON payload — the single place both apps build
|
|
42
|
+
* this object, so it can't drift across call sites. Purely additive; the
|
|
43
|
+
* contract never reads any of it. */
|
|
44
|
+
declare function toLicenseMetadata(terms: SponsorshipTerms): Record<string, unknown>;
|
|
21
45
|
interface LicenseTermsBuilderProps {
|
|
22
46
|
value: SponsorshipTerms;
|
|
23
47
|
onChange: (next: SponsorshipTerms) => void;
|
|
@@ -31,4 +55,4 @@ interface LicenseTermsBuilderProps {
|
|
|
31
55
|
}
|
|
32
56
|
declare function LicenseTermsBuilder({ value, onChange, tokenOptions, amountLabel, disabled, className, }: LicenseTermsBuilderProps): react_jsx_runtime.JSX.Element;
|
|
33
57
|
|
|
34
|
-
export { EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, type SponsorshipTerms };
|
|
58
|
+
export { EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, MEDIA_TYPES, type SponsorshipTerms, toLicenseMetadata };
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
+
/** Common sponsorship media/channel types — deliberately not part of the
|
|
4
|
+
* general IP taxonomy in `data/ip.ts` (that's about the asset itself;
|
|
5
|
+
* this is about the sponsorship deal's channels), so it stays local here. */
|
|
6
|
+
declare const MEDIA_TYPES: readonly ["Social Media", "Video", "Photo", "Article/Blog", "Print", "Broadcast", "Podcast/Audio", "Livestream"];
|
|
3
7
|
/**
|
|
4
8
|
* The deal terms a sponsorship offer/proposal needs, in plain-language shape
|
|
5
9
|
* — no bps, no IPFS, no ByteArray. `royaltyPercent` is a plain 0–100 number
|
|
6
|
-
* (multiply by 100 for the contract's basis-points argument)
|
|
7
|
-
* is
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* never fetches or
|
|
10
|
+
* (multiply by 100 for the contract's basis-points argument). Every field
|
|
11
|
+
* here is declarative metadata carried in the pinned IPFS document (see
|
|
12
|
+
* `toLicenseMetadata`) — the contract never reads any of it, so none of it
|
|
13
|
+
* is enforced beyond the atomic accept-and-mint payment itself. This
|
|
14
|
+
* component only collects and validates the data, it never fetches or
|
|
15
|
+
* uploads anything itself.
|
|
11
16
|
*/
|
|
12
17
|
interface SponsorshipTerms {
|
|
13
18
|
amount: string;
|
|
@@ -15,9 +20,28 @@ interface SponsorshipTerms {
|
|
|
15
20
|
durationDays: string;
|
|
16
21
|
transferable: boolean;
|
|
17
22
|
royaltyPercent: string;
|
|
23
|
+
/** Free-text notes that don't fit any structured field below. */
|
|
18
24
|
licenseText: string;
|
|
25
|
+
licenseType: string;
|
|
26
|
+
commercialUse: "Yes" | "No";
|
|
27
|
+
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
28
|
+
attribution: "Required" | "Not Required";
|
|
29
|
+
territory: string;
|
|
30
|
+
aiPolicy: string;
|
|
31
|
+
/** e.g. "Instagram + YouTube only" — too deal-specific to bound into an enum. */
|
|
32
|
+
scope: string;
|
|
33
|
+
/** e.g. "3 posts, 1 video" */
|
|
34
|
+
deliverables: string;
|
|
35
|
+
exclusive: boolean;
|
|
36
|
+
approvalRequired: boolean;
|
|
37
|
+
media: string[];
|
|
38
|
+
mediaOther: string;
|
|
19
39
|
}
|
|
20
40
|
declare const EMPTY_SPONSORSHIP_TERMS: SponsorshipTerms;
|
|
41
|
+
/** Shapes the pinned-IPFS-JSON payload — the single place both apps build
|
|
42
|
+
* this object, so it can't drift across call sites. Purely additive; the
|
|
43
|
+
* contract never reads any of it. */
|
|
44
|
+
declare function toLicenseMetadata(terms: SponsorshipTerms): Record<string, unknown>;
|
|
21
45
|
interface LicenseTermsBuilderProps {
|
|
22
46
|
value: SponsorshipTerms;
|
|
23
47
|
onChange: (next: SponsorshipTerms) => void;
|
|
@@ -31,4 +55,4 @@ interface LicenseTermsBuilderProps {
|
|
|
31
55
|
}
|
|
32
56
|
declare function LicenseTermsBuilder({ value, onChange, tokenOptions, amountLabel, disabled, className, }: LicenseTermsBuilderProps): react_jsx_runtime.JSX.Element;
|
|
33
57
|
|
|
34
|
-
export { EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, type SponsorshipTerms };
|
|
58
|
+
export { EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, MEDIA_TYPES, type SponsorshipTerms, toLicenseMetadata };
|