@medialane/ui 0.148.0 → 0.148.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.
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { M as MediaKind } from '../../types-BEsgYSTA.cjs';
2
+ import { MediaKind } from './types.cjs';
3
3
  import 'starknet';
4
4
  import '@medialane/sdk';
5
5
  import '@medialane/sdk/starknet';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { M as MediaKind } from '../../types-BEsgYSTA.js';
2
+ import { MediaKind } from './types.js';
3
3
  import 'starknet';
4
4
  import '@medialane/sdk';
5
5
  import '@medialane/sdk/starknet';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { F as FastMintProps } from '../../types-BEsgYSTA.cjs';
3
+ import { FastMintProps } from './types.cjs';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { F as FastMintProps } from '../../types-BEsgYSTA.js';
3
+ import { FastMintProps } from './types.js';
4
4
  import 'starknet';
5
5
  import '@medialane/sdk';
6
6
  import '@medialane/sdk/starknet';
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var mintable_collections_exports = {};
20
+ __export(mintable_collections_exports, {
21
+ collectionKey: () => collectionKey,
22
+ mintableCollections: () => mintableCollections
23
+ });
24
+ module.exports = __toCommonJS(mintable_collections_exports);
25
+ var import_sdk = require("@medialane/sdk");
26
+ function mintableCollections(assetType, collections) {
27
+ const service = assetType === "single" ? "mip-erc721" : "mip-erc1155";
28
+ return collections.filter((c) => (0, import_sdk.getService)(c.service)?.id === service);
29
+ }
30
+ function collectionKey(assetType) {
31
+ return assetType === "single" ? (c) => c.collectionId : (c) => c.contractAddress;
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ collectionKey,
36
+ mintableCollections
37
+ });
38
+ //# sourceMappingURL=mintable-collections.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/fast-mint/mintable-collections.ts"],"sourcesContent":["import type { ApiCollection } from \"@medialane/sdk\";\nimport { getService } from \"@medialane/sdk\";\n\nexport type MintAssetType = \"single\" | \"editions\";\n\n/**\n * Collections a creator can actually mint into, for the chosen asset type.\n *\n * Only collections a Medialane factory deployed qualify. An external ERC1155 a\n * creator happens to own cannot be minted into here, and offering it produces a\n * mint that is rejected downstream rather than an explanation up front.\n */\nexport function mintableCollections(\n assetType: MintAssetType,\n collections: ApiCollection[],\n): ApiCollection[] {\n const service = assetType === \"single\" ? \"mip-erc721\" : \"mip-erc1155\";\n return collections.filter((c) => getService(c.service)?.id === service);\n}\n\n/**\n * The field identifying a collection for the chosen asset type. ERC1155\n * collections carry no collectionId, so limited editions are keyed by contract\n * address; reading the wrong field yields null and looks like \"nothing chosen\".\n */\nexport function collectionKey(\n assetType: MintAssetType,\n): (c: ApiCollection) => string | null | undefined {\n return assetType === \"single\" ? (c) => c.collectionId : (c) => c.contractAddress;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAA2B;AAWpB,SAAS,oBACd,WACA,aACiB;AACjB,QAAM,UAAU,cAAc,WAAW,eAAe;AACxD,SAAO,YAAY,OAAO,CAAC,UAAM,uBAAW,EAAE,OAAO,GAAG,OAAO,OAAO;AACxE;AAOO,SAAS,cACd,WACiD;AACjD,SAAO,cAAc,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE;AACnE;","names":[]}
@@ -0,0 +1,19 @@
1
+ import { ApiCollection } from '@medialane/sdk';
2
+
3
+ type MintAssetType = "single" | "editions";
4
+ /**
5
+ * Collections a creator can actually mint into, for the chosen asset type.
6
+ *
7
+ * Only collections a Medialane factory deployed qualify. An external ERC1155 a
8
+ * creator happens to own cannot be minted into here, and offering it produces a
9
+ * mint that is rejected downstream rather than an explanation up front.
10
+ */
11
+ declare function mintableCollections(assetType: MintAssetType, collections: ApiCollection[]): ApiCollection[];
12
+ /**
13
+ * The field identifying a collection for the chosen asset type. ERC1155
14
+ * collections carry no collectionId, so limited editions are keyed by contract
15
+ * address; reading the wrong field yields null and looks like "nothing chosen".
16
+ */
17
+ declare function collectionKey(assetType: MintAssetType): (c: ApiCollection) => string | null | undefined;
18
+
19
+ export { type MintAssetType, collectionKey, mintableCollections };
@@ -0,0 +1,19 @@
1
+ import { ApiCollection } from '@medialane/sdk';
2
+
3
+ type MintAssetType = "single" | "editions";
4
+ /**
5
+ * Collections a creator can actually mint into, for the chosen asset type.
6
+ *
7
+ * Only collections a Medialane factory deployed qualify. An external ERC1155 a
8
+ * creator happens to own cannot be minted into here, and offering it produces a
9
+ * mint that is rejected downstream rather than an explanation up front.
10
+ */
11
+ declare function mintableCollections(assetType: MintAssetType, collections: ApiCollection[]): ApiCollection[];
12
+ /**
13
+ * The field identifying a collection for the chosen asset type. ERC1155
14
+ * collections carry no collectionId, so limited editions are keyed by contract
15
+ * address; reading the wrong field yields null and looks like "nothing chosen".
16
+ */
17
+ declare function collectionKey(assetType: MintAssetType): (c: ApiCollection) => string | null | undefined;
18
+
19
+ export { type MintAssetType, collectionKey, mintableCollections };
@@ -0,0 +1,13 @@
1
+ import { getService } from "@medialane/sdk";
2
+ function mintableCollections(assetType, collections) {
3
+ const service = assetType === "single" ? "mip-erc721" : "mip-erc1155";
4
+ return collections.filter((c) => getService(c.service)?.id === service);
5
+ }
6
+ function collectionKey(assetType) {
7
+ return assetType === "single" ? (c) => c.collectionId : (c) => c.contractAddress;
8
+ }
9
+ export {
10
+ collectionKey,
11
+ mintableCollections
12
+ };
13
+ //# sourceMappingURL=mintable-collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/fast-mint/mintable-collections.ts"],"sourcesContent":["import type { ApiCollection } from \"@medialane/sdk\";\nimport { getService } from \"@medialane/sdk\";\n\nexport type MintAssetType = \"single\" | \"editions\";\n\n/**\n * Collections a creator can actually mint into, for the chosen asset type.\n *\n * Only collections a Medialane factory deployed qualify. An external ERC1155 a\n * creator happens to own cannot be minted into here, and offering it produces a\n * mint that is rejected downstream rather than an explanation up front.\n */\nexport function mintableCollections(\n assetType: MintAssetType,\n collections: ApiCollection[],\n): ApiCollection[] {\n const service = assetType === \"single\" ? \"mip-erc721\" : \"mip-erc1155\";\n return collections.filter((c) => getService(c.service)?.id === service);\n}\n\n/**\n * The field identifying a collection for the chosen asset type. ERC1155\n * collections carry no collectionId, so limited editions are keyed by contract\n * address; reading the wrong field yields null and looks like \"nothing chosen\".\n */\nexport function collectionKey(\n assetType: MintAssetType,\n): (c: ApiCollection) => string | null | undefined {\n return assetType === \"single\" ? (c) => c.collectionId : (c) => c.contractAddress;\n}\n"],"mappings":"AACA,SAAS,kBAAkB;AAWpB,SAAS,oBACd,WACA,aACiB;AACjB,QAAM,UAAU,cAAc,WAAW,eAAe;AACxD,SAAO,YAAY,OAAO,CAAC,MAAM,WAAW,EAAE,OAAO,GAAG,OAAO,OAAO;AACxE;AAOO,SAAS,cACd,WACiD;AACjD,SAAO,cAAc,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE;AACnE;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as MintedAsset } from '../../types-BEsgYSTA.cjs';
2
+ import { MintedAsset } from './types.cjs';
3
3
  import 'starknet';
