@medialane/ui 0.374.0 → 0.374.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/accounts-page.cjs +1 -1
- package/dist/components/accounts-page.cjs.map +1 -1
- package/dist/components/accounts-page.js +1 -1
- package/dist/components/accounts-page.js.map +1 -1
- package/dist/components/activity-row.cjs +8 -7
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.js +8 -7
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/asset-access-cards.cjs +3 -1
- package/dist/components/asset-access-cards.cjs.map +1 -1
- package/dist/components/asset-access-cards.js +3 -1
- package/dist/components/asset-access-cards.js.map +1 -1
- package/dist/components/asset-type-panels.cjs +1 -1
- package/dist/components/asset-type-panels.cjs.map +1 -1
- package/dist/components/asset-type-panels.js +1 -1
- package/dist/components/asset-type-panels.js.map +1 -1
- package/dist/components/button.d.cts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/claim-route-shell.cjs +4 -2
- package/dist/components/claim-route-shell.cjs.map +1 -1
- package/dist/components/claim-route-shell.d.cts +1 -1
- package/dist/components/claim-route-shell.d.ts +1 -1
- package/dist/components/claim-route-shell.js +4 -2
- package/dist/components/claim-route-shell.js.map +1 -1
- package/dist/components/coin-guarantees.cjs +2 -2
- package/dist/components/coin-guarantees.cjs.map +1 -1
- package/dist/components/coin-guarantees.js +2 -2
- package/dist/components/coin-guarantees.js.map +1 -1
- package/dist/components/coins-explorer.cjs +1 -1
- package/dist/components/coins-explorer.cjs.map +1 -1
- package/dist/components/coins-explorer.js +1 -1
- package/dist/components/coins-explorer.js.map +1 -1
- package/dist/components/collection-filters.cjs +1 -1
- package/dist/components/collection-filters.cjs.map +1 -1
- package/dist/components/collection-filters.js +1 -1
- package/dist/components/collection-filters.js.map +1 -1
- package/dist/components/collection-provenance-tab.cjs +4 -3
- package/dist/components/collection-provenance-tab.cjs.map +1 -1
- package/dist/components/collection-provenance-tab.js +4 -3
- package/dist/components/collection-provenance-tab.js.map +1 -1
- package/dist/components/collection-settings.cjs +3 -3
- package/dist/components/collection-settings.cjs.map +1 -1
- package/dist/components/collection-settings.js +3 -3
- package/dist/components/collection-settings.js.map +1 -1
- package/dist/components/collection-showcase.cjs +1 -1
- package/dist/components/collection-showcase.cjs.map +1 -1
- package/dist/components/collection-showcase.js +1 -1
- package/dist/components/collection-showcase.js.map +1 -1
- package/dist/components/collections-page.cjs +2 -2
- package/dist/components/collections-page.cjs.map +1 -1
- package/dist/components/collections-page.js +2 -2
- package/dist/components/collections-page.js.map +1 -1
- package/dist/components/create-form-primitives.cjs +20 -1
- package/dist/components/create-form-primitives.cjs.map +1 -1
- package/dist/components/create-form-primitives.js +20 -1
- package/dist/components/create-form-primitives.js.map +1 -1
- package/dist/components/create-sponsorship-aside.cjs +6 -6
- package/dist/components/create-sponsorship-aside.cjs.map +1 -1
- package/dist/components/create-sponsorship-aside.js +6 -6
- package/dist/components/create-sponsorship-aside.js.map +1 -1
- package/dist/components/creator-header.cjs +5 -2
- package/dist/components/creator-header.cjs.map +1 -1
- package/dist/components/creator-header.js +5 -2
- package/dist/components/creator-header.js.map +1 -1
- package/dist/components/discover-collections-strip.cjs +6 -3
- package/dist/components/discover-collections-strip.cjs.map +1 -1
- package/dist/components/discover-collections-strip.js +6 -3
- package/dist/components/discover-collections-strip.js.map +1 -1
- package/dist/components/discover-community-section.cjs +5 -3
- package/dist/components/discover-community-section.cjs.map +1 -1
- package/dist/components/discover-community-section.js +5 -3
- package/dist/components/discover-community-section.js.map +1 -1
- package/dist/components/discover-features.cjs +2 -2
- package/dist/components/discover-features.cjs.map +1 -1
- package/dist/components/discover-features.js +2 -2
- package/dist/components/discover-features.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +3 -2
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.js +3 -2
- package/dist/components/discover-feed-section.js.map +1 -1
- package/dist/components/drop/create/artwork-section.d.cts +2 -0
- package/dist/components/drop/create/artwork-section.d.ts +2 -0
- package/dist/components/drop/create/details-section.d.cts +2 -0
- package/dist/components/drop/create/details-section.d.ts +2 -0
- package/dist/components/drop/create/drop-create.cjs +1 -1
- package/dist/components/drop/create/drop-create.cjs.map +1 -1
- package/dist/components/drop/create/drop-create.d.cts +2 -0
- package/dist/components/drop/create/drop-create.d.ts +2 -0
- package/dist/components/drop/create/drop-create.js +2 -2
- package/dist/components/drop/create/drop-create.js.map +1 -1
- package/dist/components/drop/create/launch-dialog.cjs +1 -1
- package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
- package/dist/components/drop/create/launch-dialog.d.cts +2 -0
- package/dist/components/drop/create/launch-dialog.d.ts +2 -0
- package/dist/components/drop/create/launch-dialog.js +2 -2
- package/dist/components/drop/create/launch-dialog.js.map +1 -1
- package/dist/components/drop/create/list-section.d.cts +2 -0
- package/dist/components/drop/create/list-section.d.ts +2 -0
- package/dist/components/drop/create/sale-section.d.cts +2 -0
- package/dist/components/drop/create/sale-section.d.ts +2 -0
- package/dist/components/drop/drop-features.cjs +8 -6
- package/dist/components/drop/drop-features.cjs.map +1 -1
- package/dist/components/drop/drop-features.js +8 -6
- package/dist/components/drop/drop-features.js.map +1 -1
- package/dist/components/drop/drop-listing.cjs +3 -3
- package/dist/components/drop/drop-listing.cjs.map +1 -1
- package/dist/components/drop/drop-listing.js +3 -3
- package/dist/components/drop/drop-listing.js.map +1 -1
- package/dist/components/drop/my-drops.cjs +1 -1
- package/dist/components/drop/my-drops.cjs.map +1 -1
- package/dist/components/drop/my-drops.js +1 -1
- package/dist/components/drop/my-drops.js.map +1 -1
- package/dist/components/drop/page/drop-manage.cjs +3 -3
- package/dist/components/drop/page/drop-manage.cjs.map +1 -1
- package/dist/components/drop/page/drop-manage.js +3 -3
- package/dist/components/drop/page/drop-manage.js.map +1 -1
- package/dist/components/drop-item-list.cjs +2 -2
- package/dist/components/drop-item-list.cjs.map +1 -1
- package/dist/components/drop-item-list.js +2 -2
- package/dist/components/drop-item-list.js.map +1 -1
- package/dist/components/empty-or-error.cjs +2 -2
- package/dist/components/empty-or-error.cjs.map +1 -1
- package/dist/components/empty-or-error.js +2 -2
- package/dist/components/empty-or-error.js.map +1 -1
- package/dist/components/fast-mint/dropzone.cjs +2 -2
- package/dist/components/fast-mint/dropzone.cjs.map +1 -1
- package/dist/components/fast-mint/dropzone.js +2 -2
- package/dist/components/fast-mint/dropzone.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/fast-mint/formats/nft.cjs +3 -3
- package/dist/components/fast-mint/formats/nft.cjs.map +1 -1
- package/dist/components/fast-mint/formats/nft.js +3 -3
- package/dist/components/fast-mint/formats/nft.js.map +1 -1
- package/dist/components/fast-mint/formats/pop.cjs +3 -3
- package/dist/components/fast-mint/formats/pop.cjs.map +1 -1
- package/dist/components/fast-mint/formats/pop.js +3 -3
- package/dist/components/fast-mint/formats/pop.js.map +1 -1
- package/dist/components/fast-mint/formats/tiers.cjs +5 -5
- package/dist/components/fast-mint/formats/tiers.cjs.map +1 -1
- package/dist/components/fast-mint/formats/tiers.js +5 -5
- package/dist/components/fast-mint/formats/tiers.js.map +1 -1
- package/dist/components/fast-mint/licensing-section.cjs +6 -27
- package/dist/components/fast-mint/licensing-section.cjs.map +1 -1
- package/dist/components/fast-mint/licensing-section.d.cts +1 -6
- package/dist/components/fast-mint/licensing-section.d.ts +1 -6
- package/dist/components/fast-mint/licensing-section.js +2 -22
- package/dist/components/fast-mint/licensing-section.js.map +1 -1
- package/dist/components/featured-carousel.cjs +3 -2
- package/dist/components/featured-carousel.cjs.map +1 -1
- package/dist/components/featured-carousel.js +3 -2
- package/dist/components/featured-carousel.js.map +1 -1
- package/dist/components/gated-content.cjs +1 -1
- package/dist/components/gated-content.cjs.map +1 -1
- package/dist/components/gated-content.js +1 -1
- package/dist/components/gated-content.js.map +1 -1
- package/dist/components/ip-type-badge.cjs +4 -2
- package/dist/components/ip-type-badge.cjs.map +1 -1
- package/dist/components/ip-type-badge.js +4 -2
- package/dist/components/ip-type-badge.js.map +1 -1
- package/dist/components/ip-type-nav.cjs +3 -2
- package/dist/components/ip-type-nav.cjs.map +1 -1
- package/dist/components/ip-type-nav.js +3 -2
- package/dist/components/ip-type-nav.js.map +1 -1
- package/dist/components/ip-type-page.cjs +2 -2
- package/dist/components/ip-type-page.cjs.map +1 -1
- package/dist/components/ip-type-page.js +2 -2
- package/dist/components/ip-type-page.js.map +1 -1
- package/dist/components/journey-content.cjs +1 -1
- package/dist/components/journey-content.cjs.map +1 -1
- package/dist/components/journey-content.js +1 -1
- package/dist/components/journey-content.js.map +1 -1
- package/dist/components/launchpad/coin-create.cjs +1 -1
- package/dist/components/launchpad/coin-create.cjs.map +1 -1
- package/dist/components/launchpad/coin-create.js +1 -1
- package/dist/components/launchpad/coin-create.js.map +1 -1
- package/dist/components/launchpad/collection-create-form.cjs +1 -1
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +1 -1
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-presets.js +1 -1
- package/dist/components/launchpad/collection-create-presets.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +4 -4
- package/dist/components/launchpad/edition-mint-schema.d.ts +4 -4
- package/dist/components/launchpad/edition-mint.cjs +1 -1
- package/dist/components/launchpad/edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint.js +1 -1
- package/dist/components/launchpad/edition-mint.js.map +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs +1 -1
- package/dist/components/launchpad/pop-create-fields.cjs.map +1 -1
- package/dist/components/launchpad/pop-create-fields.js +1 -1
- package/dist/components/launchpad/pop-create-fields.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs +1 -1
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +1 -1
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad-strip.cjs +3 -2
- package/dist/components/launchpad-strip.cjs.map +1 -1
- package/dist/components/launchpad-strip.js +3 -2
- package/dist/components/launchpad-strip.js.map +1 -1
- package/dist/components/marketplace-filters.cjs +2 -1
- package/dist/components/marketplace-filters.cjs.map +1 -1
- package/dist/components/marketplace-filters.js +2 -1
- package/dist/components/marketplace-filters.js.map +1 -1
- package/dist/components/new-collection-menu.cjs +5 -4
- package/dist/components/new-collection-menu.cjs.map +1 -1
- package/dist/components/new-collection-menu.js +5 -4
- package/dist/components/new-collection-menu.js.map +1 -1
- package/dist/components/order-sort-control.cjs +7 -4
- package/dist/components/order-sort-control.cjs.map +1 -1
- package/dist/components/order-sort-control.js +7 -4
- package/dist/components/order-sort-control.js.map +1 -1
- package/dist/components/portfolio-orders.cjs +16 -16
- package/dist/components/portfolio-orders.cjs.map +1 -1
- package/dist/components/portfolio-orders.js +16 -16
- package/dist/components/portfolio-orders.js.map +1 -1
- package/dist/components/price-history-chart.cjs +1 -1
- package/dist/components/price-history-chart.cjs.map +1 -1
- package/dist/components/price-history-chart.js +1 -1
- package/dist/components/price-history-chart.js.map +1 -1
- package/dist/components/report-dialog.cjs +1 -1
- package/dist/components/report-dialog.cjs.map +1 -1
- package/dist/components/report-dialog.js +1 -1
- package/dist/components/report-dialog.js.map +1 -1
- package/dist/components/rewards/level-badge.cjs +3 -1
- package/dist/components/rewards/level-badge.cjs.map +1 -1
- package/dist/components/rewards/level-badge.js +3 -1
- package/dist/components/rewards/level-badge.js.map +1 -1
- package/dist/components/rewards/rewards-dashboard.cjs +24 -24
- package/dist/components/rewards/rewards-dashboard.cjs.map +1 -1
- package/dist/components/rewards/rewards-dashboard.js +24 -24
- package/dist/components/rewards/rewards-dashboard.js.map +1 -1
- package/dist/components/rewards-section.cjs +5 -5
- package/dist/components/rewards-section.cjs.map +1 -1
- package/dist/components/rewards-section.js +5 -5
- package/dist/components/rewards-section.js.map +1 -1
- package/dist/components/section-heading.cjs +5 -2
- package/dist/components/section-heading.cjs.map +1 -1
- package/dist/components/section-heading.js +5 -2
- package/dist/components/section-heading.js.map +1 -1
- package/dist/components/sponsorship-offers-page.cjs +5 -4
- package/dist/components/sponsorship-offers-page.cjs.map +1 -1
- package/dist/components/sponsorship-offers-page.js +5 -4
- package/dist/components/sponsorship-offers-page.js.map +1 -1
- package/dist/components/transaction-dialog.cjs +1 -1
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.js +1 -1
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/components/transfer-collection-ownership.cjs +1 -1
- package/dist/components/transfer-collection-ownership.cjs.map +1 -1
- package/dist/components/transfer-collection-ownership.js +1 -1
- package/dist/components/transfer-collection-ownership.js.map +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.cjs +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.cjs.map +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.js +1 -1
- package/dist/components/wallet/self-fund-consent-dialog.js.map +1 -1
- package/dist/data/launchpad-services.cjs +1 -1
- package/dist/data/launchpad-services.cjs.map +1 -1
- package/dist/data/launchpad-services.js +1 -1
- package/dist/data/launchpad-services.js.map +1 -1
- package/dist/i18n/catalog/pt.cjs +110 -0
- package/dist/i18n/catalog/pt.cjs.map +1 -1
- package/dist/i18n/catalog/pt.js +110 -0
- package/dist/i18n/catalog/pt.js.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/utils/drop/draft.cjs +5 -0
- package/dist/utils/drop/draft.cjs.map +1 -1
- package/dist/utils/drop/draft.d.cts +4 -1
- package/dist/utils/drop/draft.d.ts +4 -1
- package/dist/utils/drop/draft.js +4 -0
- package/dist/utils/drop/draft.js.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -323,11 +323,11 @@ import 'input-otp';
|
|
|
323
323
|
import 'react-hook-form';
|
|
324
324
|
import 'zod';
|
|
325
325
|
import './utils/drop/draft.cjs';
|
|
326
|
+
import './i18n/make-t.cjs';
|
|
327
|
+
import './i18n/translate.cjs';
|
|
326
328
|
import './utils/drop/metadata.cjs';
|
|
327
329
|
import './utils/drop/sale.cjs';
|
|
328
330
|
import 'starknet';
|
|
329
|
-
import './i18n/make-t.cjs';
|
|
330
|
-
import './i18n/translate.cjs';
|
|
331
331
|
import 'class-variance-authority/types';
|
|
332
332
|
import 'class-variance-authority';
|
|
333
333
|
import '@radix-ui/react-label';
|
package/dist/index.d.ts
CHANGED
|
@@ -323,11 +323,11 @@ import 'input-otp';
|
|
|
323
323
|
import 'react-hook-form';
|
|
324
324
|
import 'zod';
|
|
325
325
|
import './utils/drop/draft.js';
|
|
326
|
+
import './i18n/make-t.js';
|
|
327
|
+
import './i18n/translate.js';
|
|
326
328
|
import './utils/drop/metadata.js';
|
|
327
329
|
import './utils/drop/sale.js';
|
|
328
330
|
import 'starknet';
|
|
329
|
-
import './i18n/make-t.js';
|
|
330
|
-
import './i18n/translate.js';
|
|
331
331
|
import 'class-variance-authority/types';
|
|
332
332
|
import 'class-variance-authority';
|
|
333
333
|
import '@radix-ui/react-label';
|
|
@@ -20,6 +20,7 @@ var draft_exports = {};
|
|
|
20
20
|
__export(draft_exports, {
|
|
21
21
|
EMPTY_DRAFT: () => EMPTY_DRAFT,
|
|
22
22
|
draftSupply: () => draftSupply,
|
|
23
|
+
supplyLabel: () => supplyLabel,
|
|
23
24
|
validateDropDraft: () => validateDropDraft
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(draft_exports);
|
|
@@ -80,10 +81,14 @@ function validateDropDraft(d, now) {
|
|
|
80
81
|
if (d.gated.enabled && !/^https:\/\//.test(d.gated.url)) e.gated = "Add a link starting with https://";
|
|
81
82
|
return e;
|
|
82
83
|
}
|
|
84
|
+
function supplyLabel(t, kind, supply, formatted) {
|
|
85
|
+
return kind === "edition" ? t.plural("{count} copy", "{count} copies", supply, { count: formatted }) : t.plural("{count} item", "{count} items", supply, { count: formatted });
|
|
86
|
+
}
|
|
83
87
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
88
|
0 && (module.exports = {
|
|
85
89
|
EMPTY_DRAFT,
|
|
86
90
|
draftSupply,
|
|
91
|
+
supplyLabel,
|
|
87
92
|
validateDropDraft
|
|
88
93
|
});
|
|
89
94
|
//# sourceMappingURL=draft.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/drop/draft.ts"],"sourcesContent":["import type { DraftItem } from \"../../components/drop-item-list.js\";\nimport { isPositiveInteger, isSymbol } from \"../launchpad-rules.js\";\nimport { parseAllowlist } from \"./allowlist.js\";\nimport { MAX_DROP_SUPPLY, type DropKind, type DropLicense } from \"./metadata.js\";\nimport { EMPTY_SALE, validateSale, type SaleDraft, type SaleErrors } from \"./sale.js\";\nimport { formatNumber } from \"../../i18n/format.js\";\n\nexport interface DropDraft {\n kind: DropKind;\n edition: File | null;\n supply: string;\n items: DraftItem[];\n cover: File | null;\n name: string;\n symbol: string;\n description: string;\n license: DropLicense;\n sale: SaleDraft;\n listOnly: boolean;\n allowlist: string;\n gated: { enabled: boolean; title: string; url: string; type: string };\n}\n\nexport const EMPTY_DRAFT: DropDraft = {\n kind: \"edition\",\n edition: null,\n supply: \"100\",\n items: [],\n cover: null,\n name: \"\",\n symbol: \"\",\n description: \"\",\n license: {\n ipType: \"Art\", licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Allowed\", royalty: \"0\",\n },\n sale: EMPTY_SALE,\n listOnly: false,\n allowlist: \"\",\n gated: { enabled: false, title: \"\", url: \"\", type: \"\" },\n};\n\nexport type DropDraftErrors = SaleErrors & Partial<Record<\"artwork\" | \"supply\" | \"name\" | \"symbol\" | \"allowlist\" | \"gated\", string>>;\n\nexport function draftSupply(d: DropDraft): number {\n return d.kind === \"edition\" ? Number(d.supply) : d.items.length;\n}\n\nconst thousands = formatNumber(MAX_DROP_SUPPLY);\n\nexport function validateDropDraft(d: DropDraft, now: number): DropDraftErrors {\n const e: DropDraftErrors = { ...validateSale(d.sale, now) };\n if (d.kind === \"edition\") {\n if (!d.edition) e.artwork = \"Add the artwork\";\n if (!isPositiveInteger(d.supply) || Number(d.supply) > MAX_DROP_SUPPLY) e.supply = `Enter a supply from 1 to ${thousands}`;\n } else if (d.items.length === 0) {\n e.artwork = \"Add at least one item\";\n } else if (d.items.length > MAX_DROP_SUPPLY) {\n e.artwork = `A collection holds up to ${thousands} items`;\n }\n if (!d.name.trim()) e.name = \"Name your drop\";\n if (!isSymbol(d.symbol)) e.symbol = \"Use 1–10 capital letters or digits\";\n if (d.listOnly) {\n const list = parseAllowlist(d.allowlist);\n if (list.invalid.length > 0) {\n const n = list.invalid.length;\n e.allowlist = `${n} line${n === 1 ? \" isn't a wallet address\" : \"s aren't wallet addresses\"}: ${list.invalid.slice(0, 3).join(\", \")}`;\n } else if (list.addresses.length === 0) {\n e.allowlist = \"Add at least one wallet address\";\n }\n }\n if (d.gated.enabled && !/^https:\\/\\//.test(d.gated.url)) e.gated = \"Add a link starting with https://\";\n return e;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/drop/draft.ts"],"sourcesContent":["import type { T } from \"../../i18n/make-t.js\";\nimport type { DraftItem } from \"../../components/drop-item-list.js\";\nimport { isPositiveInteger, isSymbol } from \"../launchpad-rules.js\";\nimport { parseAllowlist } from \"./allowlist.js\";\nimport { MAX_DROP_SUPPLY, type DropKind, type DropLicense } from \"./metadata.js\";\nimport { EMPTY_SALE, validateSale, type SaleDraft, type SaleErrors } from \"./sale.js\";\nimport { formatNumber } from \"../../i18n/format.js\";\n\nexport interface DropDraft {\n kind: DropKind;\n edition: File | null;\n supply: string;\n items: DraftItem[];\n cover: File | null;\n name: string;\n symbol: string;\n description: string;\n license: DropLicense;\n sale: SaleDraft;\n listOnly: boolean;\n allowlist: string;\n gated: { enabled: boolean; title: string; url: string; type: string };\n}\n\nexport const EMPTY_DRAFT: DropDraft = {\n kind: \"edition\",\n edition: null,\n supply: \"100\",\n items: [],\n cover: null,\n name: \"\",\n symbol: \"\",\n description: \"\",\n license: {\n ipType: \"Art\", licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Allowed\", royalty: \"0\",\n },\n sale: EMPTY_SALE,\n listOnly: false,\n allowlist: \"\",\n gated: { enabled: false, title: \"\", url: \"\", type: \"\" },\n};\n\nexport type DropDraftErrors = SaleErrors & Partial<Record<\"artwork\" | \"supply\" | \"name\" | \"symbol\" | \"allowlist\" | \"gated\", string>>;\n\nexport function draftSupply(d: DropDraft): number {\n return d.kind === \"edition\" ? Number(d.supply) : d.items.length;\n}\n\nconst thousands = formatNumber(MAX_DROP_SUPPLY);\n\nexport function validateDropDraft(d: DropDraft, now: number): DropDraftErrors {\n const e: DropDraftErrors = { ...validateSale(d.sale, now) };\n if (d.kind === \"edition\") {\n if (!d.edition) e.artwork = \"Add the artwork\";\n if (!isPositiveInteger(d.supply) || Number(d.supply) > MAX_DROP_SUPPLY) e.supply = `Enter a supply from 1 to ${thousands}`;\n } else if (d.items.length === 0) {\n e.artwork = \"Add at least one item\";\n } else if (d.items.length > MAX_DROP_SUPPLY) {\n e.artwork = `A collection holds up to ${thousands} items`;\n }\n if (!d.name.trim()) e.name = \"Name your drop\";\n if (!isSymbol(d.symbol)) e.symbol = \"Use 1–10 capital letters or digits\";\n if (d.listOnly) {\n const list = parseAllowlist(d.allowlist);\n if (list.invalid.length > 0) {\n const n = list.invalid.length;\n e.allowlist = `${n} line${n === 1 ? \" isn't a wallet address\" : \"s aren't wallet addresses\"}: ${list.invalid.slice(0, 3).join(\", \")}`;\n } else if (list.addresses.length === 0) {\n e.allowlist = \"Add at least one wallet address\";\n }\n }\n if (d.gated.enabled && !/^https:\\/\\//.test(d.gated.url)) e.gated = \"Add a link starting with https://\";\n return e;\n}\n\nexport function supplyLabel(t: T, kind: DropKind, supply: number, formatted: string): string {\n return kind === \"edition\"\n ? t.plural(\"{count} copy\", \"{count} copies\", supply, { count: formatted })\n : t.plural(\"{count} item\", \"{count} items\", supply, { count: formatted });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,6BAA4C;AAC5C,uBAA+B;AAC/B,sBAAiE;AACjE,kBAA0E;AAC1E,oBAA6B;AAkBtB,MAAM,cAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO,CAAC;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AAAA,IACP,QAAQ;AAAA,IAAO,aAAa;AAAA,IAAY,eAAe;AAAA,IAAO,aAAa;AAAA,IAC3E,aAAa;AAAA,IAAY,iBAAiB;AAAA,IAAa,UAAU;AAAA,IAAW,SAAS;AAAA,EACvF;AAAA,EACA,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO,EAAE,SAAS,OAAO,OAAO,IAAI,KAAK,IAAI,MAAM,GAAG;AACxD;AAIO,SAAS,YAAY,GAAsB;AAChD,SAAO,EAAE,SAAS,YAAY,OAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC3D;AAEA,MAAM,gBAAY,4BAAa,+BAAe;AAEvC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../../i18n/make-t.cjs';
|
|
1
2
|
import { DraftItem } from '../../components/drop-item-list.cjs';
|
|
2
3
|
import { DropKind, DropLicense } from './metadata.cjs';
|
|
3
4
|
import { SaleDraft, SaleErrors } from './sale.cjs';
|
|
5
|
+
import '../../i18n/translate.cjs';
|
|
4
6
|
import 'react/jsx-runtime';
|
|
5
7
|
import '@medialane/sdk';
|
|
6
8
|
|
|
@@ -28,5 +30,6 @@ declare const EMPTY_DRAFT: DropDraft;
|
|
|
28
30
|
type DropDraftErrors = SaleErrors & Partial<Record<"artwork" | "supply" | "name" | "symbol" | "allowlist" | "gated", string>>;
|
|
29
31
|
declare function draftSupply(d: DropDraft): number;
|
|
30
32
|
declare function validateDropDraft(d: DropDraft, now: number): DropDraftErrors;
|
|
33
|
+
declare function supplyLabel(t: T, kind: DropKind, supply: number, formatted: string): string;
|
|
31
34
|
|
|
32
|
-
export { type DropDraft, type DropDraftErrors, EMPTY_DRAFT, draftSupply, validateDropDraft };
|
|
35
|
+
export { type DropDraft, type DropDraftErrors, EMPTY_DRAFT, draftSupply, supplyLabel, validateDropDraft };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { T } from '../../i18n/make-t.js';
|
|
1
2
|
import { DraftItem } from '../../components/drop-item-list.js';
|
|
2
3
|
import { DropKind, DropLicense } from './metadata.js';
|
|
3
4
|
import { SaleDraft, SaleErrors } from './sale.js';
|
|
5
|
+
import '../../i18n/translate.js';
|
|
4
6
|
import 'react/jsx-runtime';
|
|
5
7
|
import '@medialane/sdk';
|
|
6
8
|
|
|
@@ -28,5 +30,6 @@ declare const EMPTY_DRAFT: DropDraft;
|
|
|
28
30
|
type DropDraftErrors = SaleErrors & Partial<Record<"artwork" | "supply" | "name" | "symbol" | "allowlist" | "gated", string>>;
|
|
29
31
|
declare function draftSupply(d: DropDraft): number;
|
|
30
32
|
declare function validateDropDraft(d: DropDraft, now: number): DropDraftErrors;
|
|
33
|
+
declare function supplyLabel(t: T, kind: DropKind, supply: number, formatted: string): string;
|
|
31
34
|
|
|
32
|
-
export { type DropDraft, type DropDraftErrors, EMPTY_DRAFT, draftSupply, validateDropDraft };
|
|
35
|
+
export { type DropDraft, type DropDraftErrors, EMPTY_DRAFT, draftSupply, supplyLabel, validateDropDraft };
|
package/dist/utils/drop/draft.js
CHANGED
|
@@ -55,9 +55,13 @@ function validateDropDraft(d, now) {
|
|
|
55
55
|
if (d.gated.enabled && !/^https:\/\//.test(d.gated.url)) e.gated = "Add a link starting with https://";
|
|
56
56
|
return e;
|
|
57
57
|
}
|
|
58
|
+
function supplyLabel(t, kind, supply, formatted) {
|
|
59
|
+
return kind === "edition" ? t.plural("{count} copy", "{count} copies", supply, { count: formatted }) : t.plural("{count} item", "{count} items", supply, { count: formatted });
|
|
60
|
+
}
|
|
58
61
|
export {
|
|
59
62
|
EMPTY_DRAFT,
|
|
60
63
|
draftSupply,
|
|
64
|
+
supplyLabel,
|
|
61
65
|
validateDropDraft
|
|
62
66
|
};
|
|
63
67
|
//# sourceMappingURL=draft.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/drop/draft.ts"],"sourcesContent":["import type { DraftItem } from \"../../components/drop-item-list.js\";\nimport { isPositiveInteger, isSymbol } from \"../launchpad-rules.js\";\nimport { parseAllowlist } from \"./allowlist.js\";\nimport { MAX_DROP_SUPPLY, type DropKind, type DropLicense } from \"./metadata.js\";\nimport { EMPTY_SALE, validateSale, type SaleDraft, type SaleErrors } from \"./sale.js\";\nimport { formatNumber } from \"../../i18n/format.js\";\n\nexport interface DropDraft {\n kind: DropKind;\n edition: File | null;\n supply: string;\n items: DraftItem[];\n cover: File | null;\n name: string;\n symbol: string;\n description: string;\n license: DropLicense;\n sale: SaleDraft;\n listOnly: boolean;\n allowlist: string;\n gated: { enabled: boolean; title: string; url: string; type: string };\n}\n\nexport const EMPTY_DRAFT: DropDraft = {\n kind: \"edition\",\n edition: null,\n supply: \"100\",\n items: [],\n cover: null,\n name: \"\",\n symbol: \"\",\n description: \"\",\n license: {\n ipType: \"Art\", licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Allowed\", royalty: \"0\",\n },\n sale: EMPTY_SALE,\n listOnly: false,\n allowlist: \"\",\n gated: { enabled: false, title: \"\", url: \"\", type: \"\" },\n};\n\nexport type DropDraftErrors = SaleErrors & Partial<Record<\"artwork\" | \"supply\" | \"name\" | \"symbol\" | \"allowlist\" | \"gated\", string>>;\n\nexport function draftSupply(d: DropDraft): number {\n return d.kind === \"edition\" ? Number(d.supply) : d.items.length;\n}\n\nconst thousands = formatNumber(MAX_DROP_SUPPLY);\n\nexport function validateDropDraft(d: DropDraft, now: number): DropDraftErrors {\n const e: DropDraftErrors = { ...validateSale(d.sale, now) };\n if (d.kind === \"edition\") {\n if (!d.edition) e.artwork = \"Add the artwork\";\n if (!isPositiveInteger(d.supply) || Number(d.supply) > MAX_DROP_SUPPLY) e.supply = `Enter a supply from 1 to ${thousands}`;\n } else if (d.items.length === 0) {\n e.artwork = \"Add at least one item\";\n } else if (d.items.length > MAX_DROP_SUPPLY) {\n e.artwork = `A collection holds up to ${thousands} items`;\n }\n if (!d.name.trim()) e.name = \"Name your drop\";\n if (!isSymbol(d.symbol)) e.symbol = \"Use 1–10 capital letters or digits\";\n if (d.listOnly) {\n const list = parseAllowlist(d.allowlist);\n if (list.invalid.length > 0) {\n const n = list.invalid.length;\n e.allowlist = `${n} line${n === 1 ? \" isn't a wallet address\" : \"s aren't wallet addresses\"}: ${list.invalid.slice(0, 3).join(\", \")}`;\n } else if (list.addresses.length === 0) {\n e.allowlist = \"Add at least one wallet address\";\n }\n }\n if (d.gated.enabled && !/^https:\\/\\//.test(d.gated.url)) e.gated = \"Add a link starting with https://\";\n return e;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/drop/draft.ts"],"sourcesContent":["import type { T } from \"../../i18n/make-t.js\";\nimport type { DraftItem } from \"../../components/drop-item-list.js\";\nimport { isPositiveInteger, isSymbol } from \"../launchpad-rules.js\";\nimport { parseAllowlist } from \"./allowlist.js\";\nimport { MAX_DROP_SUPPLY, type DropKind, type DropLicense } from \"./metadata.js\";\nimport { EMPTY_SALE, validateSale, type SaleDraft, type SaleErrors } from \"./sale.js\";\nimport { formatNumber } from \"../../i18n/format.js\";\n\nexport interface DropDraft {\n kind: DropKind;\n edition: File | null;\n supply: string;\n items: DraftItem[];\n cover: File | null;\n name: string;\n symbol: string;\n description: string;\n license: DropLicense;\n sale: SaleDraft;\n listOnly: boolean;\n allowlist: string;\n gated: { enabled: boolean; title: string; url: string; type: string };\n}\n\nexport const EMPTY_DRAFT: DropDraft = {\n kind: \"edition\",\n edition: null,\n supply: \"100\",\n items: [],\n cover: null,\n name: \"\",\n symbol: \"\",\n description: \"\",\n license: {\n ipType: \"Art\", licenseType: \"CC BY-SA\", commercialUse: \"Yes\", derivatives: \"Share-Alike\",\n attribution: \"Required\", geographicScope: \"Worldwide\", aiPolicy: \"Allowed\", royalty: \"0\",\n },\n sale: EMPTY_SALE,\n listOnly: false,\n allowlist: \"\",\n gated: { enabled: false, title: \"\", url: \"\", type: \"\" },\n};\n\nexport type DropDraftErrors = SaleErrors & Partial<Record<\"artwork\" | \"supply\" | \"name\" | \"symbol\" | \"allowlist\" | \"gated\", string>>;\n\nexport function draftSupply(d: DropDraft): number {\n return d.kind === \"edition\" ? Number(d.supply) : d.items.length;\n}\n\nconst thousands = formatNumber(MAX_DROP_SUPPLY);\n\nexport function validateDropDraft(d: DropDraft, now: number): DropDraftErrors {\n const e: DropDraftErrors = { ...validateSale(d.sale, now) };\n if (d.kind === \"edition\") {\n if (!d.edition) e.artwork = \"Add the artwork\";\n if (!isPositiveInteger(d.supply) || Number(d.supply) > MAX_DROP_SUPPLY) e.supply = `Enter a supply from 1 to ${thousands}`;\n } else if (d.items.length === 0) {\n e.artwork = \"Add at least one item\";\n } else if (d.items.length > MAX_DROP_SUPPLY) {\n e.artwork = `A collection holds up to ${thousands} items`;\n }\n if (!d.name.trim()) e.name = \"Name your drop\";\n if (!isSymbol(d.symbol)) e.symbol = \"Use 1–10 capital letters or digits\";\n if (d.listOnly) {\n const list = parseAllowlist(d.allowlist);\n if (list.invalid.length > 0) {\n const n = list.invalid.length;\n e.allowlist = `${n} line${n === 1 ? \" isn't a wallet address\" : \"s aren't wallet addresses\"}: ${list.invalid.slice(0, 3).join(\", \")}`;\n } else if (list.addresses.length === 0) {\n e.allowlist = \"Add at least one wallet address\";\n }\n }\n if (d.gated.enabled && !/^https:\\/\\//.test(d.gated.url)) e.gated = \"Add a link starting with https://\";\n return e;\n}\n\nexport function supplyLabel(t: T, kind: DropKind, supply: number, formatted: string): string {\n return kind === \"edition\"\n ? t.plural(\"{count} copy\", \"{count} copies\", supply, { count: formatted })\n : t.plural(\"{count} item\", \"{count} items\", supply, { count: formatted });\n}\n"],"mappings":"AAEA,SAAS,mBAAmB,gBAAgB;AAC5C,SAAS,sBAAsB;AAC/B,SAAS,uBAAwD;AACjE,SAAS,YAAY,oBAAqD;AAC1E,SAAS,oBAAoB;AAkBtB,MAAM,cAAyB;AAAA,EACpC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO,CAAC;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AAAA,IACP,QAAQ;AAAA,IAAO,aAAa;AAAA,IAAY,eAAe;AAAA,IAAO,aAAa;AAAA,IAC3E,aAAa;AAAA,IAAY,iBAAiB;AAAA,IAAa,UAAU;AAAA,IAAW,SAAS;AAAA,EACvF;AAAA,EACA,MAAM;AAAA,EACN,UAAU;AAAA,EACV,WAAW;AAAA,EACX,OAAO,EAAE,SAAS,OAAO,OAAO,IAAI,KAAK,IAAI,MAAM,GAAG;AACxD;AAIO,SAAS,YAAY,GAAsB;AAChD,SAAO,EAAE,SAAS,YAA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AAO,UAAU,CAAC;AAC5E;","names":[]}
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 8 | 6 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ declare function useTokenBalance(symbol: string | null, holderAddress: string |
|
|
|
7
7
|
rawBalance: bigint | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
error: any;
|
|
10
|
-
decimals:
|
|
10
|
+
decimals: 8 | 6 | 18;
|
|
11
11
|
};
|
|
12
12
|
declare function hasSufficientBalance(rawBalance: bigint | null, requiredHuman: string, decimals: number): boolean | null;
|
|
13
13
|
|