@medialane/ui 0.391.0 → 0.392.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.
Files changed (93) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/badge.d.cts +1 -1
  4. package/dist/components/badge.d.ts +1 -1
  5. package/dist/components/button.d.cts +2 -2
  6. package/dist/components/button.d.ts +2 -2
  7. package/dist/components/create-form-primitives.cjs +6 -1
  8. package/dist/components/create-form-primitives.cjs.map +1 -1
  9. package/dist/components/create-form-primitives.js +6 -1
  10. package/dist/components/create-form-primitives.js.map +1 -1
  11. package/dist/components/drop/create/asset-editor.cjs +164 -0
  12. package/dist/components/drop/create/asset-editor.cjs.map +1 -0
  13. package/dist/components/drop/create/asset-editor.d.cts +16 -0
  14. package/dist/components/drop/create/asset-editor.d.ts +16 -0
  15. package/dist/components/drop/create/asset-editor.js +140 -0
  16. package/dist/components/drop/create/asset-editor.js.map +1 -0
  17. package/dist/components/drop/create/assets-panel.cjs +269 -0
  18. package/dist/components/drop/create/assets-panel.cjs.map +1 -0
  19. package/dist/components/drop/create/assets-panel.d.cts +10 -0
  20. package/dist/components/drop/create/assets-panel.d.ts +10 -0
  21. package/dist/components/drop/create/assets-panel.js +245 -0
  22. package/dist/components/drop/create/assets-panel.js.map +1 -0
  23. package/dist/components/drop/create/collection-panel.cjs +138 -0
  24. package/dist/components/drop/create/collection-panel.cjs.map +1 -0
  25. package/dist/components/drop/create/collection-panel.d.cts +11 -0
  26. package/dist/components/drop/create/collection-panel.d.ts +11 -0
  27. package/dist/components/drop/create/collection-panel.js +113 -0
  28. package/dist/components/drop/create/collection-panel.js.map +1 -0
  29. package/dist/components/drop/create/drop-create.cjs +57 -112
  30. package/dist/components/drop/create/drop-create.cjs.map +1 -1
  31. package/dist/components/drop/create/drop-create.d.cts +5 -12
  32. package/dist/components/drop/create/drop-create.d.ts +5 -12
  33. package/dist/components/drop/create/drop-create.js +60 -112
  34. package/dist/components/drop/create/drop-create.js.map +1 -1
  35. package/dist/components/drop/create/drop-fields.cjs +39 -143
  36. package/dist/components/drop/create/drop-fields.cjs.map +1 -1
  37. package/dist/components/drop/create/drop-fields.d.cts +3 -16
  38. package/dist/components/drop/create/drop-fields.d.ts +3 -16
  39. package/dist/components/drop/create/drop-fields.js +39 -130
  40. package/dist/components/drop/create/drop-fields.js.map +1 -1
  41. package/dist/components/drop/create/drop-panel.cjs +57 -0
  42. package/dist/components/drop/create/drop-panel.cjs.map +1 -0
  43. package/dist/components/drop/create/drop-panel.d.cts +24 -0
  44. package/dist/components/drop/create/drop-panel.d.ts +24 -0
  45. package/dist/components/drop/create/drop-panel.js +33 -0
  46. package/dist/components/drop/create/drop-panel.js.map +1 -0
  47. package/dist/components/drop/create/launch-dialog.cjs +40 -45
  48. package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
  49. package/dist/components/drop/create/launch-dialog.d.cts +3 -5
  50. package/dist/components/drop/create/launch-dialog.d.ts +3 -5
  51. package/dist/components/drop/create/launch-dialog.js +44 -49
  52. package/dist/components/drop/create/launch-dialog.js.map +1 -1
  53. package/dist/components/drop/create/settings-panel.cjs +97 -0
  54. package/dist/components/drop/create/settings-panel.cjs.map +1 -0
  55. package/dist/components/drop/create/settings-panel.d.cts +10 -0
  56. package/dist/components/drop/create/settings-panel.d.ts +10 -0
  57. package/dist/components/drop/create/settings-panel.js +73 -0
  58. package/dist/components/drop/create/settings-panel.js.map +1 -0
  59. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  60. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  61. package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
  62. package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
  63. package/dist/draft-CuU1m9P3.d.cts +85 -0
  64. package/dist/draft-DaQIVRMX.d.ts +85 -0
  65. package/dist/i18n/catalog/pt.cjs +49 -21
  66. package/dist/i18n/catalog/pt.cjs.map +1 -1
  67. package/dist/i18n/catalog/pt.js +49 -21
  68. package/dist/i18n/catalog/pt.js.map +1 -1
  69. package/dist/index.cjs.map +1 -1
  70. package/dist/index.d.cts +4 -4
  71. package/dist/index.d.ts +4 -4
  72. package/dist/index.js.map +1 -1
  73. package/dist/utils/drop/draft-store.cjs +133 -0
  74. package/dist/utils/drop/draft-store.cjs.map +1 -0
  75. package/dist/utils/drop/draft-store.d.cts +22 -0
  76. package/dist/utils/drop/draft-store.d.ts +22 -0
  77. package/dist/utils/drop/draft-store.js +107 -0
  78. package/dist/utils/drop/draft-store.js.map +1 -0
  79. package/dist/utils/drop/draft.cjs +61 -34
  80. package/dist/utils/drop/draft.cjs.map +1 -1
  81. package/dist/utils/drop/draft.d.cts +2 -39
  82. package/dist/utils/drop/draft.d.ts +2 -39
  83. package/dist/utils/drop/draft.js +57 -33
  84. package/dist/utils/drop/draft.js.map +1 -1
  85. package/dist/utils/drop/metadata.cjs +35 -16
  86. package/dist/utils/drop/metadata.cjs.map +1 -1
  87. package/dist/utils/drop/metadata.d.cts +3 -28
  88. package/dist/utils/drop/metadata.d.ts +3 -28
  89. package/dist/utils/drop/metadata.js +33 -15
  90. package/dist/utils/drop/metadata.js.map +1 -1
  91. package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
  92. package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
  93. package/package.json +1 -1
