@ludo.ninja/components 1.0.0 → 1.0.2

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/dto/index.js CHANGED
@@ -1,9 +1,8 @@
1
- export * from './AssetEntity';
1
+ export { default as AssetEntity } from './AssetEntity';
2
2
  export { default as CollectionCreationEntity } from './Collection/CollectionCreationEntity';
3
3
  export { default as CollectionEntity } from './Collection/CollectionEntity';
4
4
  export * from './common/ItemType';
5
5
  export * from './common/ItemViews';
6
6
  export * from './common/Media';
7
- export * from './CreationEntity';
8
- export * from './GalleryEntityV2';
9
- export * from './GalleryEntityV2';
7
+ export { default as CreationEntity } from './CreationEntity';
8
+ export { default as GalleryEntityV2 } from './GalleryEntityV2';
@@ -0,0 +1 @@
1
+ export * from './likes/useGetLikesAsset';
@@ -56,8 +56,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  import { useMemo, useState } from 'react';
58
58
  import { useLazyQuery } from '@apollo/client';
59
- import { hosts } from '@ludo.ninja/api';
60
- import { FetchDynamicAssetsLikesDocument, FetchDynamicCollectionsDataDocument, } from '@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema';
59
+ import { hosts, searchSchema } from '@ludo.ninja/api';
61
60
  import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
62
61
  import { useUiStore } from '@/store/ui';