4
4
  import '@medialane/sdk';
5
5
  import '@medialane/sdk/starknet';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as MintedAsset } from '../../types-BEsgYSTA.js';
2
+ import { MintedAsset } from './types.js';
3
3
  import 'starknet';
4
4
  import '@medialane/sdk';
5
5
  import '@medialane/sdk/starknet';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/fast-mint/types.ts"],"sourcesContent":["import type { Call, TypedData } from \"starknet\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport type { MedialaneClient, ReceiptProvider } from \"@medialane/sdk/starknet\";\n\nexport type MediaKind = \"image\" | \"audio\" | \"video\" | \"document\";\n\nexport interface FastMintSigner {\n readonly address: string;\n execute(calls: Call[]): Promise<{ txHash: string }>;\n signTypedData(data: TypedData): Promise<string[]>;\n}\n\nexport interface MintedAsset {\n contract: string;\n tokenId: string;\n image: string | null;\n}\n\nexport interface FastMintProps {\n presentation?: \"inline\" | \"dialog\";\n open?: boolean;\n onClose?: () => void;\n\n mediaKindLock?: MediaKind;\n onMinted?: (asset: MintedAsset) => void;\n\n collections: ApiCollection[];\n refetchCollections: () => Promise<ApiCollection[]>;\n\n hasWallet: boolean;\n walletAddress: string | null;\n onRequireWallet: () => void;\n connectLabel?: string;\n getUploadToken: () => Promise<string | null>;\n getSigner: () => Promise<FastMintSigner> | FastMintSigner;\n client: MedialaneClient;\n provider: ReceiptProvider;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -33,4 +33,4 @@ interface FastMintProps {
