@medialane/ui 0.107.1 → 0.108.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/remixes-tab.cjs +91 -0
- package/dist/components/remixes-tab.cjs.map +1 -0
- package/dist/components/remixes-tab.d.cts +11 -0
- package/dist/components/remixes-tab.d.ts +11 -0
- package/dist/components/remixes-tab.js +57 -0
- package/dist/components/remixes-tab.js.map +1 -0
- package/dist/data/notification.cjs +17 -0
- package/dist/data/notification.cjs.map +1 -0
- package/dist/data/notification.d.cts +34 -0
- package/dist/data/notification.d.ts +34 -0
- package/dist/data/notification.js +1 -0
- package/dist/data/notification.js.map +1 -0
- package/dist/index.cjs +31 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/api-fetch.cjs +65 -0
- package/dist/utils/api-fetch.cjs.map +1 -0
- package/dist/utils/api-fetch.d.cts +38 -0
- package/dist/utils/api-fetch.d.ts +38 -0
- package/dist/utils/api-fetch.js +40 -0
- package/dist/utils/api-fetch.js.map +1 -0
- package/dist/utils/use-notifications.cjs +169 -0
- package/dist/utils/use-notifications.cjs.map +1 -0
- package/dist/utils/use-notifications.d.cts +12 -0
- package/dist/utils/use-notifications.d.ts +12 -0
- package/dist/utils/use-notifications.js +140 -0
- package/dist/utils/use-notifications.js.map +1 -0
- package/dist/utils/use-orders.cjs +153 -0
- package/dist/utils/use-orders.cjs.map +1 -0
- package/dist/utils/use-orders.d.cts +55 -0
- package/dist/utils/use-orders.d.ts +55 -0
- package/dist/utils/use-orders.js +113 -0
- package/dist/utils/use-orders.js.map +1 -0
- package/dist/utils/use-remix-offers.cjs +49 -0
- package/dist/utils/use-remix-offers.cjs.map +1 -0
- package/dist/utils/use-remix-offers.d.cts +19 -0
- package/dist/utils/use-remix-offers.d.ts +19 -0
- package/dist/utils/use-remix-offers.js +15 -0
- package/dist/utils/use-remix-offers.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as swr from 'swr';
|
|
2
|
+
import { ApiFetchConfig } from './api-fetch.cjs';
|
|
3
|
+
import { ApiPublicRemix } from '@medialane/sdk';
|
|
4
|
+
|
|
5
|
+
/** Public remixes of a token — no wallet/auth dependency. */
|
|
6
|
+
declare function useTokenRemixes(apiConfig: ApiFetchConfig, contract: string | null, tokenId: string | null): {
|
|
7
|
+
remixes: ApiPublicRemix[];
|
|
8
|
+
total: number;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: any;
|
|
11
|
+
mutate: swr.KeyedMutator<{
|
|
12
|
+
data: ApiPublicRemix[];
|
|
13
|
+
meta: {
|
|
14
|
+
total: number;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { useTokenRemixes };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as swr from 'swr';
|
|
2
|
+
import { ApiFetchConfig } from './api-fetch.js';
|
|
3
|
+
import { ApiPublicRemix } from '@medialane/sdk';
|
|
4
|
+
|
|
5
|
+
/** Public remixes of a token — no wallet/auth dependency. */
|
|
6
|
+
declare function useTokenRemixes(apiConfig: ApiFetchConfig, contract: string | null, tokenId: string | null): {
|
|
7
|
+
remixes: ApiPublicRemix[];
|
|
8
|
+
total: number;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: any;
|
|
11
|
+
mutate: swr.KeyedMutator<{
|
|
12
|
+
data: ApiPublicRemix[];
|
|
13
|
+
meta: {
|
|
14
|
+
total: number;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { useTokenRemixes };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import useSWR from "swr";
|
|
3
|
+
import { apiFetch } from "./api-fetch.js";
|
|
4
|
+
function useTokenRemixes(apiConfig, contract, tokenId) {
|
|
5
|
+
const { data, error, isLoading, mutate } = useSWR(
|
|
6
|
+
contract && tokenId ? `token-remixes-${contract}-${tokenId}` : null,
|
|
7
|
+
() => apiFetch(apiConfig, `/v1/tokens/${contract}/${tokenId}/remixes`),
|
|
8
|
+
{ refreshInterval: 6e4, revalidateOnFocus: false }
|
|
9
|
+
);
|
|
10
|
+
return { remixes: data?.data ?? [], total: data?.meta.total ?? 0, isLoading, error, mutate };
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
useTokenRemixes
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=use-remix-offers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-remix-offers.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { apiFetch, type ApiFetchConfig } from \"./api-fetch.js\";\nimport type { ApiPublicRemix } from \"@medialane/sdk\";\n\n/** Public remixes of a token — no wallet/auth dependency. */\nexport function useTokenRemixes(apiConfig: ApiFetchConfig, contract: string | null, tokenId: string | null) {\n const { data, error, isLoading, mutate } = useSWR<{ data: ApiPublicRemix[]; meta: { total: number } }>(\n contract && tokenId ? `token-remixes-${contract}-${tokenId}` : null,\n () => apiFetch(apiConfig, `/v1/tokens/${contract}/${tokenId}/remixes`),\n { refreshInterval: 60000, revalidateOnFocus: false }\n );\n\n return { remixes: data?.data ?? [], total: data?.meta.total ?? 0, isLoading, error, mutate };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AACnB,SAAS,gBAAqC;AAIvC,SAAS,gBAAgB,WAA2B,UAAyB,SAAwB;AAC1G,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,YAAY,UAAU,iBAAiB,QAAQ,IAAI,OAAO,KAAK;AAAA,IAC/D,MAAM,SAAS,WAAW,cAAc,QAAQ,IAAI,OAAO,UAAU;AAAA,IACrE,EAAE,iBAAiB,KAAO,mBAAmB,MAAM;AAAA,EACrD;AAEA,SAAO,EAAE,SAAS,MAAM,QAAQ,CAAC,GAAG,OAAO,MAAM,KAAK,SAAS,GAAG,WAAW,OAAO,OAAO;AAC7F;","names":[]}
|