@ludo.ninja/components 2.2.36 → 2.2.37

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 (56) hide show
  1. package/build/api/server-galleries/queries/useFetchGallery/index.d.ts +5 -5
  2. package/build/api/server-galleries/queries/useFetchGallery/index.js +5 -8
  3. package/build/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +3 -3
  4. package/build/api/server-galleries/queries/useFetchMyFavorites/index.js +5 -11
  5. package/build/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +3 -3
  6. package/build/api/server-galleries/queries/useFetchMyGalleries/index.js +5 -11
  7. package/build/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +4 -4
  8. package/build/api/server-galleries/queries/useFetchUserFavorites/index.js +6 -9
  9. package/build/components/assetPage/assetLikes/index.js +7 -7
  10. package/build/components/search/searchSuggestions/index.js +2 -2
  11. package/build/dto/AssetEntity/index.d.ts +3 -3
  12. package/build/dto/AssetEntity/index.js +16 -33
  13. package/build/dto/AssetSearchEntity/index.d.ts +2 -2
  14. package/build/dto/AssetSearchEntity/index.js +12 -29
  15. package/build/dto/Collection/CollectionCreationEntity/index.d.ts +3 -3
  16. package/build/dto/Collection/CollectionCreationEntity/index.js +13 -13
  17. package/build/dto/Collection/CollectionCreationEntity/interface.d.ts +2 -2
  18. package/build/dto/Collection/CollectionEntity/index.d.ts +2 -2
  19. package/build/dto/Collection/CollectionEntity/index.js +1 -1
  20. package/build/dto/CreationEntity/index.d.ts +3 -3
  21. package/build/dto/CreationEntity/index.js +9 -9
  22. package/build/dto/GalleryEntityV2/index.d.ts +4 -4
  23. package/build/dto/GalleryEntityV2/index.js +6 -8
  24. package/build/dto/common/ItemType/data.d.ts +1 -1
  25. package/build/dto/common/ItemType/data.js +25 -25
  26. package/build/entities/gallery/builder.js +1 -1
  27. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +4 -4
  28. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +17 -19
  29. package/build/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +5 -5
  30. package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +23 -33
  31. package/build/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +5 -5
  32. package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +23 -33
  33. package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +1 -1
  34. package/build/hooks/likes/index.d.ts +1 -1
  35. package/build/hooks/likes/index.js +12 -12
  36. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +4 -4
  37. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +35 -40
  38. package/build/modules/gallery/store.d.ts +3 -3
  39. package/build/modules/gallery/store.js +7 -11
  40. package/build/modules/gallery/ui/EditGallery.d.ts +2 -2
  41. package/build/modules/gallery/ui/EditGallery.js +11 -11
  42. package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +3 -3
  43. package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +1 -1
  44. package/build/modules/gallery/ui/chooseGalleryItems/index.d.ts +1 -1
  45. package/build/modules/gallery/ui/chooseGalleryItems/index.js +19 -20
  46. package/build/modules/opportunity/OpportunityCard.js +25 -27
  47. package/build/system/Cards/CardContent/CardCategory/CardCategory.test.d.ts +1 -1
  48. package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +9 -9
  49. package/build/system/Cards/CardContent/CardCategory/index.d.ts +1 -1
  50. package/build/system/Cards/CardContent/CardCategory/index.js +3 -3
  51. package/build/system/Cards/CreationCard/CardHead.js +16 -21
  52. package/build/system/Cards/CreationCard/index.d.ts +2 -2
  53. package/build/system/Cards/CreationCard/index.js +5 -5
  54. package/build/system/Cards/MultiMediaCard/index.d.ts +2 -2
  55. package/build/system/Cards/MultiMediaCard/index.js +3 -3
  56. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
- import { galleriesSchema as schema } from '@ludo.ninja/api';
3
- import GalleryEntityV2 from '../../../../dto/GalleryEntityV2';
1
+ import { TGallery } from '../../../../entities/gallery/types';
2
+ import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
3
+ import { galleriesSchema as schema } from "@ludo.ninja/api";
4
4
  declare const prefetchGalleryV2: ({ galleryId }: schema.IQueryFetchGalleryV2Args, apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
5
5
  data: {
6
6
  fetchGalleryV2: null;
7
7
  };
8
8
  }>;