33
33
  provider: ReceiptProvider;
34
34
  }
35
35
 
36
- export type { FastMintProps as F, MediaKind as M, FastMintSigner as a, MintedAsset as b };
36
+ export type { FastMintProps, FastMintSigner, MediaKind, MintedAsset };
@@ -33,4 +33,4 @@ interface FastMintProps {
33
33
  provider: ReceiptProvider;
34
34
  }
35
35
 
36
- export type { FastMintProps as F, MediaKind as M, FastMintSigner as a, MintedAsset as b };
36
+ export type { FastMintProps, FastMintSigner, MediaKind, MintedAsset };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.d.cts CHANGED
@@ -144,7 +144,7 @@ export { IPTypeFields, IPTypeFieldsProps, MetadataField } from './components/ip-
144
144
  export { FastMint } from './components/fast-mint/fast-mint.cjs';
145
145
  export { Dropzone, DropzoneProps } from './components/fast-mint/dropzone.cjs';
146
146
  export { SuccessView, SuccessViewProps } from './components/fast-mint/success-view.cjs';
147
- export { F as FastMintProps, a as FastMintSigner, M as MediaKind, b as MintedAsset } from './types-BEsgYSTA.cjs';
147
+ export { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from './components/fast-mint/types.cjs';
148
148
  export { CappedBody, readBodyWithCap } from './utils/proxy-body.cjs';
149
149
  export { FormattedEvent, formatActivity, formatAssetReceivedNotification, formatOfferAcceptedNotification, formatOrderNotification } from './utils/format-activity.cjs';
150
150
  export { QUERY_PREFIX, queryKeyPrefix, queryKeys } from './utils/query-keys.cjs';
package/dist/index.d.ts CHANGED
@@ -144,7 +144,7 @@ export { IPTypeFields, IPTypeFieldsProps, MetadataField } from './components/ip-
144
144
  export { FastMint } from './components/fast-mint/fast-mint.js';
145
145
  export { Dropzone, DropzoneProps } from './components/fast-mint/dropzone.js';
146
146
  export { SuccessView, SuccessViewProps } from './components/fast-mint/success-view.js';
147
- export { F as FastMintProps, a as FastMintSigner, M as MediaKind, b as MintedAsset } from './types-BEsgYSTA.js';
147
+ export { FastMintProps, FastMintSigner, MediaKind, MintedAsset } from './components/fast-mint/types.js';
148
148
  export { CappedBody, readBodyWithCap } from './utils/proxy-body.js';
149
149
  export { FormattedEvent, formatActivity, formatAssetReceivedNotification, formatOfferAcceptedNotification, formatOrderNotification } from './utils/format-activity.js';
150
150
  export { QUERY_PREFIX, queryKeyPrefix, queryKeys } from './utils/query-keys.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/ui",
3
- "version": "0.148.0",
3
+ "version": "0.148.1",
4
4
  "description": "Shared UI components for Medialane apps",
5
5
  "type": "module",
6
6
  "sideEffects": false,