@ludo.ninja/components 1.5.9 → 1.6.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.
Files changed (148) hide show
  1. package/dist/hooks/apollo/index.d.ts +2 -1
  2. package/dist/hooks/apollo/index.jsx +7 -1
  3. package/dist/hooks/searchFiltersConnector/index.d.ts +1 -1
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +0 -1
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/package.json +1 -1
  8. package/dist/api/graphql/index.d.ts +0 -4
  9. package/dist/api/graphql/index.js +0 -7
  10. package/dist/api/index.d.ts +0 -1
  11. package/dist/api/index.js +0 -1
  12. package/dist/api/server-assets/mutations/useDislikeAsset/index.d.ts +0 -7
  13. package/dist/api/server-assets/mutations/useDislikeAsset/index.js +0 -79
  14. package/dist/api/server-assets/mutations/useLikeAsset/index.d.ts +0 -7
  15. package/dist/api/server-assets/mutations/useLikeAsset/index.js +0 -80
  16. package/dist/api/server-assets/queries/useFetchAssetByBlockchain/index.d.ts +0 -14
  17. package/dist/api/server-assets/queries/useFetchAssetByBlockchain/index.js +0 -84
  18. package/dist/api/server-assets/queries/useFetchAssets/index.d.ts +0 -7
  19. package/dist/api/server-assets/queries/useFetchAssets/index.js +0 -30
  20. package/dist/api/server-assets/queries/useFetchDynamicAssetLikes/index.d.ts +0 -8
  21. package/dist/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +0 -35
  22. package/dist/api/server-assets/queries/useFetchDynamicAssetsLikes/index.d.ts +0 -7
  23. package/dist/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +0 -30
  24. package/dist/api/server-collection/mutations/useDislikeCollection/index.d.ts +0 -7
  25. package/dist/api/server-collection/mutations/useDislikeCollection/index.js +0 -78
  26. package/dist/api/server-collection/mutations/useLikeCollection/index.d.ts +0 -7
  27. package/dist/api/server-collection/mutations/useLikeCollection/index.js +0 -78
  28. package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.d.ts +0 -2
  29. package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +0 -91
  30. package/dist/api/server-experiences/queries/useFetchMyTasks/index.d.ts +0 -31
  31. package/dist/api/server-experiences/queries/useFetchMyTasks/index.js +0 -46
  32. package/dist/api/server-galleries/mutations/useAddAssetsToGallery/index.d.ts +0 -7
  33. package/dist/api/server-galleries/mutations/useAddAssetsToGallery/index.js +0 -82
  34. package/dist/api/server-galleries/mutations/useAddChangeGalleryBanner/index.d.ts +0 -4
  35. package/dist/api/server-galleries/mutations/useAddChangeGalleryBanner/index.js +0 -67
  36. package/dist/api/server-galleries/mutations/useAddCollectionsToGallery/index.d.ts +0 -7
  37. package/dist/api/server-galleries/mutations/useAddCollectionsToGallery/index.js +0 -81
  38. package/dist/api/server-galleries/mutations/useAddCreationsToGallery/index.d.ts +0 -7
  39. package/dist/api/server-galleries/mutations/useAddCreationsToGallery/index.js +0 -89
  40. package/dist/api/server-galleries/mutations/useCreateFavorites/index.d.ts +0 -6
  41. package/dist/api/server-galleries/mutations/useCreateFavorites/index.js +0 -70
  42. package/dist/api/server-galleries/mutations/useCreateGallery/index.d.ts +0 -6
  43. package/dist/api/server-galleries/mutations/useCreateGallery/index.js +0 -70
  44. package/dist/api/server-galleries/mutations/useDeleteGallery/index.d.ts +0 -8
  45. package/dist/api/server-galleries/mutations/useDeleteGallery/index.js +0 -87
  46. package/dist/api/server-galleries/mutations/useDeleteGalleryBanner/index.d.ts +0 -5
  47. package/dist/api/server-galleries/mutations/useDeleteGalleryBanner/index.js +0 -83
  48. package/dist/api/server-galleries/mutations/useEditGallery/index.d.ts +0 -5
  49. package/dist/api/server-galleries/mutations/useEditGallery/index.js +0 -62
  50. package/dist/api/server-galleries/mutations/useRemoveAssetFromGallery/index.d.ts +0 -7
  51. package/dist/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +0 -95
  52. package/dist/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.d.ts +0 -7
  53. package/dist/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.js +0 -90
  54. package/dist/api/server-galleries/queries/useFetchGallery/index.d.ts +0 -16
  55. package/dist/api/server-galleries/queries/useFetchGallery/index.js +0 -42
  56. package/dist/api/server-galleries/queries/useFetchGalleryAssets/index.d.ts +0 -18
  57. package/dist/api/server-galleries/queries/useFetchGalleryAssets/index.js +0 -115
  58. package/dist/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +0 -10
  59. package/dist/api/server-galleries/queries/useFetchMyFavorites/index.js +0 -120
  60. package/dist/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +0 -10
  61. package/dist/api/server-galleries/queries/useFetchMyGalleries/index.js +0 -123
  62. package/dist/api/server-galleries/queries/useFetchSubscribedGalleries/index.d.ts +0 -9
  63. package/dist/api/server-galleries/queries/useFetchSubscribedGalleries/index.js +0 -95
  64. package/dist/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +0 -11
  65. package/dist/api/server-galleries/queries/useFetchUserFavorites/index.js +0 -130
  66. package/dist/api/server-identities/mutations/useAddWalletElrond/index.d.ts +0 -6
  67. package/dist/api/server-identities/mutations/useAddWalletElrond/index.js +0 -37
  68. package/dist/api/server-identities/mutations/useAddWalletFlow/index.d.ts +0 -5
  69. package/dist/api/server-identities/mutations/useAddWalletFlow/index.js +0 -78
  70. package/dist/api/server-identities/mutations/useAddWalletMetamask/index.d.ts +0 -12
  71. package/dist/api/server-identities/mutations/useAddWalletMetamask/index.js +0 -87
  72. package/dist/api/server-identities/mutations/useAddWalletSolana/index.d.ts +0 -5
  73. package/dist/api/server-identities/mutations/useAddWalletSolana/index.js +0 -82
  74. package/dist/api/server-identities/mutations/useAddWalletTezos/index.d.ts +0 -5
  75. package/dist/api/server-identities/mutations/useAddWalletTezos/index.js +0 -78
  76. package/dist/api/server-identities/mutations/useFollowProfile/index.d.ts +0 -7
  77. package/dist/api/server-identities/mutations/useFollowProfile/index.js +0 -40
  78. package/dist/api/server-identities/mutations/useGenerateNewInviteCodes/index.d.ts +0 -7
  79. package/dist/api/server-identities/mutations/useGenerateNewInviteCodes/index.js +0 -78
  80. package/dist/api/server-identities/mutations/useInviteCode/index.d.ts +0 -9
  81. package/dist/api/server-identities/mutations/useInviteCode/index.js +0 -76
  82. package/dist/api/server-identities/mutations/useRemoveWallet/index.d.ts +0 -8
  83. package/dist/api/server-identities/mutations/useRemoveWallet/index.js +0 -44
  84. package/dist/api/server-identities/mutations/useRevokeToken/index.d.ts +0 -4
  85. package/dist/api/server-identities/mutations/useRevokeToken/index.js +0 -66
  86. package/dist/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +0 -76
  87. package/dist/api/server-identities/mutations/useUnfollowProfile/index.d.ts +0 -7
  88. package/dist/api/server-identities/mutations/useUnfollowProfile/index.js +0 -39
  89. package/dist/api/server-identities/queries/useFetchProfile/index.d.ts +0 -16
  90. package/dist/api/server-identities/queries/useFetchProfile/index.js +0 -79
  91. package/dist/api/server-identities/queries/useFetchUserWallets/index.js +0 -19
  92. package/dist/api/server-identities/queries/useGetMyInviteCodes/index.d.ts +0 -8
  93. package/dist/api/server-identities/queries/useGetMyInviteCodes/index.js +0 -36
  94. package/dist/api/server-medias/mutations/useDeleteUserpic/index.d.ts +0 -6
  95. package/dist/api/server-medias/mutations/useDeleteUserpic/index.js +0 -19
  96. package/dist/api/server-medias/mutations/useUploadUserpic/index.d.ts +0 -4
  97. package/dist/api/server-medias/mutations/useUploadUserpic/index.js +0 -69
  98. package/dist/api/server-medias/queries/useFetchUserPic/index.js +0 -37
  99. package/dist/api/server-opportunities/mutations/useDislikeOpportunity.d.ts +0 -4
  100. package/dist/api/server-opportunities/mutations/useDislikeOpportunity.js +0 -71
  101. package/dist/api/server-opportunities/mutations/useLikeOpportunity.d.ts +0 -4
  102. package/dist/api/server-opportunities/mutations/useLikeOpportunity.js +0 -71
  103. package/dist/api/server-opportunities/mutations/useOpenOpportunity/index.d.ts +0 -5
  104. package/dist/api/server-opportunities/mutations/useOpenOpportunity/index.js +0 -72
  105. package/dist/api/server-opportunities/queries/useGetOpportunities.d.ts +0 -4
  106. package/dist/api/server-opportunities/queries/useGetOpportunities.js +0 -22
  107. package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.d.ts +0 -4
  108. package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.jsx +0 -86
  109. package/dist/api/server-preferences/mutations/useSaveUserInterests/index.d.ts +0 -4
  110. package/dist/api/server-preferences/mutations/useSaveUserInterests/index.js +0 -86
  111. package/dist/api/server-preferences/queries/fetchSearchResultSelections/index.js +0 -28
  112. package/dist/api/server-preferences/queries/fetchSearchResultSelections/queryData.d.ts +0 -14
  113. package/dist/api/server-preferences/queries/fetchSearchResultSelections/queryData.js +0 -87
  114. package/dist/api/server-preferences/queries/useFetchExpectations/index.js +0 -19
  115. package/dist/api/server-preferences/queries/useFetchInterests/index.js +0 -19
  116. package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.d.ts +0 -12
  117. package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.js +0 -36
  118. package/dist/api/server-preferences/queries/useFetchUserInterests/index.d.ts +0 -7
  119. package/dist/api/server-preferences/queries/useFetchUserInterests/index.js +0 -20
  120. package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.d.ts +0 -13
  121. package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.js +0 -37
  122. package/dist/api/server-preferences/queries/useSearchResultCategorySelections/index.d.ts +0 -13
  123. package/dist/api/server-preferences/queries/useSearchResultCategorySelections/index.js +0 -37
  124. package/dist/api/server-preferences/queries/useSearchResultStatusSelections/index.d.ts +0 -14
  125. package/dist/api/server-preferences/queries/useSearchResultStatusSelections/index.js +0 -38
  126. package/dist/api/server-preferences/queries/useSearchResultTypeSelections/index.d.ts +0 -13
  127. package/dist/api/server-preferences/queries/useSearchResultTypeSelections/index.js +0 -42
  128. package/dist/api/server-search/queries/useFetchAllCreations/index.js +0 -171
  129. package/dist/api/server-search/queries/useFetchAssetsCount/index.d.ts +0 -7
  130. package/dist/api/server-search/queries/useFetchAssetsCount/index.js +0 -31
  131. package/dist/api/server-search/queries/useFetchCollection/index.d.ts +0 -19
  132. package/dist/api/server-search/queries/useFetchCollection/index.js +0 -55
  133. package/dist/api/server-search/queries/useFetchCollections/index.d.ts +0 -23
  134. package/dist/api/server-search/queries/useFetchCollections/index.js +0 -176
  135. package/dist/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +0 -13
  136. package/dist/api/server-search/queries/useFetchDynamicCollectionData/index.js +0 -195
  137. package/dist/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.js +0 -54
  138. package/dist/api/server-search/queries/useFetchNetWorth/index.d.ts +0 -7
  139. package/dist/api/server-search/queries/useFetchNetWorth/index.js +0 -22
  140. package/dist/api/server-search/queries/useFindCreations/index.js +0 -184
  141. package/dist/api/server-search/queries/useFindProfilesByName/index.js +0 -58
  142. package/dist/api/server-search/queries/useFindShowcaseItems/index.d.ts +0 -2
  143. package/dist/api/server-search/queries/useFindShowcaseItems/index.js +0 -40
  144. package/dist/api/server-search/queries/useFindUserCreations/index.js +0 -168
  145. package/dist/api/server-search/queries/useFindUserShowcaseItems/index.d.ts +0 -2
  146. package/dist/api/server-search/queries/useFindUserShowcaseItems/index.js +0 -38
  147. package/dist/api/subscriptions/SubscriberInviteNotification.d.ts +0 -2
  148. package/dist/api/subscriptions/SubscriberInviteNotification.jsx +0 -40