@@ -0,0 +1,97 @@
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 settings_panel_exports = {};
21
+ __export(settings_panel_exports, {
22
+ SettingsPanel: () => SettingsPanel
23
+ });
24
+ module.exports = __toCommonJS(settings_panel_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_lucide_react = require("lucide-react");
28
+ var import_collapsible_section = require("../../collapsible-section.js");
29
+ var import_drop_panel = require("./drop-panel.js");
30
+ var import_drop_fields = require("./drop-fields.js");
31
+ var import_exclusive_fields = require("./exclusive-fields.js");
32
+ var import_sale = require("../../../utils/drop/sale.js");
33
+ var import_use_drops = require("../../../utils/use-drops.js");
34
+ var import_provider = require("../../../i18n/provider.js");
35
+ var import_use_format = require("../../../i18n/use-format.js");
36
+ function SettingsPanel({ draft, setDraft, errors, open, onToggle }) {
37
+ const t = (0, import_provider.useT)();
38
+ const intl = (0, import_use_format.useFormat)();
39
+ const feeBps = (0, import_use_drops.useDropFee)();
40
+ const [licenseOpen, setLicenseOpen] = (0, import_react.useState)(false);
41
+ const settings = errors.settings;
42
+ const saleValid = Object.keys((0, import_sale.validateSale)(draft.sale, 0)).every((k) => k === "start");
43
+ const terms = saleValid ? (0, import_sale.toDropTerms)(draft.sale) : null;
44
+ const price = terms ? (0, import_sale.priceLabel)(terms.price, terms.paymentToken) : t("Set a price");
45
+ const start = draft.sale.startNow || !terms || terms.startTime === 0 ? t("Starts at launch") : t("Starts {date}", { date: intl.dateTime(new Date(terms.startTime * 1e3)) });
46
+ const fields = { draft, setDraft, errors: settings };
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
48
+ import_drop_panel.DropPanel,
49
+ {
50
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.SlidersHorizontal, {}),
51
+ title: t("Drop settings"),
52
+ open,
53
+ onToggle,
54
+ error: Object.values(settings).find(Boolean),
55
+ summary: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "block space-y-0.5", children: [
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block", children: t(price) }),
57
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block", children: start }),
58
+ draft.listOnly && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block", children: t("Wallet list") })
59
+ ] }),
60
+ children: [
61
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_fields.PriceFields, { ...fields, feeBps }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_fields.TimingFields, { ...fields }),
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_fields.AccessFields, { ...fields }),
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ import_collapsible_section.CollapsibleSection,
66
+ {
67
+ open: licenseOpen,
68
+ onOpenChange: setLicenseOpen,
69
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldCheck, { className: "h-4 w-4 text-primary" }),
70
+ label: t("License terms"),
71
+ hint: t("For every asset"),
72
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_fields.LicenseFields, { draft, setDraft })
73
+ }
74
+ ),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
76
+ import_collapsible_section.CollapsibleSection,
77
+ {
78
+ open: draft.gated.enabled,
79
+ onOpenChange: (enabled) => setDraft({ gated: { ...draft.gated, enabled } }),
80
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Lock, { className: "h-4 w-4 text-primary" }),
81
+ label: t("Exclusive content"),
82
+ hint: t("A private link for holders"),
83
+ children: [
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_exclusive_fields.ExclusiveFields, { value: draft.gated, onChange: (v) => setDraft({ gated: { ...draft.gated, ...v } }) }),
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drop_fields.FieldError, { message: settings.gated })
86
+ ]
87
+ }
88
+ )
89
+ ]
90
+ }
91
+ );
92
+ }
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ SettingsPanel
96
+ });
97
+ //# sourceMappingURL=settings-panel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/create/settings-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Lock, ShieldCheck, SlidersHorizontal } from \"lucide-react\";\nimport { CollapsibleSection } from \"../../collapsible-section.js\";\nimport { DropPanel, type PanelProps } from \"./drop-panel.js\";\nimport { AccessFields, FieldError, LicenseFields, PriceFields, TimingFields } from \"./drop-fields.js\";\nimport { ExclusiveFields } from \"./exclusive-fields.js\";\nimport { priceLabel, toDropTerms, validateSale } from \"../../../utils/drop/sale.js\";\nimport { useDropFee } from \"../../../utils/use-drops.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { useFormat } from \"../../../i18n/use-format.js\";\n\nexport function SettingsPanel({ draft, setDraft, errors, open, onToggle }: PanelProps) {\n const t = useT();\n const intl = useFormat();\n const feeBps = useDropFee();\n const [licenseOpen, setLicenseOpen] = useState(false);\n const settings = errors.settings;\n const saleValid = Object.keys(validateSale(draft.sale, 0)).every((k) => k === \"start\");\n const terms = saleValid ? toDropTerms(draft.sale) : null;\n const price = terms ? priceLabel(terms.price, terms.paymentToken) : t(\"Set a price\");\n const start = draft.sale.startNow || !terms || terms.startTime === 0\n ? t(\"Starts at launch\")\n : t(\"Starts {date}\", { date: intl.dateTime(new Date(terms.startTime * 1000)) });\n const fields = { draft, setDraft, errors: settings };\n\n return (\n <DropPanel\n icon={<SlidersHorizontal />}\n title={t(\"Drop settings\")}\n open={open}\n onToggle={onToggle}\n error={Object.values(settings).find(Boolean)}\n summary={\n <span className=\"block space-y-0.5\">\n <span className=\"block\">{t(price)}</span>\n <span className=\"block\">{start}</span>\n {draft.listOnly && <span className=\"block\">{t(\"Wallet list\")}</span>}\n </span>\n }\n >\n <PriceFields {...fields} feeBps={feeBps} />\n <TimingFields {...fields} />\n <AccessFields {...fields} />\n <CollapsibleSection open={licenseOpen} onOpenChange={setLicenseOpen}\n icon={<ShieldCheck className=\"h-4 w-4 text-primary\" />}\n label={t(\"License terms\")} hint={t(\"For every asset\")}>\n <LicenseFields draft={draft} setDraft={setDraft} />\n </CollapsibleSection>\n <CollapsibleSection open={draft.gated.enabled}\n onOpenChange={(enabled) => setDraft({ gated: { ...draft.gated, enabled } })}\n icon={<Lock className=\"h-4 w-4 text-primary\" />}\n label={t(\"Exclusive content\")} hint={t(\"A private link for holders\")}>\n <ExclusiveFields value={draft.gated} onChange={(v) => setDraft({ gated: { ...draft.gated, ...v } })} />\n <FieldError message={settings.gated} />\n </CollapsibleSection>\n </DropPanel>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BY;AA3BZ,mBAAyB;AACzB,0BAAqD;AACrD,iCAAmC;AACnC,wBAA2C;AAC3C,yBAAmF;AACnF,8BAAgC;AAChC,kBAAsD;AACtD,uBAA2B;AAC3B,sBAAqB;AACrB,wBAA0B;AAEnB,SAAS,cAAc,EAAE,OAAO,UAAU,QAAQ,MAAM,SAAS,GAAe;AACrF,QAAM,QAAI,sBAAK;AACf,QAAM,WAAO,6BAAU;AACvB,QAAM,aAAS,6BAAW;AAC1B,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AACpD,QAAM,WAAW,OAAO;AACxB,QAAM,YAAY,OAAO,SAAK,0BAAa,MAAM,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,MAAM,OAAO;AACrF,QAAM,QAAQ,gBAAY,yBAAY,MAAM,IAAI,IAAI;AACpD,QAAM,QAAQ,YAAQ,wBAAW,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AC7C,OAAO,EAAE,mBAAmB;AAAA,YAAG,MAAM,EAAE,4BAA4B;AAAA,YACnE;AAAA,0DAAC,2CAAgB,OAAO,MAAM,OAAO,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,GAAG,EAAE,EAAE,CAAC,GAAG;AAAA,cACrG,4CAAC,iCAAW,SAAS,SAAS,OAAO;AAAA;AAAA;AAAA,QACvC;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PanelProps } from './drop-panel.cjs';
3
+ import 'react';
4
+ import '../../../draft-CuU1m9P3.cjs';
5
+ import '@medialane/sdk';
6
+ import '../../../utils/drop/sale.cjs';
7
+
8
+ declare function SettingsPanel({ draft, setDraft, errors, open, onToggle }: PanelProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { SettingsPanel };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PanelProps } from './drop-panel.js';
3
+ import 'react';
4
+ import '../../../draft-DaQIVRMX.js';
5
+ import '@medialane/sdk';
6
+ import '../../../utils/drop/sale.js';
7
+
8
+ declare function SettingsPanel({ draft, setDraft, errors, open, onToggle }: PanelProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { SettingsPanel };
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { Lock, ShieldCheck, SlidersHorizontal } from "lucide-react";
5
+ import { CollapsibleSection } from "../../collapsible-section.js";
6
+ import { DropPanel } from "./drop-panel.js";
7
+ import { AccessFields, FieldError, LicenseFields, PriceFields, TimingFields } from "./drop-fields.js";
8
+ import { ExclusiveFields } from "./exclusive-fields.js";
9
+ import { priceLabel, toDropTerms, validateSale } from "../../../utils/drop/sale.js";
10
+ import { useDropFee } from "../../../utils/use-drops.js";
11
+ import { useT } from "../../../i18n/provider.js";
12
+ import { useFormat } from "../../../i18n/use-format.js";
13
+ function SettingsPanel({ draft, setDraft, errors, open, onToggle }) {
14
+ const t = useT();
15
+ const intl = useFormat();
16
+ const feeBps = useDropFee();
17
+ const [licenseOpen, setLicenseOpen] = useState(false);
18
+ const settings = errors.settings;
19
+ const saleValid = Object.keys(validateSale(draft.sale, 0)).every((k) => k === "start");
20
+ const terms = saleValid ? toDropTerms(draft.sale) : null;
21
+ const price = terms ? priceLabel(terms.price, terms.paymentToken) : t("Set a price");
22
+ const start = draft.sale.startNow || !terms || terms.startTime === 0 ? t("Starts at launch") : t("Starts {date}", { date: intl.dateTime(new Date(terms.startTime * 1e3)) });
23
+ const fields = { draft, setDraft, errors: settings };
24
+ return /* @__PURE__ */ jsxs(
25
+ DropPanel,
26
+ {
27
+ icon: /* @__PURE__ */ jsx(SlidersHorizontal, {}),
28
+ title: t("Drop settings"),
29
+ open,
30
+ onToggle,
31
+ error: Object.values(settings).find(Boolean),
32
+ summary: /* @__PURE__ */ jsxs("span", { className: "block space-y-0.5", children: [
33
+ /* @__PURE__ */ jsx("span", { className: "block", children: t(price) }),
34
+ /* @__PURE__ */ jsx("span", { className: "block", children: start }),
35
+ draft.listOnly && /* @__PURE__ */ jsx("span", { className: "block", children: t("Wallet list") })
36
+ ] }),
37
+ children: [
38
+ /* @__PURE__ */ jsx(PriceFields, { ...fields, feeBps }),
39
+ /* @__PURE__ */ jsx(TimingFields, { ...fields }),
40
+ /* @__PURE__ */ jsx(AccessFields, { ...fields }),
41
+ /* @__PURE__ */ jsx(
42
+ CollapsibleSection,
43
+ {
44
+ open: licenseOpen,
45
+ onOpenChange: setLicenseOpen,
46
+ icon: /* @__PURE__ */ jsx(ShieldCheck, { className: "h-4 w-4 text-primary" }),
47
+ label: t("License terms"),
48
+ hint: t("For every asset"),
49
+ children: /* @__PURE__ */ jsx(LicenseFields, { draft, setDraft })
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsxs(
53
+ CollapsibleSection,
54
+ {
55
+ open: draft.gated.enabled,
56
+ onOpenChange: (enabled) => setDraft({ gated: { ...draft.gated, enabled } }),
57
+ icon: /* @__PURE__ */ jsx(Lock, { className: "h-4 w-4 text-primary" }),
58
+ label: t("Exclusive content"),
59
+ hint: t("A private link for holders"),
60
+ children: [
61
+ /* @__PURE__ */ jsx(ExclusiveFields, { value: draft.gated, onChange: (v) => setDraft({ gated: { ...draft.gated, ...v } }) }),
62
+ /* @__PURE__ */ jsx(FieldError, { message: settings.gated })
63
+ ]
64
+ }
65
+ )
66
+ ]
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ SettingsPanel
72
+ };
73
+ //# sourceMappingURL=settings-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/drop/create/settings-panel.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Lock, ShieldCheck, SlidersHorizontal } from \"lucide-react\";\nimport { CollapsibleSection } from \"../../collapsible-section.js\";\nimport { DropPanel, type PanelProps } from \"./drop-panel.js\";\nimport { AccessFields, FieldError, LicenseFields, PriceFields, TimingFields } from \"./drop-fields.js\";\nimport { ExclusiveFields } from \"./exclusive-fields.js\";\nimport { priceLabel, toDropTerms, validateSale } from \"../../../utils/drop/sale.js\";\nimport { useDropFee } from \"../../../utils/use-drops.js\";\nimport { useT } from \"../../../i18n/provider.js\";\nimport { useFormat } from \"../../../i18n/use-format.js\";\n\nexport function SettingsPanel({ draft, setDraft, errors, open, onToggle }: PanelProps) {\n const t = useT();\n const intl = useFormat();\n const feeBps = useDropFee();\n const [licenseOpen, setLicenseOpen] = useState(false);\n const settings = errors.settings;\n const saleValid = Object.keys(validateSale(draft.sale, 0)).every((k) => k === \"start\");\n const terms = saleValid ? toDropTerms(draft.sale) : null;\n const price = terms ? priceLabel(terms.price, terms.paymentToken) : t(\"Set a price\");\n const start = draft.sale.startNow || !terms || terms.startTime === 0\n ? t(\"Starts at launch\")\n : t(\"Starts {date}\", { date: intl.dateTime(new Date(terms.startTime * 1000)) });\n const fields = { draft, setDraft, errors: settings };\n\n return (\n <DropPanel\n icon={<SlidersHorizontal />}\n title={t(\"Drop settings\")}\n open={open}\n onToggle={onToggle}\n error={Object.values(settings).find(Boolean)}\n summary={\n <span className=\"block space-y-0.5\">\n <span className=\"block\">{t(price)}</span>\n <span className=\"block\">{start}</span>\n {draft.listOnly && <span className=\"block\">{t(\"Wallet list\")}</span>}\n </span>\n }\n >\n <PriceFields {...fields} feeBps={feeBps} />\n <TimingFields {...fields} />\n <AccessFields {...fields} />\n <CollapsibleSection open={licenseOpen} onOpenChange={setLicenseOpen}\n icon={<ShieldCheck className=\"h-4 w-4 text-primary\" />}\n label={t(\"License terms\")} hint={t(\"For every asset\")}>\n <LicenseFields draft={draft} setDraft={setDraft} />\n </CollapsibleSection>\n <CollapsibleSection open={draft.gated.enabled}\n onOpenChange={(enabled) => setDraft({ gated: { ...draft.gated, enabled } })}\n icon={<Lock className=\"h-4 w-4 text-primary\" />}\n label={t(\"Exclusive content\")} hint={t(\"A private link for holders\")}>\n <ExclusiveFields value={draft.gated} onChange={(v) => setDraft({ gated: { ...draft.gated, ...v } })} />\n <FieldError message={settings.gated} />\n </CollapsibleSection>\n </DropPanel>\n );\n}\n"],"mappings":";AA6BY,cAMJ,YANI;AA3BZ,SAAS,gBAAgB;AACzB,SAAS,MAAM,aAAa,yBAAyB;AACrD,SAAS,0BAA0B;AACnC,SAAS,iBAAkC;AAC3C,SAAS,cAAc,YAAY,eAAe,aAAa,oBAAoB;AACnF,SAAS,uBAAuB;AAChC,SAAS,YAAY,aAAa,oBAAoB;AACtD,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAEnB,SAAS,cAAc,EAAE,OAAO,UAAU,QAAQ,MAAM,SAAS,GAAe;AACrF,QAAM,IAAI,KAAK;AACf,QAAM,OAAO,UAAU;AACvB,QAAM,SAAS,WAAW;AAC1B,QAAM,CAAC,aAAa,cAAc,IAAI,SAA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;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YAAmB,MAAM,MAAM,MAAM;AAAA,YACpC,cAAc,CAAC,YAAY,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,QAAQ,EAAE,CAAC;AAAA,YAC1E,MAAM,oBAAC,QAAK,WAAU,wBAAuB;AAAA,YAC7C,OAAO,EAAE,mBAAmB;AAAA,YAAG,MAAM,EAAE,4BAA4B;AAAA,YACnE;AAAA,kCAAC,mBAAgB,OAAO,MAAM,OAAO,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,GAAG,EAAE,EAAE,CAAC,GAAG;AAAA,cACrG,oBAAC,cAAW,SAAS,SAAS,OAAO;AAAA;AAAA;AAAA,QACvC;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
3
  import { FastMintProps } from './types.cjs';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
7
7
 
8
- declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
8
+ declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
9
9
 
10
10
  export { FastMint };
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
2
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
3
  import { FastMintProps } from './types.js';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
7
7
 
8
- declare function FastMint(props: FastMintProps): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
8
+ declare function FastMint(props: FastMintProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
9
9
 
10
10
  export { FastMint };
@@ -15,9 +15,8 @@ declare const editionMintSchema: z.ZodObject<{
15
15
  aiPolicy: z.ZodEnum<["Allowed", "Not Allowed", "Training Only"]>;
16
16
  royalty: z.ZodNumber;
17
17
  }, "strip", z.ZodTypeAny, {
18
- ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
19
18
  name: string;
20
- value: string;
19
+ ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
21
20
  licenseType: string;
22
21
  commercialUse: "Yes" | "No";
23
22
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
@@ -25,13 +24,13 @@ declare const editionMintSchema: z.ZodObject<{
25
24
  geographicScope: string;
26
25
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
27
26
  royalty: number;
27
+ value: string;
28
28
  recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
- ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
33
32
  name: string;
34
- value: string;
33
+ ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
35
34
  licenseType: string;
36
35
  commercialUse: "Yes" | "No";
37
36
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
@@ -39,6 +38,7 @@ declare const editionMintSchema: z.ZodObject<{
39
38
  geographicScope: string;
40
39
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
41
40
  royalty: number;
41
+ value: string;
42
42
  recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
@@ -15,9 +15,8 @@ declare const editionMintSchema: z.ZodObject<{
15
15
  aiPolicy: z.ZodEnum<["Allowed", "Not Allowed", "Training Only"]>;
16
16
  royalty: z.ZodNumber;
17
17
  }, "strip", z.ZodTypeAny, {
18
- ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
19
18
  name: string;
20
- value: string;
19
+ ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
21
20
  licenseType: string;
22
21
  commercialUse: "Yes" | "No";
23
22
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
@@ -25,13 +24,13 @@ declare const editionMintSchema: z.ZodObject<{
25
24
  geographicScope: string;
26
25
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
27
26
  royalty: number;
27
+ value: string;
28
28
  recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
- ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
33
32
  name: string;
34
- value: string;
33
+ ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "RWA" | "Posts" | "Publications" | "Documents";
35
34
  licenseType: string;
36
35
  commercialUse: "Yes" | "No";
37
36
  derivatives: "Allowed" | "Not Allowed" | "Share-Alike";
@@ -39,6 +38,7 @@ declare const editionMintSchema: z.ZodObject<{
39
38
  geographicScope: string;
40
39
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
41
40
  royalty: number;
41
+ value: string;
42
42
  recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
@@ -0,0 +1,85 @@
1
+ import { BuildAssetMetadataInput } from '@medialane/sdk';
2
+ import { SaleDraft, SaleErrors } from './utils/drop/sale.cjs';
3
+
4
+ declare const MAX_DROP_SUPPLY = 2000;
5
+ declare const MAX_DROP_METADATA_BYTES: number;
6
+ type DropKind = "edition" | "collection";
7
+ type DropLicense = Record<keyof Pick<BuildAssetMetadataInput, "ipType" | "licenseType" | "commercialUse" | "derivatives" | "attribution" | "geographicScope" | "aiPolicy" | "royalty">, string>;
8
+ interface DropMetadataInput {
9
+ name: string;
10
+ description: string;
11
+ externalUrl: string;
12
+ creator: string;
13
+ coverUri: string | null;
14
+ license: DropLicense;
15
+ assets: {
16
+ name: string;
17
+ description: string;
18
+ imageUri: string;
19
+ copies: number;
20
+ traits: DraftTrait[];
21
+ }[];
22
+ order: number[];
23
+ }
24
+ interface DropMetadataFile {
25
+ name: string;
26
+ content: unknown;
27
+ }
28
+ declare function tokenOrder(copies: number[], mix: boolean, random?: (n: number) => number): number[];
29
+ declare function buildDropMetadataFiles(input: DropMetadataInput): DropMetadataFile[];
30
+ declare function metadataBytes(files: DropMetadataFile[]): number;
31
+
32
+ interface DraftTrait {
33
+ key: string;
34
+ value: string;
35
+ }
36
+ interface DraftAsset {
37
+ id: string;
38
+ file: File;
39
+ name: string;
40
+ description: string;
41
+ copies: string;
42
+ traits: DraftTrait[];
43
+ }
44
+ interface DropDraft {
45
+ collection: {
46
+ name: string;
47
+ description: string;
48
+ externalUrl: string;
49
+ cover: File | null;
50
+ };
51
+ assets: DraftAsset[];
52
+ mixOrder: boolean;
53
+ sale: SaleDraft;
54
+ listOnly: boolean;
55
+ allowlist: string;
56
+ license: DropLicense;
57
+ gated: {
58
+ enabled: boolean;
59
+ title: string;
60
+ url: string;
61
+ type: string;
62
+ };
63
+ }
64
+ declare const EMPTY_DRAFT: DropDraft;
65
+ declare function newAsset(file: File): DraftAsset;
66
+ declare function dropSymbol(name: string): string;
67
+ declare function draftTokens(d: DropDraft): number;
68
+ type DropPanel = "collection" | "assets" | "settings";
69
+ type AssetErrors = Partial<Record<"copies" | "traits", string>>;
70
+ interface DropDraftErrors {
71
+ collection: Partial<Record<"name" | "externalUrl", string>>;
72
+ assets: {
73
+ list?: string;
74
+ byId: Record<string, AssetErrors>;
75
+ };
76
+ settings: SaleErrors & Partial<Record<"allowlist" | "gated", string>>;
77
+ }
78
+ declare function validateDropDraft(d: DropDraft, now: number): DropDraftErrors;
79
+ declare function firstMissing(e: DropDraftErrors): {
80
+ panel: DropPanel;
81
+ message: string;
82
+ } | null;
83
+ declare function hasErrors(e: DropDraftErrors): boolean;
84
+
85
+ export { type DraftAsset as D, EMPTY_DRAFT as E, MAX_DROP_METADATA_BYTES as M, type DropDraft as a, type DropDraftErrors as b, type DropKind as c, dropSymbol as d, type DropLicense as e, type DropMetadataFile as f, type DropMetadataInput as g, MAX_DROP_SUPPLY as h, buildDropMetadataFiles as i, type DraftTrait as j, type DropPanel as k, draftTokens as l, metadataBytes as m, firstMissing as n, hasErrors as o, newAsset as p, tokenOrder as t, validateDropDraft as v };
@@ -0,0 +1,85 @@
1
+ import { BuildAssetMetadataInput } from '@medialane/sdk';
2
+ import { SaleDraft, SaleErrors } from './utils/drop/sale.js';
3
+
4
+ declare const MAX_DROP_SUPPLY = 2000;
5
+ declare const MAX_DROP_METADATA_BYTES: number;
6
+ type DropKind = "edition" | "collection";
7
+ type DropLicense = Record<keyof Pick<BuildAssetMetadataInput, "ipType" | "licenseType" | "commercialUse" | "derivatives" | "attribution" | "geographicScope" | "aiPolicy" | "royalty">, string>;
8
+ interface DropMetadataInput {
9
+ name: string;
10
+ description: string;
11
+ externalUrl: string;
12
+ creator: string;
13
+ coverUri: string | null;
14
+ license: DropLicense;
15
+ assets: {
16
+ name: string;
17
+ description: string;
18
+ imageUri: string;
19
+ copies: number;
20
+ traits: DraftTrait[];
21
+ }[];
22
+ order: number[];
23
+ }
24
+ interface DropMetadataFile {
25
+ name: string;
26
+ content: unknown;
27
+ }
28
+ declare function tokenOrder(copies: number[], mix: boolean, random?: (n: number) => number): number[];
29
+ declare function buildDropMetadataFiles(input: DropMetadataInput): DropMetadataFile[];
30
+ declare function metadataBytes(files: DropMetadataFile[]): number;
31
+
32
+ interface DraftTrait {
33
+ key: string;
34
+ value: string;
35
+ }
36
+ interface DraftAsset {
37
+ id: string;
38
+ file: File;
39
+ name: string;
40
+ description: string;
41
+ copies: string;
42
+ traits: DraftTrait[];
43
+ }
44
+ interface DropDraft {
45
+ collection: {
46
+ name: string;
47
+ description: string;
48
+ externalUrl: string;
49
+ cover: File | null;
50
+ };
51
+ assets: DraftAsset[];
52
+ mixOrder: boolean;
53
+ sale: SaleDraft;
54
+ listOnly: boolean;
55
+ allowlist: string;
56
+ license: DropLicense;
57
+ gated: {
58
+ enabled: boolean;
59
+ title: string;
60
+ url: string;
61
+ type: string;
62
+ };
63
+ }
64
+ declare const EMPTY_DRAFT: DropDraft;
65
+ declare function newAsset(file: File): DraftAsset;
66
+ declare function dropSymbol(name: string): string;
67
+ declare function draftTokens(d: DropDraft): number;
68
+ type DropPanel = "collection" | "assets" | "settings";
69
+ type AssetErrors = Partial<Record<"copies" | "traits", string>>;
70
+ interface DropDraftErrors {
71
+ collection: Partial<Record<"name" | "externalUrl", string>>;
72
+ assets: {
73
+ list?: string;
74
+ byId: Record<string, AssetErrors>;
75
+ };
76
+ settings: SaleErrors & Partial<Record<"allowlist" | "gated", string>>;
77
+ }
78
+ declare function validateDropDraft(d: DropDraft, now: number): DropDraftErrors;
79
+ declare function firstMissing(e: DropDraftErrors): {
80
+ panel: DropPanel;
81
+ message: string;
82
+ } | null;
83
+ declare function hasErrors(e: DropDraftErrors): boolean;
84
+
85
+ export { type DraftAsset as D, EMPTY_DRAFT as E, MAX_DROP_METADATA_BYTES as M, type DropDraft as a, type DropDraftErrors as b, type DropKind as c, dropSymbol as d, type DropLicense as e, type DropMetadataFile as f, type DropMetadataInput as g, MAX_DROP_SUPPLY as h, buildDropMetadataFiles as i, type DraftTrait as j, type DropPanel as k, draftTokens as l, metadataBytes as m, firstMissing as n, hasErrors as o, newAsset as p, tokenOrder as t, validateDropDraft as v };