9
- declare const useFetchGalleryV2: ({ galleryId, }: {
9
+ declare const useFetchGalleryV2: ({ galleryId }: {
10
10
  galleryId: schema.IQueryFetchGalleryV2Args;
11
11
  }) => {
12
12
  clientDataLoading: boolean;
13
13
  clientDataError: import("@apollo/client").ApolloError | undefined;
14
- clientData: GalleryEntityV2 | null;
14
+ clientData: TGallery | null;
15
15
  };
16
16
  export { prefetchGalleryV2, useFetchGalleryV2 };
@@ -1,20 +1,17 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.useFetchGalleryV2 = exports.prefetchGalleryV2 = void 0;
7
- const react_1 = require("react");
4
+ const builder_1 = require("../../../../entities/gallery/builder");
8
5
  const client_1 = require("@apollo/client");
9
6
  const api_1 = require("@ludo.ninja/api");
10
- const GalleryEntityV2_1 = __importDefault(require("../../../../dto/GalleryEntityV2"));
7
+ const react_1 = require("react");
11
8
  const prefetchGalleryV2 = ({ galleryId }, apolloClient) => {
12
9
  return apolloClient
13
10
  .query({
14
11
  query: api_1.galleriesSchema.FetchGalleryV2Document,
15
12
  variables: { galleryId },
16
13
  context: { uri: api_1.hosts.serverGalleriesHost },
17
- fetchPolicy: 'network-only',
14
+ fetchPolicy: "network-only",
18
15
  })
19
16
  .catch(() => {
20
17
  return {
@@ -23,7 +20,7 @@ const prefetchGalleryV2 = ({ galleryId }, apolloClient) => {
23
20
  });
24
21
  };
25
22
  exports.prefetchGalleryV2 = prefetchGalleryV2;
26
- const useFetchGalleryV2 = ({ galleryId, }) => {
23
+ const useFetchGalleryV2 = ({ galleryId }) => {
27
24
  const [gallery, setGallery] = (0, react_1.useState)(null);
28
25
  const { error, loading } = (0, client_1.useQuery)(api_1.galleriesSchema.FetchGalleryV2Document, {
29
26
  variables: { galleryId },
@@ -31,7 +28,7 @@ const useFetchGalleryV2 = ({ galleryId, }) => {
31
28
  uri: api_1.hosts.galleriesHost,
32
29
  },
33
30
  onCompleted: ({ fetchGalleryV2 }) => {
34
- setGallery(new GalleryEntityV2_1.default(fetchGalleryV2));
31
+ setGallery((0, builder_1.buildGallery)(fetchGalleryV2));
35
32
  },
36
33
  onError: () => {
37
34
  setGallery(null);
@@ -1,7 +1,7 @@
1
- import { galleriesSchema as schema } from '@ludo.ninja/api';
2
- import GalleryEntityV2 from '../../../../dto/GalleryEntityV2';
1
+ import { TGallery } from '../../../../entities/gallery/types';
2
+ import { galleriesSchema as schema } from "@ludo.ninja/api";
3
3
  declare const useFetchMyFavoritesV2: () => {
4
- galleryItems: GalleryEntityV2[];
4
+ galleryItems: TGallery[];
5
5
  isNextLoading: boolean;
6
6
  loadMore: () => Promise<void>;
7
7
  load: ({ pageSize, pageToken }: schema.IQueryFetchMyFavoritesV2Args) => void;
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.useFetchMyFavoritesV2 = void 0;
7
- const react_1 = require("react");
4
+ const builder_1 = require("../../../../entities/gallery/builder");
8
5
  const api_1 = require("@ludo.ninja/api");
9
- const GalleryEntityV2_1 = __importDefault(require("../../../../dto/GalleryEntityV2"));
6
+ const react_1 = require("react");
10
7
  const maxUserFavoritesLength = 1000;
11
8
  const useFetchMyFavoritesV2 = () => {
12
9
  const [favorites, setFavorites] = (0, react_1.useState)([]);
@@ -16,12 +13,12 @@ const useFetchMyFavoritesV2 = () => {
16
13
  context: {
17
14
  uri: api_1.hosts.galleriesHost,
18
15
  },
19
- fetchPolicy: 'no-cache',
16
+ fetchPolicy: "no-cache",
20
17
  onCompleted: (data) => {
21
18
  const { fetchMyFavoritesV2: { galleries, nextPageToken }, } = data;
22
19
  if (galleries) {
23
20
  nextPageTokenRef.current = nextPageToken || null;
24
- setFavorites(galleries.map((gallery) => new GalleryEntityV2_1.default(gallery)));
21
+ setFavorites(galleries.map((gallery) => (0, builder_1.buildGallery)(gallery)));
25
22
  }
26
23
  },
27
24
  onError: () => {
@@ -52,10 +49,7 @@ const useFetchMyFavoritesV2 = () => {
52
49
  const { galleries, nextPageToken } = data.fetchMyFavoritesV2;
53
50
  if (galleries) {
54
51
  nextPageTokenRef.current = nextPageToken || null;
55
- setFavorites((prev) => [
56
- ...prev,
57
- ...galleries.map((gallery) => new GalleryEntityV2_1.default(gallery)),
58
- ]);
52
+ setFavorites((prev) => [...prev, ...galleries.map((gallery) => (0, builder_1.buildGallery)(gallery))]);
59
53
  }
60
54
  }
61
55
  finally {
@@ -1,7 +1,7 @@
1
- import { galleriesSchema as schema } from '@ludo.ninja/api';
2
- import GalleryEntityV2 from '../../../../dto/GalleryEntityV2';
1
+ import { TGallery } from '../../../../entities/gallery/types';
2
+ import { galleriesSchema as schema } from "@ludo.ninja/api";
3
3
  declare const useFetchMyGalleriesV2: () => {
4
- galleryItems: GalleryEntityV2[];
4
+ galleryItems: TGallery[];
5
5
  isNextLoading: boolean;
6
6
  loadMore: () => Promise<void>;
7
7
  load: ({ pageSize, pageToken }: schema.IQueryFetchMyGalleriesV2Args) => void;
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.useFetchMyGalleriesV2 = void 0;
7
- const react_1 = require("react");
4
+ const builder_1 = require("../../../../entities/gallery/builder");
8
5
  const client_1 = require("@apollo/client");
9
6
  const api_1 = require("@ludo.ninja/api");
10
- const GalleryEntityV2_1 = __importDefault(require("../../../../dto/GalleryEntityV2"));
7
+ const react_1 = require("react");
11
8
  const maxUserFavoritesLength = 1000;
12
9
  const useFetchMyGalleriesV2 = () => {
13
10
  const [galleries, setGalleries] = (0, react_1.useState)([]);
@@ -18,10 +15,10 @@ const useFetchMyGalleriesV2 = () => {
18
15
  context: {
19
16
  uri: api_1.hosts.galleriesHost,
20
17
  },
21
- fetchPolicy: 'no-cache',
18
+ fetchPolicy: "no-cache",
22
19
  onCompleted: ({ fetchMyGalleriesV2: { galleries, nextPageToken } }) => {
23
20
  nextPageTokenRef.current = nextPageToken || null;
24
- setGalleries(galleries.map((gallery) => new GalleryEntityV2_1.default(gallery)));
21
+ setGalleries(galleries.map((gallery) => (0, builder_1.buildGallery)(gallery)));
25
22
  },
26
23
  onError: () => {
27
24
  nextPageTokenRef.current = null;
@@ -54,10 +51,7 @@ const useFetchMyGalleriesV2 = () => {
54
51
  const { galleries, nextPageToken } = data.fetchMyGalleriesV2;
55
52
  if (galleries) {
56
53
  nextPageTokenRef.current = nextPageToken || null;
57
- setGalleries((prev) => [
58
- ...prev,
59
- ...galleries.map((gallery) => new GalleryEntityV2_1.default(gallery)),
60
- ]);
54
+ setGalleries((prev) => [...prev, ...galleries.map((gallery) => (0, builder_1.buildGallery)(gallery))]);
61
55
  }
62
56
  }
63
57
  finally {
@@ -1,9 +1,9 @@
1
- import { galleriesSchema as schema } from '@ludo.ninja/api';
2
- import GalleryEntityV2 from '../../../../dto/GalleryEntityV2';
3
- declare const useFetchUserFavoritesV2: ({ userId, pageSize, pageToken, }: schema.IQueryFetchUserFavoritesV2Args) => {
1
+ import { TGallery } from '../../../../entities/gallery/types';
2
+ import { galleriesSchema as schema } from "@ludo.ninja/api";
3
+ declare const useFetchUserFavoritesV2: ({ userId, pageSize, pageToken }: schema.IQueryFetchUserFavoritesV2Args) => {
4
4
  loadingFavorites: boolean;
5
5
  error: import("@apollo/client").ApolloError | undefined;
6
- favorites: GalleryEntityV2[];
6
+ favorites: TGallery[];
7
7
  nextPageToken: string | null;
8
8
  refetchQuery: () => Promise<void>;
9
9
  loadMore: (pageToken: string) => Promise<void>;
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.useFetchUserFavoritesV2 = void 0;
7
- const react_1 = require("react");
4
+ const builder_1 = require("../../../../entities/gallery/builder");
8
5
  const client_1 = require("@apollo/client");
9
6
  const api_1 = require("@ludo.ninja/api");
10
- const GalleryEntityV2_1 = __importDefault(require("../../../../dto/GalleryEntityV2"));
7
+ const react_1 = require("react");
11
8
  const maxUserFavoritesLength = 1000;
12
- const useFetchUserFavoritesV2 = ({ userId, pageSize, pageToken, }) => {
9
+ const useFetchUserFavoritesV2 = ({ userId, pageSize, pageToken }) => {
13
10
  const [favorites, setFavorites] = (0, react_1.useState)([]);
14
11
  const [nextPageToken, setNextPageToken] = (0, react_1.useState)(null);
15
12
  const { error, loading, refetch, fetchMore } = (0, client_1.useQuery)(api_1.galleriesSchema.FetchUserFavoritesV2Document, {
@@ -17,10 +14,10 @@ const useFetchUserFavoritesV2 = ({ userId, pageSize, pageToken, }) => {
17
14
  uri: api_1.hosts.galleriesHost,
18
15
  },
19
16
  variables: { pageSize, userId, pageToken },
20
- fetchPolicy: 'no-cache',
17
+ fetchPolicy: "no-cache",
21
18
  onCompleted: ({ fetchUserFavoritesV2: { galleries, nextPageToken } }) => {
22
19
  setNextPageToken(nextPageToken);
23
- setFavorites(galleries.map((gallery) => new GalleryEntityV2_1.default(gallery)));
20
+ setFavorites(galleries.map((gallery) => (0, builder_1.buildGallery)(gallery)));
24
21
  },
25
22
  onError: () => {
26
23
  setNextPageToken(null);
@@ -39,7 +36,7 @@ const useFetchUserFavoritesV2 = ({ userId, pageSize, pageToken, }) => {
39
36
  if (!fetchMoreResult)
40
37
  return prev;
41
38
  const { nextPageToken, favorites: nextFavorites } = fetchMoreResult.fetchUserFavoritesV2;
42
- if (prev !== null && prev.hasOwnProperty('fetchUserFavoritesV2')) {
39
+ if (prev !== null && prev.hasOwnProperty("fetchUserFavoritesV2")) {
43
40
  const { favorites: prevFavorites } = prev.fetchUserFavoritesV2;
44
41
  return {
45
42
  fetchUserFavorites: {
@@ -4,23 +4,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
8
- const ItemType_1 = require("../../../dto/common/ItemType");
7
+ const types_1 = require("../../../entities/labelCreationType/types");
8
+ const likes_1 = __importDefault(require("../../../hooks/likes"));
9
9
  const store_1 = require("../../../modules/user/store");
10
+ const heart_svg_1 = __importDefault(require("../../../public/showCaseIcons/heart"));
10
11
  const IconWithButton_1 = __importDefault(require("../../../system/Buttons/IconWithButton"));
11
12
  const check4k_1 = require("../../../utils/adaptive/check4k");
12
13
  const scale_1 = require("../../../utils/adaptive/scale");
13
14
  const auth_1 = require("../../../utils/auth");
14
15
  const screen_1 = require("../../../utils/screen");
15
- const likes_1 = __importDefault(require("../../../hooks/likes"));
16
- const heart_svg_1 = __importDefault(require("../../../public/showCaseIcons/heart"));
16
+ const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
17
17
  const AssetLikes = ({ assetId, likesByUser, isLikedByUser, }) => {
18
18
  const redirectToLoginWindow = (0, auth_1.useRedirectToLoginWindow)();
19
19
  const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
20
20
  const { likes, addLike, deleteLike, isLoading } = (0, likes_1.default)({
21
21
  defaultLikesCount: likesByUser,
22
22
  defaultIsLiked: isLikedByUser,
23
- itemType: ItemType_1.LabelKeys.asset,
23
+ itemType: types_1.LabelKeys.asset,
24
24
  });
25
25
  const handleLikes = (isLiked) => {
26
26
  if (!isSignedIn) {
@@ -44,7 +44,7 @@ const AssetLikes = ({ assetId, likesByUser, isLikedByUser, }) => {
44
44
  }, height: "100%", width: `${(0, check4k_1.getAdaptiveValueWithCheck4k)({
45
45
  windowDimensions,
46
46
  currentSize: 30,
47
- })}px` })) : ((0, jsx_runtime_1.jsx)(IconWithButton_1.default, { variant: 'figcaption', text: likes.likesCount, onClick: onLikeBtnClick, children: (0, jsx_runtime_1.jsx)("div", { style: {
47
+ })}px` })) : ((0, jsx_runtime_1.jsx)(IconWithButton_1.default, { variant: "figcaption", text: likes.likesCount, onClick: onLikeBtnClick, children: (0, jsx_runtime_1.jsx)("div", { style: {
48
48
  width: `${(0, check4k_1.getAdaptiveValueWithCheck4k)({
49
49
  windowDimensions,
50
50
  currentSize: 18,
@@ -53,6 +53,6 @@ const AssetLikes = ({ assetId, likesByUser, isLikedByUser, }) => {
53
53
  windowDimensions,
54
54
  currentSize: 18,
55
55
  })}px`,
56
- }, children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, { className: `icon ${likes.isLiked ? 'liked' : ''}`, style: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }) }) }) })) }));
56
+ }, children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, { className: `icon ${likes.isLiked ? "liked" : ""}`, style: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }) }) }) })) }));
57
57
  };
58
58
  exports.default = AssetLikes;
@@ -9,8 +9,8 @@ const searchSuggestionsFooter_1 = __importDefault(require("./searchSuggestionsFo
9
9
  const searchSuggestionsItem_1 = __importDefault(require("./searchSuggestionsItem"));
10
10
  const searchSuggestionsItemSkeleton_1 = require("./searchSuggestionsItem/searchSuggestionsItemSkeleton");
11
11
  const searchSuggestionsNotFound_1 = __importDefault(require("./searchSuggestionsNotFound"));
12
- const ItemType_1 = require("../../../dto/common/ItemType");
13
12
  const getAssetMiniatureUrl_1 = require("../../../entities/asset/getAssetMiniatureUrl");
13
+ const types_1 = require("../../../entities/labelCreationType/types");
14
14
  const env_1 = require("../../../store/env");
15
15
  const ScreenWidth_1 = require("../../../styles/ScreenWidth");
16
16
  const Badge_1 = __importDefault(require("../../../system/Badge"));
@@ -82,7 +82,7 @@ const SearchSuggestions = ({ searchTerm, assets, profiles, collections, isLoadin
82
82
  ? [
83
83
  {
84
84
  caption: "NFTs",
85
- children: assets.map((asset) => ((0, jsx_runtime_1.jsx)(searchSuggestionsItem_1.default, { name: asset?.name, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}${asset.assetLink.replace(`${ItemType_1.LabelKeys.asset}/`, "")}`, imgUrl: (0, getAssetMiniatureUrl_1.getAssetMiniatureUrl)({ asset }), searchTerm: searchTerm }, `${asset?.assetId}.${Math.random()}`))),
85
+ children: assets.map((asset) => ((0, jsx_runtime_1.jsx)(searchSuggestionsItem_1.default, { name: asset?.name, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}${asset.assetLink.replace(`${types_1.LabelKeys.asset}/`, "")}`, imgUrl: (0, getAssetMiniatureUrl_1.getAssetMiniatureUrl)({ asset }), searchTerm: searchTerm }, `${asset?.assetId}.${Math.random()}`))),
86
86
  },
87
87
  ]
88
88
  : []),
@@ -1,8 +1,8 @@
1
- import { assetSchema as schema } from '@ludo.ninja/api';
2
- import { BlockChainEntity, MarketPlaceEntity } from '@ludo.ninja/core';
3
1
  import IAssetEntity from './interface';
4
- import { LabelKeys } from '../common/ItemType';
5
2
  import Media from '../common/Media';
3
+ import { LabelKeys } from '../../entities/labelCreationType/types';
4
+ import { assetSchema as schema } from "@ludo.ninja/api";
5
+ import { BlockChainEntity, MarketPlaceEntity } from "@ludo.ninja/core";
6
6
  declare class AssetEntity implements IAssetEntity {
7
7
  private assetId;
8
8
  private blockchain;
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const core_1 = require("@ludo.ninja/core");
7
- const utils_1 = require("@ludo.ninja/utils");
8
6
  const views_1 = require("./views");
9
7
  const AssetObject_1 = __importDefault(require("./views/AssetObject"));
10
- const ItemType_1 = require("../common/ItemType");
8
+ const types_1 = require("../../entities/labelCreationType/types");
9
+ const core_1 = require("@ludo.ninja/core");
10
+ const utils_1 = require("@ludo.ninja/utils");
11
11
  class AssetEntity {
12
12
  assetId;
13
13
  blockchain;
@@ -41,7 +41,7 @@ class AssetEntity {
41
41
  })) || [];
42
42
  this.ownersProfiles = asset.ownersProfiles || null;
43
43
  this.ownersAddresses = asset.ownersAddresses;
44
- this.itemType = ItemType_1.LabelKeys.asset;
44
+ this.itemType = types_1.LabelKeys.asset;
45
45
  this.address = asset.address;
46
46
  this.tokenId = asset.tokenId;
47
47
  this.medias = asset.medias;
@@ -77,7 +77,7 @@ class AssetEntity {
77
77
  return hasMoreThanOneMedia || hasMoreThanOneOriginalUrl;
78
78
  }
79
79
  getSplitedAssetId() {
80
- return this.getAssetId().split('.')[1] || this.getAssetId();
80
+ return this.getAssetId().split(".")[1] || this.getAssetId();
81
81
  }
82
82
  getName() {
83
83
  return this.name ? this.name : null;
@@ -90,21 +90,15 @@ class AssetEntity {
90
90
  }
91
91
  getPrice() {
92
92
  return {
93
- latestPriceAmount: this.price.latestPriceAmount
94
- ? this.price.latestPriceAmount
95
- : null,
96
- latestPriceCurrency: this.price.latestPriceCurrency
97
- ? this.price.latestPriceCurrency
98
- : null,
93
+ latestPriceAmount: this.price.latestPriceAmount ? this.price.latestPriceAmount : null,
94
+ latestPriceCurrency: this.price.latestPriceCurrency ? this.price.latestPriceCurrency : null,
99
95
  };
100
96
  }
101
97
  getBlockTimestamp() {
102
98
  return this.blockTimestamp;
103
99
  }
104
100
  getAttributes() {
105
- return this.attributes?.length
106
- ? this.attributes
107
- : [];
101
+ return this.attributes?.length ? this.attributes : [];
108
102
  }
109
103
  getDescription() {
110
104
  return this.description ? this.description : null;
@@ -114,12 +108,8 @@ class AssetEntity {
114
108
  }
115
109
  getCollection() {
116
110
  return {
117
- collectionId: this.collection.collectionId
118
- ? this.collection.collectionId
119
- : null,
120
- collectionTitle: this.collection.collectionTitle
121
- ? this.collection.collectionTitle
122
- : null,
111
+ collectionId: this.collection.collectionId ? this.collection.collectionId : null,
112
+ collectionTitle: this.collection.collectionTitle ? this.collection.collectionTitle : null,
123
113
  collectionMedias: this.collection.collectionMedias?.length
124
114
  ? this.collection.collectionMedias
125
115
  : [],
@@ -137,7 +127,7 @@ class AssetEntity {
137
127
  const convertedOriginalUrlsArray = [];
138
128
  for (let i = 0; i < this.originalUrls?.length; i++) {
139
129
  convertedOriginalUrlsArray.push({
140
- url: (0, utils_1.checkGltfUrl)(this.originalUrls[i] || ''),
130
+ url: (0, utils_1.checkGltfUrl)(this.originalUrls[i] || ""),
141
131
  mimeType: null,
142
132
  originalMime: null,
143
133
  });
@@ -154,9 +144,8 @@ class AssetEntity {
154
144
  return this.address ? this.address : null;
155
145
  }
156
146
  getAssetLink() {
157
- if (this.getItemType() === ItemType_1.LabelKeys.asset) {
158
- if (this.getBlockchain().getBlockChainPrivateLabel() ===
159
- (core_1.BlockChainKeys.elrond || core_1.BlockChainKeys.solana)) {
147
+ if (this.getItemType() === types_1.LabelKeys.asset) {
148
+ if (this.getBlockchain().getBlockChainPrivateLabel() === (core_1.BlockChainKeys.elrond || core_1.BlockChainKeys.solana)) {
160
149
  return `/${this.getItemType()}/${this.getBlockchain().getBlockChainPrivateLabel()}/${this.getAssetId()}`;
161
150
  }
162
151
  else {
@@ -166,17 +155,13 @@ class AssetEntity {
166
155
  return `/${this.getItemType()}/${this.getAssetId()}`;
167
156
  }
168
157
  getOwnersProfiles() {
169
- return this.ownersProfiles
170
- ? this.ownersProfiles
171
- : [];
158
+ return this.ownersProfiles ? this.ownersProfiles : [];
172
159
  }
173
160
  getAssetMedias() {
174
161
  return this.medias ? this.medias : [];
175
162
  }
176
163
  getAssetMediaType() {
177
- const medias = this.getAssetMedias().length
178
- ? this.getAssetMedias()
179
- : this.getOriginalUrls();
164
+ const medias = this.getAssetMedias().length ? this.getAssetMedias() : this.getOriginalUrls();
180
165
  const detectedMedias = [];
181
166
  medias?.forEach((media) => {
182
167
  detectedMedias.push(this.detectMediaType(media.url, media.mimeType, media.originalUrl, media.originalMime));
@@ -211,9 +196,7 @@ class AssetEntity {
211
196
  return currentMedia;
212
197
  }
213
198
  getCreatorsProfiles() {
214
- return this.creatorsProfiles
215
- ? this.creatorsProfiles
216
- : [];
199
+ return this.creatorsProfiles ? this.creatorsProfiles : [];
217
200
  }
218
201
  getOwnersAddresses() {
219
202
  return this.ownersAddresses ? this.ownersAddresses : null;
@@ -1,7 +1,7 @@
1
+ import IAssetSearchEntity from './interface';
2
+ import { LabelKeys } from '../../entities/labelCreationType/types';
1
3
  import { assetSchema as schema } from "@ludo.ninja/api";
2
4
  import { BlockChainEntity, MarketPlaceEntity } from "@ludo.ninja/core";
3
- import { LabelKeys } from '../common/ItemType';
4
- import IAssetSearchEntity from './interface';
5
5
  declare class AssetSearchEntity implements IAssetSearchEntity {
6
6
  private assetId;
7
7
  private blockchain;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("../../entities/labelCreationType/types");
3
4
  const core_1 = require("@ludo.ninja/core");
4
5
  const utils_1 = require("@ludo.ninja/utils");
5
- const ItemType_1 = require("../common/ItemType");
6
6
  class AssetSearchEntity {
7
7
  assetId;
8
8
  blockchain;
@@ -36,7 +36,7 @@ class AssetSearchEntity {
36
36
  })) || [];
37
37
  this.ownersProfiles = asset.ownersProfiles || null;
38
38
  this.ownersAddresses = asset.ownersAddresses;
39
- this.itemType = ItemType_1.LabelKeys.asset;
39
+ this.itemType = types_1.LabelKeys.asset;
40
40
  this.address = asset.address;
41
41
  this.tokenId = asset.tokenId;
42
42
  this.medias = asset.medias;
@@ -65,9 +65,7 @@ class AssetSearchEntity {
65
65
  return this.assetId;
66
66
  }
67
67
  getIsSlider() {
68
- return this.getAssetMedias()
69
- ? this.getAssetMedias()?.length > 1
70
- : false;
68
+ return this.getAssetMedias() ? this.getAssetMedias()?.length > 1 : false;
71
69
  }
72
70
  getSplitedAssetId() {
73
71
  return this.getAssetId().split(".")[1] || this.getAssetId();
@@ -83,21 +81,15 @@ class AssetSearchEntity {
83
81
  }
84
82
  getPrice() {
85
83
  return {
86
- latestPriceAmount: this.price.latestPriceAmount
87
- ? this.price.latestPriceAmount
88
- : null,
89
- latestPriceCurrency: this.price.latestPriceCurrency
90
- ? this.price.latestPriceCurrency
91
- : null,
84
+ latestPriceAmount: this.price.latestPriceAmount ? this.price.latestPriceAmount : null,
85
+ latestPriceCurrency: this.price.latestPriceCurrency ? this.price.latestPriceCurrency : null,
92
86
  };
93
87
  }
94
88
  getBlockTimestamp() {
95
89
  return this.blockTimestamp;
96
90
  }
97
91
  getAttributes() {
98
- return this.attributes?.length
99
- ? this.attributes
100
- : [];
92
+ return this.attributes?.length ? this.attributes : [];
101
93
  }
102
94
  getDescription() {
103
95
  return this.description ? this.description : null;
@@ -107,12 +99,8 @@ class AssetSearchEntity {
107
99
  }
108
100
  getCollection() {
109
101
  return {
110
- collectionId: this.collection.collectionId
111
- ? this.collection.collectionId
112
- : null,
113
- collectionTitle: this.collection.collectionTitle
114
- ? this.collection.collectionTitle
115
- : null,
102
+ collectionId: this.collection.collectionId ? this.collection.collectionId : null,
103
+ collectionTitle: this.collection.collectionTitle ? this.collection.collectionTitle : null,
116
104
  collectionMedias: this.collection.collectionMedias?.length
117
105
  ? this.collection.collectionMedias
118
106
  : [],
@@ -147,9 +135,8 @@ class AssetSearchEntity {
147
135
  return this.address ? this.address : null;
148
136
  }
149
137
  getAssetLink() {
150
- if (this.getItemType() === ItemType_1.LabelKeys.asset) {
151
- if (this.getBlockchain().getBlockChainPrivateLabel() ===
152
- (core_1.BlockChainKeys.elrond || core_1.BlockChainKeys.solana)) {
138
+ if (this.getItemType() === types_1.LabelKeys.asset) {
139
+ if (this.getBlockchain().getBlockChainPrivateLabel() === (core_1.BlockChainKeys.elrond || core_1.BlockChainKeys.solana)) {
153
140
  return `/${this.getItemType()}/${this.getBlockchain().getBlockChainPrivateLabel()}/${this.getAssetId()}`;
154
141
  }
155
142
  else {
@@ -159,17 +146,13 @@ class AssetSearchEntity {
159
146
  return `/${this.getItemType()}/${this.getAssetId()}`;
160
147
  }
161
148
  getOwnersProfiles() {
162
- return this.ownersProfiles
163
- ? this.ownersProfiles
164
- : [];
149
+ return this.ownersProfiles ? this.ownersProfiles : [];
165
150
  }
166
151
  getAssetMedias() {
167
152
  return this.medias ? this.medias : [];
168
153
  }
169
154
  getCreatorsProfiles() {
170
- return this.creatorsProfiles
171
- ? this.creatorsProfiles
172
- : [];
155
+ return this.creatorsProfiles ? this.creatorsProfiles : [];
173
156
  }
174
157
  getOwnersAddresses() {
175
158
  return this.ownersAddresses ? this.ownersAddresses : null;
@@ -1,8 +1,8 @@
1
- import { collectionsSchema as schema } from '@ludo.ninja/api';
2
- import { BlockChainEntity } from '@ludo.ninja/core';
3
1
  import ICollectionCreationEntity from './interface';
4
- import { LabelKeys, LabelType } from '../../common/ItemType';
5
2
  import Media from '../../common/Media';
3
+ import { LabelKeys, LabelType } from '../../../entities/labelCreationType/types';
4
+ import { collectionsSchema as schema } from "@ludo.ninja/api";
5
+ import { BlockChainEntity } from "@ludo.ninja/core";
6
6
  declare class CollectionCreationEntity implements ICollectionCreationEntity {
7
7
  private collectionId;
8
8
  private collectionTitle;
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const core_1 = require("@ludo.ninja/core");
7
- const utils_1 = require("@ludo.ninja/utils");
8
- const ItemType_1 = require("../../common/ItemType");
9
- const data_1 = __importDefault(require("../../common/ItemType/data"));
10
6
  const CreationAudio_1 = __importDefault(require("../../common/ItemViews/CreationAudio"));
11
7
  const CreationImage_1 = __importDefault(require("../../common/ItemViews/CreationImage"));
12
8
  const CreationObject_1 = __importDefault(require("../../common/ItemViews/CreationObject"));
13
9
  const CreationOther_1 = __importDefault(require("../../common/ItemViews/CreationOther"));
14
10
  const CreationVideo_1 = __importDefault(require("../../common/ItemViews/CreationVideo"));
11
+ const data_1 = __importDefault(require("../../../entities/labelCreationType/data"));
12
+ const types_1 = require("../../../entities/labelCreationType/types");
13
+ const core_1 = require("@ludo.ninja/core");
14
+ const utils_1 = require("@ludo.ninja/utils");
15
15
  class CollectionCreationEntity {
16
16
  collectionId;
17
17
  collectionTitle;
@@ -43,13 +43,13 @@ class CollectionCreationEntity {
43
43
  this.liked = collectionAsset.liked;
44
44
  this.medias = collectionAsset.medias;
45
45
  this.collectionCreationId = collectionAsset.assetId;
46
- this.itemType = type ?? ItemType_1.LabelKeys.asset;
46
+ this.itemType = type ?? types_1.LabelKeys.asset;
47
47
  }
48
48
  getCreationId() {
49
- return this.collectionId ? this.collectionId : '';
49
+ return this.collectionId ? this.collectionId : "";
50
50
  }
51
51
  getId() {
52
- return this.id ? this.id : '';
52
+ return this.id ? this.id : "";
53
53
  }
54
54
  getItemType() {
55
55
  return this.itemType;
@@ -58,13 +58,13 @@ class CollectionCreationEntity {
58
58
  return this.address ? this.address : null;
59
59
  }
60
60
  getTokenId() {
61
- return this.tokenId ? this.tokenId : '';
61
+ return this.tokenId ? this.tokenId : "";
62
62
  }
63
63
  getCollectionCreationId() {
64
- return this.collectionCreationId ? this.collectionCreationId : '';
64
+ return this.collectionCreationId ? this.collectionCreationId : "";
65
65
  }
66
66
  getCreationLink() {
67
- if (this.getItemType() === ItemType_1.LabelKeys.asset) {
67
+ if (this.getItemType() === types_1.LabelKeys.asset) {
68
68
  const blockChainPrivateLabel = this.getBlockchain().getBlockChainPrivateLabel();
69
69
  if (blockChainPrivateLabel === core_1.BlockChainKeys.elrond) {
70
70
  return `/${this.getItemType()}/${this.getBlockchain().getBlockChainPrivateLabel()}/${this.getId()}`;
@@ -101,7 +101,7 @@ class CollectionCreationEntity {
101
101
  return null;
102
102
  const convertedOriginalUrlsArray = [];
103
103
  for (let i = 0; i < this.originalUrls?.length; i++) {
104
- convertedOriginalUrlsArray.push((0, utils_1.checkGltfUrl)(this.originalUrls[i] || ''));
104
+ convertedOriginalUrlsArray.push((0, utils_1.checkGltfUrl)(this.originalUrls[i] || ""));
105
105
  }
106
106
  return convertedOriginalUrlsArray;
107
107
  }
@@ -163,10 +163,10 @@ class CollectionCreationEntity {
163
163
  return null;
164
164
  return isMobileView
165
165
  ? this.name && this.name.length >= 20
166
- ? this.name?.substring(0, 22).concat('...')
166
+ ? this.name?.substring(0, 22).concat("...")
167
167
  : this.name
168
168
  : this.name && this.name.length >= 11
169
- ? this.name?.substring(0, 13).concat('...')
169
+ ? this.name?.substring(0, 13).concat("...")
170
170
  : this.name;
171
171
  }
172
172
  }
@@ -1,6 +1,6 @@
1
- import { BlockChainEntity } from '@ludo.ninja/core';
2
- import { LabelKeys, LabelType } from '../../common/ItemType';
3
1
  import Media from '../../common/Media';
2
+ import { LabelKeys, LabelType } from '../../../entities/labelCreationType/types';
3
+ import { BlockChainEntity } from "@ludo.ninja/core";
4
4
  interface ICollectionCreationEntity {
5
5
  getItemType(): LabelKeys;
6
6
  getId(): string;