@medialane/ui 0.78.1 → 0.79.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/license-terms-builder.cjs +193 -212
- package/dist/components/license-terms-builder.cjs.map +1 -1
- package/dist/components/license-terms-builder.d.cts +18 -2
- package/dist/components/license-terms-builder.d.ts +18 -2
- package/dist/components/license-terms-builder.js +192 -213
- package/dist/components/license-terms-builder.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
+
/** Duration units — the on-chain `duration` arg is seconds, but nobody
|
|
4
|
+
* should be forced to think in days for a multi-year deal (or forced into
|
|
5
|
+
* days at all — this is declarative, not contract-enforced). */
|
|
6
|
+
declare const DURATION_UNITS: readonly ["Days", "Weeks", "Months", "Years"];
|
|
7
|
+
type DurationUnit = (typeof DURATION_UNITS)[number];
|
|
8
|
+
/** Converts the user-entered value + unit into whole days for the contract's
|
|
9
|
+
* `duration` arg (seconds = days * 86400, done by the caller). */
|
|
10
|
+
declare function toDurationDays(terms: SponsorshipTerms): number;
|
|
3
11
|
/** Common sponsorship media/channel types — deliberately not part of the
|
|
4
12
|
* general IP taxonomy in `data/ip.ts` (that's about the asset itself;
|
|
5
13
|
* this is about the sponsorship deal's channels), so it stays local here. */
|
|
@@ -17,8 +25,14 @@ declare const MEDIA_TYPES: readonly ["Social Media", "Video", "Photo", "Article/
|
|
|
17
25
|
interface SponsorshipTerms {
|
|
18
26
|
amount: string;
|
|
19
27
|
paymentTokenSymbol: string;
|
|
20
|
-
|
|
28
|
+
/** No default — the user must explicitly set this, never silently inherit one.
|
|
29
|
+
* Paired with `durationUnit`; convert with `toDurationDays()`. */
|
|
30
|
+
durationValue: string;
|
|
31
|
+
durationUnit: DurationUnit;
|
|
21
32
|
transferable: boolean;
|
|
33
|
+
/** Not surfaced in the UI (no resale-royalty concept here) — always "0". Kept
|
|
34
|
+
* on the type because `create_offer`/`propose_sponsorship` still take a
|
|
35
|
+
* `royaltyBps` argument. */
|
|
22
36
|
royaltyPercent: string;
|
|
23
37
|
/** Free-text notes that don't fit any structured field below. */
|
|
24
38
|
licenseText: string;
|
|
@@ -26,6 +40,8 @@ interface SponsorshipTerms {
|
|
|
26
40
|
commercialUse: "Yes" | "No";
|
|
27
41
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
28
42
|
attribution: "Required" | "Not Required";
|
|
43
|
+
/** Free text — "Worldwide" is a fine default, but real deals often name a
|
|
44
|
+
* specific country or an exclusion, which a fixed list can't cover. */
|
|
29
45
|
territory: string;
|
|
30
46
|
aiPolicy: string;
|
|
31
47
|
/** e.g. "Instagram + YouTube only" — too deal-specific to bound into an enum. */
|
|
@@ -55,4 +71,4 @@ interface LicenseTermsBuilderProps {
|
|
|
55
71
|
}
|
|
56
72
|
declare function LicenseTermsBuilder({ value, onChange, tokenOptions, amountLabel, disabled, className, }: LicenseTermsBuilderProps): react_jsx_runtime.JSX.Element;
|
|
57
73
|
|
|
58
|
-
export { EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, MEDIA_TYPES, type SponsorshipTerms, toLicenseMetadata };
|
|
74
|
+
export { DURATION_UNITS, type DurationUnit, EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, MEDIA_TYPES, type SponsorshipTerms, toDurationDays, toLicenseMetadata };
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
+
/** Duration units — the on-chain `duration` arg is seconds, but nobody
|
|
4
|
+
* should be forced to think in days for a multi-year deal (or forced into
|
|
5
|
+
* days at all — this is declarative, not contract-enforced). */
|
|
6
|
+
declare const DURATION_UNITS: readonly ["Days", "Weeks", "Months", "Years"];
|
|
7
|
+
type DurationUnit = (typeof DURATION_UNITS)[number];
|
|
8
|
+
/** Converts the user-entered value + unit into whole days for the contract's
|
|
9
|
+
* `duration` arg (seconds = days * 86400, done by the caller). */
|
|
10
|
+
declare function toDurationDays(terms: SponsorshipTerms): number;
|
|
3
11
|
/** Common sponsorship media/channel types — deliberately not part of the
|
|
4
12
|
* general IP taxonomy in `data/ip.ts` (that's about the asset itself;
|
|
5
13
|
* this is about the sponsorship deal's channels), so it stays local here. */
|
|
@@ -17,8 +25,14 @@ declare const MEDIA_TYPES: readonly ["Social Media", "Video", "Photo", "Article/
|
|
|
17
25
|
interface SponsorshipTerms {
|
|
18
26
|
amount: string;
|
|
19
27
|
paymentTokenSymbol: string;
|
|
20
|
-
|
|
28
|
+
/** No default — the user must explicitly set this, never silently inherit one.
|
|
29
|
+
* Paired with `durationUnit`; convert with `toDurationDays()`. */
|
|
30
|
+
durationValue: string;
|
|
31
|
+
durationUnit: DurationUnit;
|
|
21
32
|
transferable: boolean;
|
|
33
|
+
/** Not surfaced in the UI (no resale-royalty concept here) — always "0". Kept
|
|
34
|
+
* on the type because `create_offer`/`propose_sponsorship` still take a
|
|
35
|
+
* `royaltyBps` argument. */
|
|
22
36
|
royaltyPercent: string;
|
|
23
37
|
/** Free-text notes that don't fit any structured field below. */
|
|
24
38
|
licenseText: string;
|
|
@@ -26,6 +40,8 @@ interface SponsorshipTerms {
|
|
|
26
40
|
commercialUse: "Yes" | "No";
|
|
27
41
|
derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
|
|
28
42
|
attribution: "Required" | "Not Required";
|
|
43
|
+
/** Free text — "Worldwide" is a fine default, but real deals often name a
|
|
44
|
+
* specific country or an exclusion, which a fixed list can't cover. */
|
|
29
45
|
territory: string;
|
|
30
46
|
aiPolicy: string;
|
|
31
47
|
/** e.g. "Instagram + YouTube only" — too deal-specific to bound into an enum. */
|
|
@@ -55,4 +71,4 @@ interface LicenseTermsBuilderProps {
|
|
|
55
71
|
}
|
|
56
72
|
declare function LicenseTermsBuilder({ value, onChange, tokenOptions, amountLabel, disabled, className, }: LicenseTermsBuilderProps): react_jsx_runtime.JSX.Element;
|
|
57
73
|
|
|
58
|
-
export { EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, MEDIA_TYPES, type SponsorshipTerms, toLicenseMetadata };
|
|
74
|
+
export { DURATION_UNITS, type DurationUnit, EMPTY_SPONSORSHIP_TERMS, LicenseTermsBuilder, type LicenseTermsBuilderProps, MEDIA_TYPES, type SponsorshipTerms, toDurationDays, toLicenseMetadata };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { ChevronDown, ScrollText } from "lucide-react";
|
|
5
3
|
import { cn } from "../utils/cn.js";
|
|
6
4
|
import { CurrencyIcon } from "./currency-icon.js";
|
|
7
|
-
import { LICENSE_TYPES,
|
|
5
|
+
import { LICENSE_TYPES, AI_POLICIES } from "../data/ip.js";
|
|
6
|
+
const DURATION_UNITS = ["Days", "Weeks", "Months", "Years"];
|
|
7
|
+
const DURATION_UNIT_DAYS = { Days: 1, Weeks: 7, Months: 30, Years: 365 };
|
|
8
|
+
function toDurationDays(terms) {
|
|
9
|
+
const raw = Number(terms.durationValue || "0");
|
|
10
|
+
if (!raw || raw <= 0) return 0;
|
|
11
|
+
return Math.round(raw * DURATION_UNIT_DAYS[terms.durationUnit]);
|
|
12
|
+
}
|
|
8
13
|
const MEDIA_TYPES = [
|
|
9
14
|
"Social Media",
|
|
10
15
|
"Video",
|
|
@@ -18,9 +23,10 @@ const MEDIA_TYPES = [
|
|
|
18
23
|
const EMPTY_SPONSORSHIP_TERMS = {
|
|
19
24
|
amount: "",
|
|
20
25
|
paymentTokenSymbol: "",
|
|
21
|
-
|
|
26
|
+
durationValue: "",
|
|
27
|
+
durationUnit: "Days",
|
|
22
28
|
transferable: true,
|
|
23
|
-
royaltyPercent: "
|
|
29
|
+
royaltyPercent: "0",
|
|
24
30
|
licenseText: "",
|
|
25
31
|
licenseType: "CC BY-SA",
|
|
26
32
|
commercialUse: "Yes",
|
|
@@ -89,7 +95,6 @@ function LicenseTermsBuilder({
|
|
|
89
95
|
disabled,
|
|
90
96
|
className
|
|
91
97
|
}) {
|
|
92
|
-
const [panelOpen, setPanelOpen] = useState(false);
|
|
93
98
|
const set = (key, v) => onChange({ ...value, [key]: v });
|
|
94
99
|
const handleLicenseTypeChange = (licenseType) => {
|
|
95
100
|
const def = LICENSE_TYPES.find((l) => l.value === licenseType);
|
|
@@ -143,23 +148,6 @@ function LicenseTermsBuilder({
|
|
|
143
148
|
symbol
|
|
144
149
|
)) })
|
|
145
150
|
] }),
|
|
146
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
147
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Resale royalty (%)" }),
|
|
148
|
-
/* @__PURE__ */ jsx(
|
|
149
|
-
"input",
|
|
150
|
-
{
|
|
151
|
-
type: "number",
|
|
152
|
-
min: 0,
|
|
153
|
-
max: 100,
|
|
154
|
-
step: "0.1",
|
|
155
|
-
disabled,
|
|
156
|
-
value: value.royaltyPercent,
|
|
157
|
-
onChange: (e) => set("royaltyPercent", e.target.value),
|
|
158
|
-
className: INPUT_BASE
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
/* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: "You get this share automatically if the license is ever resold." })
|
|
162
|
-
] }),
|
|
163
151
|
/* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2.5 cursor-pointer select-none", children: [
|
|
164
152
|
/* @__PURE__ */ jsx(
|
|
165
153
|
"input",
|
|
@@ -176,211 +164,202 @@ function LicenseTermsBuilder({
|
|
|
176
164
|
/* @__PURE__ */ jsx("span", { className: 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." })
|
|
177
165
|
] })
|
|
178
166
|
] }),
|
|
179
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
{
|
|
183
|
-
type: "button",
|
|
184
|
-
onClick: () => setPanelOpen((o) => !o),
|
|
185
|
-
className: "w-full flex items-center justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-card/80",
|
|
186
|
-
children: [
|
|
187
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2.5 min-w-0", children: [
|
|
188
|
-
/* @__PURE__ */ jsx(ScrollText, { className: "h-4 w-4 text-brand-purple shrink-0" }),
|
|
189
|
-
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
190
|
-
/* @__PURE__ */ jsx("span", { className: "block text-sm font-semibold", children: "How long, where, and what for" }),
|
|
191
|
-
!panelOpen ? /* @__PURE__ */ jsxs("span", { className: "block text-xs text-muted-foreground truncate", children: [
|
|
192
|
-
value.durationDays || "30",
|
|
193
|
-
" days \xB7 ",
|
|
194
|
-
value.territory,
|
|
195
|
-
" \xB7 ",
|
|
196
|
-
value.licenseType
|
|
197
|
-
] }) : null
|
|
198
|
-
] })
|
|
199
|
-
] }),
|
|
200
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: cn("h-4 w-4 transition-transform text-muted-foreground shrink-0", panelOpen && "rotate-180") })
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
),
|
|
204
|
-
panelOpen ? /* @__PURE__ */ jsxs("div", { className: "px-4 pb-4 space-y-4 border-t border-border pt-4", children: [
|
|
205
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
206
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "License length (days)" }),
|
|
207
|
-
/* @__PURE__ */ jsx(
|
|
208
|
-
"input",
|
|
209
|
-
{
|
|
210
|
-
type: "number",
|
|
211
|
-
min: 1,
|
|
212
|
-
disabled,
|
|
213
|
-
value: value.durationDays,
|
|
214
|
-
onChange: (e) => set("durationDays", e.target.value),
|
|
215
|
-
className: INPUT_BASE
|
|
216
|
-
}
|
|
217
|
-
),
|
|
218
|
-
/* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: "Counted from the moment the deal is accepted, not from today." })
|
|
219
|
-
] }),
|
|
220
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
221
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "License type" }),
|
|
222
|
-
/* @__PURE__ */ jsx(
|
|
223
|
-
"select",
|
|
224
|
-
{
|
|
225
|
-
disabled,
|
|
226
|
-
value: value.licenseType,
|
|
227
|
-
onChange: (e) => handleLicenseTypeChange(e.target.value),
|
|
228
|
-
className: INPUT_BASE,
|
|
229
|
-
children: LICENSE_TYPES.map((l) => /* @__PURE__ */ jsx("option", { value: l.value, children: l.label }, l.value))
|
|
230
|
-
}
|
|
231
|
-
),
|
|
232
|
-
selectedLicense ? /* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: selectedLicense.description }) : null
|
|
233
|
-
] }),
|
|
234
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
235
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Commercial use" }),
|
|
236
|
-
/* @__PURE__ */ jsx(ToggleGroup, { value: value.commercialUse, options: ["Yes", "No"], onChange: (v) => set("commercialUse", v), disabled })
|
|
237
|
-
] }),
|
|
238
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
239
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Derivatives" }),
|
|
240
|
-
/* @__PURE__ */ jsx(ToggleGroup, { value: value.derivatives, options: ["Allowed", "Not Allowed", "Share-Alike"], onChange: (v) => set("derivatives", v), disabled })
|
|
241
|
-
] }),
|
|
242
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
243
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Attribution" }),
|
|
244
|
-
/* @__PURE__ */ jsx(ToggleGroup, { value: value.attribution, options: ["Required", "Not Required"], onChange: (v) => set("attribution", v), disabled })
|
|
245
|
-
] }),
|
|
246
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
247
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Territory" }),
|
|
248
|
-
/* @__PURE__ */ jsx(
|
|
249
|
-
"select",
|
|
250
|
-
{
|
|
251
|
-
disabled,
|
|
252
|
-
value: value.territory,
|
|
253
|
-
onChange: (e) => set("territory", e.target.value),
|
|
254
|
-
className: INPUT_BASE,
|
|
255
|
-
children: GEOGRAPHIC_SCOPES.map((t) => /* @__PURE__ */ jsx("option", { value: t, children: t }, t))
|
|
256
|
-
}
|
|
257
|
-
)
|
|
258
|
-
] }),
|
|
259
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
260
|
-
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "AI policy" }),
|
|
261
|
-
/* @__PURE__ */ jsx(
|
|
262
|
-
"select",
|
|
263
|
-
{
|
|
264
|
-
disabled,
|
|
265
|
-
value: value.aiPolicy,
|
|
266
|
-
onChange: (e) => set("aiPolicy", e.target.value),
|
|
267
|
-
className: INPUT_BASE,
|
|
268
|
-
children: AI_POLICIES.map((p) => /* @__PURE__ */ jsx("option", { value: p, children: p }, p))
|
|
269
|
-
}
|
|
270
|
-
),
|
|
271
|
-
/* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: "Whether this work can be used to train AI models." })
|
|
272
|
-
] }),
|
|
273
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
274
|
-
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
275
|
-
"Scope ",
|
|
276
|
-
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
277
|
-
] }),
|
|
278
|
-
/* @__PURE__ */ jsx(
|
|
279
|
-
"input",
|
|
280
|
-
{
|
|
281
|
-
type: "text",
|
|
282
|
-
disabled,
|
|
283
|
-
value: value.scope,
|
|
284
|
-
onChange: (e) => set("scope", e.target.value),
|
|
285
|
-
placeholder: "e.g. Instagram + YouTube only",
|
|
286
|
-
className: INPUT_BASE
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
] }),
|
|
290
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
291
|
-
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
292
|
-
"Deliverables ",
|
|
293
|
-
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
294
|
-
] }),
|
|
295
|
-
/* @__PURE__ */ jsx(
|
|
296
|
-
"textarea",
|
|
297
|
-
{
|
|
298
|
-
disabled,
|
|
299
|
-
value: value.deliverables,
|
|
300
|
-
onChange: (e) => set("deliverables", e.target.value),
|
|
301
|
-
placeholder: "e.g. 3 posts, 1 video",
|
|
302
|
-
rows: 2,
|
|
303
|
-
className: cn(INPUT_BASE, "h-auto py-2.5 resize-y")
|
|
304
|
-
}
|
|
305
|
-
)
|
|
306
|
-
] }),
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
168
|
+
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "License length" }),
|
|
169
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1fr_auto] gap-2", children: [
|
|
307
170
|
/* @__PURE__ */ jsx(
|
|
308
|
-
|
|
171
|
+
"input",
|
|
309
172
|
{
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
173
|
+
type: "number",
|
|
174
|
+
min: 1,
|
|
175
|
+
disabled,
|
|
176
|
+
value: value.durationValue,
|
|
177
|
+
onChange: (e) => set("durationValue", e.target.value),
|
|
178
|
+
placeholder: "e.g. 30",
|
|
179
|
+
className: INPUT_BASE
|
|
315
180
|
}
|
|
316
181
|
),
|
|
317
182
|
/* @__PURE__ */ jsx(
|
|
318
|
-
|
|
183
|
+
"select",
|
|
319
184
|
{
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
185
|
+
disabled,
|
|
186
|
+
value: value.durationUnit,
|
|
187
|
+
onChange: (e) => set("durationUnit", e.target.value),
|
|
188
|
+
className: cn(INPUT_BASE, "w-28"),
|
|
189
|
+
children: DURATION_UNITS.map((u) => /* @__PURE__ */ jsx("option", { value: u, children: u }, u))
|
|
325
190
|
}
|
|
326
|
-
)
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
191
|
+
)
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: "Counted from the moment the deal is accepted, not from today." })
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
196
|
+
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "License type" }),
|
|
197
|
+
/* @__PURE__ */ jsx(
|
|
198
|
+
"select",
|
|
199
|
+
{
|
|
200
|
+
disabled,
|
|
201
|
+
value: value.licenseType,
|
|
202
|
+
onChange: (e) => handleLicenseTypeChange(e.target.value),
|
|
203
|
+
className: INPUT_BASE,
|
|
204
|
+
children: LICENSE_TYPES.map((l) => /* @__PURE__ */ jsx("option", { value: l.value, children: l.label }, l.value))
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
selectedLicense ? /* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: selectedLicense.description }) : null
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
210
|
+
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Commercial use" }),
|
|
211
|
+
/* @__PURE__ */ jsx(ToggleGroup, { value: value.commercialUse, options: ["Yes", "No"], onChange: (v) => set("commercialUse", v), disabled })
|
|
212
|
+
] }),
|
|
213
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
214
|
+
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Derivatives" }),
|
|
215
|
+
/* @__PURE__ */ jsx(ToggleGroup, { value: value.derivatives, options: ["Allowed", "Not Allowed", "Share-Alike"], onChange: (v) => set("derivatives", v), disabled })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
218
|
+
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "Attribution" }),
|
|
219
|
+
/* @__PURE__ */ jsx(ToggleGroup, { value: value.attribution, options: ["Required", "Not Required"], onChange: (v) => set("attribution", v), disabled })
|
|
220
|
+
] }),
|
|
221
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
222
|
+
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
223
|
+
"Territory ",
|
|
224
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
225
|
+
] }),
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
227
|
+
"input",
|
|
228
|
+
{
|
|
229
|
+
type: "text",
|
|
230
|
+
disabled,
|
|
231
|
+
value: value.territory,
|
|
232
|
+
onChange: (e) => set("territory", e.target.value),
|
|
233
|
+
placeholder: "e.g. Worldwide, Brazil only, excluding China",
|
|
234
|
+
className: INPUT_BASE
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
239
|
+
/* @__PURE__ */ jsx("label", { className: FIELD_LABEL, children: "AI policy" }),
|
|
240
|
+
/* @__PURE__ */ jsx(
|
|
241
|
+
"select",
|
|
242
|
+
{
|
|
243
|
+
disabled,
|
|
244
|
+
value: value.aiPolicy,
|
|
245
|
+
onChange: (e) => set("aiPolicy", e.target.value),
|
|
246
|
+
className: INPUT_BASE,
|
|
247
|
+
children: AI_POLICIES.map((p) => /* @__PURE__ */ jsx("option", { value: p, children: p }, p))
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: "Whether this work can be used to train AI models." })
|
|
251
|
+
] }),
|
|
252
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
253
|
+
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
254
|
+
"Scope ",
|
|
255
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ jsx(
|
|
258
|
+
"input",
|
|
259
|
+
{
|
|
260
|
+
type: "text",
|
|
261
|
+
disabled,
|
|
262
|
+
value: value.scope,
|
|
263
|
+
onChange: (e) => set("scope", e.target.value),
|
|
264
|
+
placeholder: "e.g. Instagram + YouTube only",
|
|
265
|
+
className: INPUT_BASE
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] }),
|
|
269
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
270
|
+
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
271
|
+
"Deliverables ",
|
|
272
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ jsx(
|
|
275
|
+
"textarea",
|
|
276
|
+
{
|
|
277
|
+
disabled,
|
|
278
|
+
value: value.deliverables,
|
|
279
|
+
onChange: (e) => set("deliverables", e.target.value),
|
|
280
|
+
placeholder: "e.g. 3 posts, 1 video",
|
|
281
|
+
rows: 2,
|
|
282
|
+
className: cn(INPUT_BASE, "h-auto py-2.5 resize-y")
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ jsx(
|
|
287
|
+
YesNoToggle,
|
|
288
|
+
{
|
|
289
|
+
label: "Exclusive to this sponsor",
|
|
290
|
+
help: "No other sponsors during the license term.",
|
|
291
|
+
checked: value.exclusive,
|
|
292
|
+
onChange: (v) => set("exclusive", v),
|
|
293
|
+
disabled
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
/* @__PURE__ */ jsx(
|
|
297
|
+
YesNoToggle,
|
|
298
|
+
{
|
|
299
|
+
label: "Content approval required",
|
|
300
|
+
help: "Sponsor reviews content before it's published.",
|
|
301
|
+
checked: value.approvalRequired,
|
|
302
|
+
onChange: (v) => set("approvalRequired", v),
|
|
303
|
+
disabled
|
|
304
|
+
}
|
|
305
|
+
),
|
|
306
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
307
|
+
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
308
|
+
"Media ",
|
|
309
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
310
|
+
] }),
|
|
311
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: MEDIA_TYPES.map((m) => /* @__PURE__ */ jsx(
|
|
312
|
+
"button",
|
|
313
|
+
{
|
|
314
|
+
type: "button",
|
|
315
|
+
disabled,
|
|
316
|
+
onClick: () => toggleMedia(m),
|
|
317
|
+
className: cn(
|
|
318
|
+
"h-8 px-2.5 rounded-full border text-xs font-medium transition-colors disabled:opacity-50",
|
|
319
|
+
value.media.includes(m) ? "border-brand-purple bg-brand-purple/10 text-foreground" : "border-border bg-card text-muted-foreground hover:text-foreground"
|
|
373
320
|
),
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
321
|
+
children: m
|
|
322
|
+
},
|
|
323
|
+
m
|
|
324
|
+
)) }),
|
|
325
|
+
/* @__PURE__ */ jsx(
|
|
326
|
+
"input",
|
|
327
|
+
{
|
|
328
|
+
type: "text",
|
|
329
|
+
disabled,
|
|
330
|
+
value: value.mediaOther,
|
|
331
|
+
onChange: (e) => set("mediaOther", e.target.value),
|
|
332
|
+
placeholder: "Other media type",
|
|
333
|
+
className: cn(INPUT_BASE, "mt-1.5")
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] }),
|
|
337
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
338
|
+
/* @__PURE__ */ jsxs("label", { className: FIELD_LABEL, children: [
|
|
339
|
+
"Additional terms ",
|
|
340
|
+
/* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ jsx(
|
|
343
|
+
"textarea",
|
|
344
|
+
{
|
|
345
|
+
disabled,
|
|
346
|
+
value: value.licenseText,
|
|
347
|
+
onChange: (e) => set("licenseText", e.target.value),
|
|
348
|
+
placeholder: "Anything else worth spelling out.",
|
|
349
|
+
rows: 3,
|
|
350
|
+
className: cn(INPUT_BASE, "h-auto py-2.5 resize-y")
|
|
351
|
+
}
|
|
352
|
+
),
|
|
353
|
+
/* @__PURE__ */ jsx("p", { className: FIELD_HELP, children: "Saved permanently and shown to anyone who holds the license." })
|
|
377
354
|
] })
|
|
378
355
|
] });
|
|
379
356
|
}
|
|
380
357
|
export {
|
|
358
|
+
DURATION_UNITS,
|
|
381
359
|
EMPTY_SPONSORSHIP_TERMS,
|
|
382
360
|
LicenseTermsBuilder,
|
|
383
361
|
MEDIA_TYPES,
|
|
362
|
+
toDurationDays,
|
|
384
363
|
toLicenseMetadata
|
|
385
364
|
};
|
|
386
365
|
//# sourceMappingURL=license-terms-builder.js.map
|