@ludo.ninja/components 1.0.1 → 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.
@@ -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';
@@ -0,0 +1 @@
1
+ export * from './likes/useGetLikesAsset';
@@ -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.1",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -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';