63
62
  export var useGetLikesAsset = function () {
@@ -66,7 +65,7 @@ export var useGetLikesAsset = function () {
66
65
  var isLoadingLikes = useMemo(function () { return activeRequestsCountLikes !== 0; }, [activeRequestsCountLikes]);
67
66
  var _b = useState([]), assetsLikes = _b[0], setAssetsLikes = _b[1];
68
67
  var _c = useState([]), collectionsLikes = _c[0], setCollectionsLikes = _c[1];
69
- var fetchAssetsLikes = useLazyQuery(FetchDynamicAssetsLikesDocument, {
68
+ var fetchAssetsLikes = useLazyQuery(searchSchema.FetchDynamicAssetsLikesDocument, {
70
69
  context: {
71
70
  uri: hosts.searchHost,
72
71
  },
@@ -85,7 +84,7 @@ export var useGetLikesAsset = function () {
85
84
  setActiveRequestsCountLikes(function (prev) { return prev - 1; });
86
85
  },
87
86
  })[0];
88
- var fetchCollectionsLikes = useLazyQuery(FetchDynamicCollectionsDataDocument, {
87
+ var fetchCollectionsLikes = useLazyQuery(searchSchema.FetchDynamicCollectionsDataDocument, {
89
88
  context: { uri: hosts.searchHost },
90
89
  onCompleted: function (_a) {
91
90
  var fetchDynamicCollectionsData = _a.fetchDynamicCollectionsData;
package/dist/index.js CHANGED
@@ -2,4 +2,5 @@ export * from './dto';
2
2
  export * from './modules';
3
3
  export * from './styles';
4
4
  export * from './api';
5
+ export * from './hooks';
5
6
  export * from './utils';
@@ -1,4 +1,4 @@
1
1
  export declare const useGetOpportunities: () => {
2
- opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "blockchain" | "collection" | "name" | "description" | "liked" | "views" | "createdAt" | "opportunityId" | "brandId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "brandName" | "brandDescription" | "brandMedia" | "brandUrl" | "brandIndustry" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "minWalletValue" | "maxWalletValue" | "shareLink">>[] | undefined;
2
+ opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "media" | "views" | "createdAt" | "blockchain" | "name" | "collection" | "description" | "liked" | "opportunityId" | "brandId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "brandName" | "brandDescription" | "brandMedia" | "brandUrl" | "brandIndustry" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "reportLink" | "clicks" | "minWalletValue" | "maxWalletValue" | "shareLink">>[] | undefined;
3
3
  isLoadingOpportunities: boolean;
4
4
  };
@@ -8,6 +8,6 @@ export declare const prefetchSearchResultCategorySelections: (apolloClient: Apol
8
8
  declare const useSearchResultCategorySelections: () => {
9
9
  categorySelectionsLoading: boolean;
10
10
  error: import("@apollo/client").ApolloError | undefined;
11
- searchResultCategorySelections: schema.Maybe<Pick<schema.ISelection, "name" | "label">>[] | null;
11
+ searchResultCategorySelections: schema.Maybe<Pick<schema.ISelection, "label" | "name">>[] | null;
12
12
  };
13
13
  export default useSearchResultCategorySelections;
@@ -9,6 +9,6 @@ declare const useSearchResultStatusSelections: () => {
9
9
  searchResultStatusSelectionsLoading: boolean;
10
10
  loading: boolean;
11
11
  error: import("@apollo/client").ApolloError | undefined;
12
- searchResultStatusSelections: schema.Maybe<Pick<schema.ISelection, "name" | "label">>[] | null;
12
+ searchResultStatusSelections: schema.Maybe<Pick<schema.ISelection, "label" | "name">>[] | null;
13
13
  };
14
14
  export default useSearchResultStatusSelections;
@@ -9,5 +9,5 @@ export declare const useSearchResultTypeSelections: () => {
9
9
  resultTypeSelectionsLoading: boolean;
10
10
  error: import("@apollo/client").ApolloError | undefined;
11
11
  data: any;
12
- searchResultTypeSelections: schema.Maybe<Pick<schema.ISelection, "name" | "label">>[] | null;
12
+ searchResultTypeSelections: schema.Maybe<Pick<schema.ISelection, "label" | "name">>[] | null;
13
13
  };
@@ -1,9 +1,8 @@
1
- export * from './AssetEntity';
1
+ export { default as AssetEntity } from './AssetEntity';
2
2
  export { default as CollectionCreationEntity } from './Collection/CollectionCreationEntity';
3
3
  export { default as CollectionEntity } from './Collection/CollectionEntity';
4
4
  export * from './common/ItemType';
5
5
  export * from './common/ItemViews';
6
6
  export * from './common/Media';
7
- export * from './CreationEntity';
8
- export * from './GalleryEntityV2';
9
- export * from './GalleryEntityV2';
7
+ export { default as CreationEntity } from './CreationEntity';
8
+ export { default as GalleryEntityV2 } from './GalleryEntityV2';
@@ -8,7 +8,7 @@ declare const useGetFavoriteGallaryCreations: ({ galleryId, itemsCount, }: {
8
8
  }) => {
9
9
  gallery: GalleryEntityV2[] | null;
10
10
  loading: boolean;
11
- creationsList: (CreationEntity | CollectionCreationEntity)[];
11
+ creationsList: (CollectionCreationEntity | CreationEntity)[];
12
12
  loadingAssets: boolean;
13
13
  loadingGallery: boolean;
14
14
  loadingCollections: boolean;
@@ -0,0 +1 @@
1
+ export * from './likes/useGetLikesAsset';
@@ -6,7 +6,7 @@ declare const useGetMixedLikesFavoriteList: ({ galleryId, itemsCount, }: {
6
6
  itemsCount: number | null;
7
7
  }) => {
8
8
  gallery: import("../../../dto/GalleryEntityV2").default[] | null;
9
- creationsList: [] | (CreationEntity | CollectionCreationEntity)[];
9
+ creationsList: [] | (CollectionCreationEntity | CreationEntity)[];
10
10
  likes: (schema.IDynamicAssetData | schema.IDynamicCollectionData)[];
11
11
  allResults: number | null;
12
12
  loading: boolean;
@@ -1,18 +1,19 @@
1
+ import { searchSchema } from '@ludo.ninja/api';
1
2
  export type TCurrentItemType = 'asset' | 'collection';
2
3
  export declare const useGetLikesAsset: () => {
3
4
  isLoadingLikes: boolean;
4
5
  fetchLikes: (itemsIdsArray: string[], currentItemType: TCurrentItemType) => Promise<void>;
5
6
  likes: Map<string, {
6
7
  assetId: string;
7
- isLikedByUser?: import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<boolean> | undefined;
8
- likesNum?: import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<number> | undefined;
9
- medias?: import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").IMedia>[]> | undefined;
8
+ isLikedByUser?: searchSchema.Maybe<boolean> | undefined;
9
+ likesNum?: searchSchema.Maybe<number> | undefined;
10
+ medias?: searchSchema.Maybe<searchSchema.Maybe<searchSchema.IMedia>[]> | undefined;
10
11
  id: string;
11
12
  } | {
12
13
  collectionId: string;
13
- isLikedByUser?: import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<boolean> | undefined;
14
- likesNum?: import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<number> | undefined;
15
- collectionAssetsPage?: import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").Maybe<import("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema").IAssetsPage> | undefined;
14
+ isLikedByUser?: searchSchema.Maybe<boolean> | undefined;
15
+ likesNum?: searchSchema.Maybe<number> | undefined;
16
+ collectionAssetsPage?: searchSchema.Maybe<searchSchema.IAssetsPage> | undefined;
16
17
  id: string;
17
18
  }>;
18
19
  resetLikes: () => void;
@@ -2,4 +2,5 @@ export * from './dto';
2
2
  export * from './modules';
3
3
  export * from './styles';
4
4
  export * from './api';
5
+ export * from './hooks';
5
6
  export * from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",
package/src/dto/index.ts CHANGED
@@ -1,9 +1,8 @@
1
- export * from './AssetEntity';
1
+ export { default as AssetEntity } from './AssetEntity';
2
2
  export { default as CollectionCreationEntity } from './Collection/CollectionCreationEntity';
3
3
  export { default as CollectionEntity } from './Collection/CollectionEntity';
4
4
  export * from './common/ItemType';
5
5
  export * from './common/ItemViews';
6
6
  export * from './common/Media';
7
- export * from './CreationEntity';
8
- export * from './GalleryEntityV2';
9
- export * from './GalleryEntityV2';
7
+ export { default as CreationEntity } from './CreationEntity';
8
+ export { default as GalleryEntityV2 } from './GalleryEntityV2';
@@ -0,0 +1 @@
1
+ export * from './likes/useGetLikesAsset';
@@ -2,13 +2,8 @@ import { useMemo, useState } from 'react';
2
2
 
3
3
  import { useLazyQuery } from '@apollo/client';
4
4
 
5
- import { hosts } from '@ludo.ninja/api';
6
- import {
7
- FetchDynamicAssetsLikesDocument,
8
- FetchDynamicCollectionsDataDocument,
9
- IDynamicAssetData,
10
- IDynamicCollectionData,
11
- } from '@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema';
5
+ import { hosts, searchSchema } from '@ludo.ninja/api';
6
+
12
7
  import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
13
8
 
14
9
  import { useUiStore } from '@/store/ui';
@@ -25,12 +20,12 @@ export const useGetLikesAsset = () => {
25
20
  [activeRequestsCountLikes]
26
21
  );
27
22
 
28
- const [assetsLikes, setAssetsLikes] = useState<IDynamicAssetData[]>([]);
23
+ const [assetsLikes, setAssetsLikes] = useState<searchSchema.IDynamicAssetData[]>([]);
29
24
  const [collectionsLikes, setCollectionsLikes] = useState<
30
- IDynamicCollectionData[]
25
+ searchSchema.IDynamicCollectionData[]
31
26
  >([]);
32
27
 
33
- const [fetchAssetsLikes] = useLazyQuery(FetchDynamicAssetsLikesDocument, {
28
+ const [fetchAssetsLikes] = useLazyQuery(searchSchema.FetchDynamicAssetsLikesDocument, {
34
29
  context: {
35
30
  uri: hosts.searchHost,
36
31
  },
@@ -51,7 +46,7 @@ export const useGetLikesAsset = () => {
51
46
  });
52
47
 
53
48
  const [fetchCollectionsLikes] = useLazyQuery(
54
- FetchDynamicCollectionsDataDocument,
49
+ searchSchema.FetchDynamicCollectionsDataDocument,
55
50
  {
56
51
  context: { uri: hosts.searchHost },
57
52
  onCompleted: ({ fetchDynamicCollectionsData }) => {
package/src/index.ts CHANGED
@@ -2,4 +2,5 @@ export * from './dto';
2
2
  export * from './modules';
3
3
  export * from './styles';
4
4
  export * from './api';
5
+ export * from './hooks';
5
6
  export * from './utils';