@@ -1,37 +0,0 @@
1
- import { useState } from 'react';
2
- import { useQuery } from '@apollo/client';
3
- import { hosts, preferencesSchema as schema } from '@ludo.ninja/api';
4
- export var prefetchSearchResultBlockchainSelections = function (apolloClient) {
5
- return apolloClient
6
- .query({
7
- query: schema.FetchSearchResultBlockchainSelectionsDocument,
8
- context: { uri: hosts.preferencesHost },
9
- fetchPolicy: 'network-only',
10
- })
11
- .catch(function () {
12
- return {
13
- data: { fetchSearchResultBlockchainSelections: null },
14
- };
15
- });
16
- };
17
- export var useSearchResultBlockchainSelections = function () {
18
- var _a = useState(null), searchResultBlockchainSelections = _a[0], setSearchResultBlockchainSelections = _a[1];
19
- var _b = useQuery(schema.FetchSearchResultBlockchainSelectionsDocument, {
20
- context: {
21
- uri: hosts.preferencesHost,
22
- },
23
- onCompleted: function (_a) {
24
- var fetchSearchResultBlockchainSelections = _a.fetchSearchResultBlockchainSelections;
25
- setSearchResultBlockchainSelections(fetchSearchResultBlockchainSelections);
26
- },
27
- onError: function () {
28
- setSearchResultBlockchainSelections(null);
29
- },
30
- }), error = _b.error, loading = _b.loading;
31
- return {
32
- searchResultBlockchainSelectionsLoading: loading,
33
- loading: loading,
34
- error: error,
35
- searchResultBlockchainSelections: searchResultBlockchainSelections,
36
- };
37
- };
@@ -1,13 +0,0 @@
1
- import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
- import { preferencesSchema as schema } from '@ludo.ninja/api';
3
- export declare const prefetchSearchResultCategorySelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
4
- data: {
5
- fetchSearchResultCategorySelections: any;
6
- };
7
- }>;
8
- declare const useSearchResultCategorySelections: () => {
9
- categorySelectionsLoading: boolean;
10
- error: import("@apollo/client").ApolloError;
11
- searchResultCategorySelections: Pick<schema.ISelection, "label" | "name">[];
12
- };
13
- export default useSearchResultCategorySelections;
@@ -1,37 +0,0 @@
1
- import { useState } from 'react';
2
- import { useQuery } from '@apollo/client';
3
- import { hosts, preferencesSchema as schema } from '@ludo.ninja/api';
4
- export var prefetchSearchResultCategorySelections = function (apolloClient) {
5
- return apolloClient
6
- .query({
7
- query: schema.FetchSearchResultCategorySelectionsDocument,
8
- context: { uri: hosts.preferencesHost },
9
- fetchPolicy: 'network-only',
10
- })
11
- .catch(function () {
12
- return {
13
- data: { fetchSearchResultCategorySelections: null },
14
- };
15
- });
16
- };
17
- var useSearchResultCategorySelections = function () {
18
- var _a = useState(null), searchResultCategorySelections = _a[0], setSearchResultCategorySelections = _a[1];
19
- var _b = useQuery(schema.FetchSearchResultCategorySelectionsDocument, {
20
- context: {
21
- uri: hosts.preferencesHost,
22
- },
23
- onCompleted: function (_a) {
24
- var fetchSearchResultCategorySelections = _a.fetchSearchResultCategorySelections;
25
- setSearchResultCategorySelections(fetchSearchResultCategorySelections);
26
- },
27
- onError: function () {
28
- setSearchResultCategorySelections(null);
29
- },
30
- }), error = _b.error, loading = _b.loading;
31
- return {
32
- categorySelectionsLoading: loading,
33
- error: error,
34
- searchResultCategorySelections: searchResultCategorySelections,
35
- };
36
- };
37
- export default useSearchResultCategorySelections;
@@ -1,14 +0,0 @@
1
- import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
- import { preferencesSchema as schema } from '@ludo.ninja/api';
3
- export declare const prefetchSearchResultStatusSelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
4
- data: {
5
- fetchSearchResultStatusSelections: any;
6
- };
7
- }>;
8
- declare const useSearchResultStatusSelections: () => {
9
- searchResultStatusSelectionsLoading: boolean;
10
- loading: boolean;
11
- error: import("@apollo/client").ApolloError;
12
- searchResultStatusSelections: Pick<schema.ISelection, "label" | "name">[];
13
- };
14
- export default useSearchResultStatusSelections;
@@ -1,38 +0,0 @@
1
- import { useState } from 'react';
2
- import { useQuery } from '@apollo/client';
3
- import { hosts, preferencesSchema as schema } from '@ludo.ninja/api';
4
- export var prefetchSearchResultStatusSelections = function (apolloClient) {
5
- return apolloClient
6
- .query({
7
- query: schema.FetchSearchResultStatusSelectionsDocument,
8
- context: { uri: hosts.preferencesHost },
9
- fetchPolicy: 'network-only',
10
- })
11
- .catch(function () {
12
- return {
13
- data: { fetchSearchResultStatusSelections: null },
14
- };
15
- });
16
- };
17
- var useSearchResultStatusSelections = function () {
18
- var _a = useState(null), searchResultStatusSelections = _a[0], setSearchResultStatusSelections = _a[1];
19
- var _b = useQuery(schema.FetchSearchResultStatusSelectionsDocument, {
20
- context: {
21
- uri: hosts.preferencesHost,
22
- },
23
- onCompleted: function (_a) {
24
- var fetchSearchResultStatusSelections = _a.fetchSearchResultStatusSelections;
25
- setSearchResultStatusSelections(fetchSearchResultStatusSelections);
26
- },
27
- onError: function () {
28
- setSearchResultStatusSelections(null);
29
- },
30
- }), error = _b.error, loading = _b.loading;
31
- return {
32
- searchResultStatusSelectionsLoading: loading,
33
- loading: loading,
34
- error: error,
35
- searchResultStatusSelections: searchResultStatusSelections,
36
- };
37
- };
38
- export default useSearchResultStatusSelections;
@@ -1,13 +0,0 @@
1
- import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
- import { preferencesSchema as schema } from '@ludo.ninja/api';
3
- export declare const prefetchSearchResultTypeSelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
4
- data: {
5
- fetchSetsSearchResultTypeSelections: any;
6
- };
7
- }>;
8
- export declare const useSearchResultTypeSelections: () => {
9
- resultTypeSelectionsLoading: boolean;
10
- error: import("@apollo/client").ApolloError;
11
- data: any;
12
- searchResultTypeSelections: Pick<schema.ISelection, "label" | "name">[];
13
- };
@@ -1,42 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- import { useState } from 'react';
6
- import { gql, useQuery, } from '@apollo/client';
7
- import { hosts, preferencesSchema as schema } from '@ludo.ninja/api';
8
- export var prefetchSearchResultTypeSelections = function (apolloClient) {
9
- return apolloClient
10
- .query({
11
- query: gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n query FetchSetsSearchResultTypeSelections {\n fetchSearchResultTypeSelections {\n name\n label\n }\n }\n "], ["\n query FetchSetsSearchResultTypeSelections {\n fetchSearchResultTypeSelections {\n name\n label\n }\n }\n "]))),
12
- context: { uri: hosts.preferencesHost },
13
- fetchPolicy: 'network-only',
14
- })
15
- .catch(function () {
16
- return {
17
- data: { fetchSetsSearchResultTypeSelections: null },
18
- };
19
- });
20
- };
21
- export var useSearchResultTypeSelections = function () {
22
- var _a = useState(null), searchResultTypeSelections = _a[0], setSearchResultTypeSelections = _a[1];
23
- var _b = useQuery(schema.FetchSetsSearchResultTypeSelectionsDocument, {
24
- context: {
25
- uri: hosts.preferencesHost,
26
- },
27
- onCompleted: function (_a) {
28
- var fetchSetsSearchResultTypeSelections = _a.fetchSetsSearchResultTypeSelections;
29
- setSearchResultTypeSelections(fetchSetsSearchResultTypeSelections);
30
- },
31
- onError: function () {
32
- setSearchResultTypeSelections(null);
33
- },
34
- }), data = _b.data, error = _b.error, loading = _b.loading;
35
- return {
36
- resultTypeSelectionsLoading: loading,
37
- error: error,
38
- data: data,
39
- searchResultTypeSelections: searchResultTypeSelections,
40
- };
41
- };
42
- var templateObject_1;
@@ -1,171 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var __rest = (this && this.__rest) || function (s, e) {
49
- var t = {};
50
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- };
59
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
60
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
61
- if (ar || !(i in from)) {
62
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
63
- ar[i] = from[i];
64
- }
65
- }
66
- return to.concat(ar || Array.prototype.slice.call(from));
67
- };
68
- import { useState } from 'react';
69
- import { NetworkStatus, } from '@apollo/client';
70
- import { hosts, searchSchema as schema } from '@ludo.ninja/api';
71
- import CreationEntity from '@/dto/CreationEntity';
72
- export var prefetchAllCreations = function (_a, apolloClient) {
73
- var page = _a.page;
74
- return apolloClient
75
- .query({
76
- query: schema.FetchAllCreationsDocument,
77
- variables: {
78
- page: page,
79
- },
80
- context: { uri: hosts.serverSearchHost },
81
- fetchPolicy: 'network-only',
82
- })
83
- .catch(function () {
84
- return {
85
- data: { fetchAllCreations: null },
86
- };
87
- });
88
- };
89
- var maxCreationLength = 1000;
90
- export var useFetchAllCreations = function (_a) {
91
- var page = _a.page;
92
- var _b = useState([]), allCreations = _b[0], setCreations = _b[1];
93
- var _c = useState(null), nextPageToken = _c[0], setNextPageToken = _c[1];
94
- var _d = schema.useFetchAllCreationsQuery({
95
- variables: {
96
- page: page,
97
- },
98
- context: {
99
- uri: hosts.searchHost,
100
- },
101
- onCompleted: function (_a) {
102
- var _b;
103
- var fetchAllCreations = _a.fetchAllCreations;
104
- setCreations(fetchAllCreations.creations.map(function (creation) { return new CreationEntity(creation); }));
105
- setNextPageToken(((_b = fetchAllCreations.nextPage) === null || _b === void 0 ? void 0 : _b.token) || null);
106
- },
107
- onError: function () {
108
- setCreations([]);
109
- setNextPageToken(null);
110
- },
111
- }), error = _d.error, loading = _d.loading, fetchMore = _d.fetchMore, networkStatus = _d.networkStatus, refetch = _d.refetch;
112
- var loadingMoreCreations = networkStatus === NetworkStatus.fetchMore;
113
- return {
114
- loadMore: loadMore,
115
- loading: loading || loadingMoreCreations,
116
- refetchQuery: refetchQuery,
117
- error: error,
118
- allCreations: allCreations,
119
- nextPageToken: nextPageToken,
120
- };
121
- function refetchQuery() {
122
- return __awaiter(this, void 0, void 0, function () {
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0: return [4 /*yield*/, refetch()];
126
- case 1:
127
- _a.sent();
128
- return [2 /*return*/];
129
- }
130
- });
131
- });
132
- }
133
- function loadMore(pageToken) {
134
- return __awaiter(this, void 0, void 0, function () {
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
137
- case 0:
138
- if (!pageToken || allCreations.length >= maxCreationLength)
139
- return [2 /*return*/];
140
- return [4 /*yield*/, fetchMore({
141
- variables: {
142
- page: __assign({ token: pageToken }, (page && 'size' in page ? { size: page.size } : {})),
143
- },
144
- updateQuery: function (prev, _a) {
145
- var fetchMoreResult = _a.fetchMoreResult;
146
- if (!fetchMoreResult)
147
- return prev;
148
- var _b = fetchMoreResult.fetchAllCreations, nextCreations = _b.creations, response = __rest(_b, ["creations"]);
149
- if (prev !== null) {
150
- var prevCreations = prev.fetchAllCreations.creations;
151
- return {
152
- fetchAllCreations: __assign({ creations: __spreadArray(__spreadArray([], prevCreations, true), nextCreations, true) }, response),
153
- };
154
- }
155
- else {
156
- refetchQuery();
157
- return {
158
- fetchAllCreations: __assign({ creations: nextCreations }, response),
159
- };
160
- }
161
- },
162
- })];
163
- case 1:
164
- _a.sent();
165
- return [2 /*return*/];
166
- }
167
- });
168
- });
169
- }
170
- };
171
- export default { useFetchAllCreations: useFetchAllCreations, prefetchAllCreations: prefetchAllCreations };
@@ -1,7 +0,0 @@
1
- declare const useFetchNftCount: () => {
2
- loading: boolean;
3
- error: any;
4
- data: any;
5
- count: number;
6
- };
7
- export default useFetchNftCount;
@@ -1,31 +0,0 @@
1
- // import { useState } from 'react';
2
- //
3
- // import { useQuery } from '@apollo/client';
4
- //
5
- // import { hosts, searchSchema as schema } from '@ludo.ninja/api';
6
- // import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
7
- //
8
- // import { useUiStore } from '@/store/ui';
9
- var useFetchNftCount = function () {
10
- // const [count, setCount] = useState<number>(0);
11
- // const openAlert = useUiStore((state) => state.openAlert);
12
- // const { data, error, loading } = useQuery(schema.FetchAssetsCountDocument, {
13
- // context: {
14
- // uri: hosts.searchHost,
15
- // },
16
- // fetchPolicy: 'no-cache',
17
- // onCompleted: ({ fetchAssetsCount }) => {
18
- // setCount(fetchAssetsCount);
19
- // },
20
- // onError: (err) => {
21
- // openAlert({
22
- // type: alertVariants.error,
23
- //
24
- // caption: err.message,
25
- // });
26
- // setCount(0);
27
- // },
28
- // });
29
- return { loading: true, error: null, data: null, count: 0 };
30
- };
31
- export default useFetchNftCount;
@@ -1,19 +0,0 @@
1
- import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
- import { searchSchema as schema } from '@ludo.ninja/api';
3
- import CollectionEntity from '@/dto/Collection/CollectionEntity';
4
- declare const prefetchCollection: ({ collectionId }: {
5
- collectionId: string;
6
- }, apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
7
- data: {
8
- fetchCollection: any;
9
- };
10
- }>;
11
- declare const useFetchCollection: ({ collectionId, prefetchedCollection, }: {
12
- collectionId: string;
13
- prefetchedCollection: schema.ICollection | null;
14
- }) => {
15
- isLoadingCollection: boolean;
16
- error: import("@apollo/client").ApolloError;
17
- collection: CollectionEntity;
18
- };
19
- export { prefetchCollection, useFetchCollection };
@@ -1,55 +0,0 @@
1
- import { useState } from 'react';
2
- import { useQuery } from '@apollo/client';
3
- import { hosts, searchSchema as schema } from '@ludo.ninja/api';
4
- import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
5
- import { useUiStore } from '@/store/ui';
6
- import CollectionEntity from '@/dto/Collection/CollectionEntity';
7
- var prefetchCollection = function (_a, apolloClient) {
8
- var collectionId = _a.collectionId;
9
- return apolloClient
10
- .query({
11
- query: schema.FetchCollectionDocument,
12
- variables: { collectionId: collectionId },
13
- context: { uri: hosts.searchHost },
14
- fetchPolicy: 'network-only',
15
- })
16
- .catch(function () {
17
- return {
18
- data: { fetchCollection: null },
19
- };
20
- });
21
- };
22
- var useFetchCollection = function (_a) {
23
- var collectionId = _a.collectionId, prefetchedCollection = _a.prefetchedCollection;
24
- var _b = useState(prefetchedCollection ? new CollectionEntity(prefetchedCollection) : null), collection = _b[0], setCollection = _b[1];
25
- var _c = useState(!prefetchedCollection), isLoadingCollection = _c[0], setIsLoadingCollection = _c[1];
26
- var openAlert = useUiStore(function (state) { return state.openAlert; });
27
- var error = useQuery(schema.FetchCollectionDocument, {
28
- variables: { collectionId: collectionId },
29
- context: {
30
- uri: hosts.searchHost,
31
- },
32
- fetchPolicy: 'cache-first',
33
- onCompleted: function (_a) {
34
- var fetchCollection = _a.fetchCollection;
35
- if (fetchCollection) {
36
- setCollection(new CollectionEntity(fetchCollection));
37
- }
38
- setIsLoadingCollection(false);
39
- },
40
- onError: function () {
41
- openAlert({
42
- type: alertVariants.error,
43
- caption: 'Oops, something went wrong.',
44
- });
45
- setCollection(null);
46
- setIsLoadingCollection(false);
47
- },
48
- }).error;
49
- return {
50
- isLoadingCollection: isLoadingCollection,
51
- error: error,
52
- collection: collection,
53
- };
54
- };
55
- export { prefetchCollection, useFetchCollection };
@@ -1,23 +0,0 @@
1
- import { searchSchema as schema } from '@ludo.ninja/api';
2
- import CollectionCreationEntity from '@/dto/Collection/CollectionCreationEntity';
3
- export declare const useFindCollections: ({ term, input, page, }: schema.IQueryFindCollectionsArgs) => {
4
- loadMore: (pageToken: string) => Promise<void>;
5
- loading: boolean;
6
- error: import("@apollo/client").ApolloError;
7
- results: number;
8
- collections: CollectionCreationEntity[];
9
- nextPageToken: string;
10
- refetchQuery: () => Promise<void>;
11
- };
12
- declare const _default: {
13
- useFindCollections: ({ term, input, page, }: schema.IQueryFindCollectionsArgs) => {
14
- loadMore: (pageToken: string) => Promise<void>;
15
- loading: boolean;
16
- error: import("@apollo/client").ApolloError;
17
- results: number;
18
- collections: CollectionCreationEntity[];
19
- nextPageToken: string;
20
- refetchQuery: () => Promise<void>;
21
- };
22
- };
23
- export default _default;