@ludo.ninja/components 2.2.36 → 2.2.38

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 (92) 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/api/server-search/queries/useFetchAllCreations/index.d.ts +7 -7
  10. package/build/api/server-search/queries/useFetchAllCreations/index.js +7 -10
  11. package/build/api/server-search/queries/useFetchCollections/index.d.ts +6 -6
  12. package/build/api/server-search/queries/useFetchCollections/index.js +10 -12
  13. package/build/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +4 -4
  14. package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +8 -11
  15. package/build/api/server-search/queries/useFindCreations/index.d.ts +7 -7
  16. package/build/api/server-search/queries/useFindCreations/index.js +9 -12
  17. package/build/api/server-search/queries/useFindUserCreations/index.d.ts +3 -3
  18. package/build/api/server-search/queries/useFindUserCreations/index.js +7 -10
  19. package/build/api/server-search/queries/useFindUserLudoCreations/index.d.ts +3 -3
  20. package/build/api/server-search/queries/useFindUserLudoCreations/index.js +7 -10
  21. package/build/components/assetPage/assetLikes/index.js +7 -7
  22. package/build/components/gallery/add/addCreationToGallery/index.js +7 -7
  23. package/build/components/search/searchSuggestions/index.js +2 -2
  24. package/build/dto/AssetEntity/index.d.ts +3 -3
  25. package/build/dto/AssetEntity/index.js +16 -33
  26. package/build/dto/AssetSearchEntity/index.d.ts +2 -2
  27. package/build/dto/AssetSearchEntity/index.js +12 -29
  28. package/build/dto/Collection/CollectionCreationEntity/index.d.ts +3 -3
  29. package/build/dto/Collection/CollectionCreationEntity/index.js +13 -13
  30. package/build/dto/Collection/CollectionCreationEntity/interface.d.ts +2 -2
  31. package/build/dto/Collection/CollectionEntity/index.d.ts +2 -2
  32. package/build/dto/Collection/CollectionEntity/index.js +1 -1
  33. package/build/dto/CreationEntity/index.d.ts +3 -3
  34. package/build/dto/CreationEntity/index.js +9 -9
  35. package/build/dto/GalleryEntityV2/index.d.ts +4 -4
  36. package/build/dto/GalleryEntityV2/index.js +6 -8
  37. package/build/dto/common/ItemType/data.d.ts +1 -1
  38. package/build/dto/common/ItemType/data.js +25 -25
  39. package/build/entities/creation/collectionCreationBuilder.d.ts +2 -2
  40. package/build/entities/creation/collectionCreationBuilder.js +4 -3
  41. package/build/entities/gallery/builder.js +1 -1
  42. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +6 -7
  43. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +19 -23
  44. package/build/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +8 -9
  45. package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +25 -38
  46. package/build/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +8 -9
  47. package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +25 -38
  48. package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.d.ts +6 -6
  49. package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +15 -17
  50. package/build/hooks/likes/dynamic/useFindCreationsAndLikes.d.ts +4 -4
  51. package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +12 -15
  52. package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.d.ts +4 -4
  53. package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +11 -18
  54. package/build/hooks/likes/dynamic/useGetCreationsAndLikes.d.ts +4 -5
  55. package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +12 -17
  56. package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.d.ts +4 -4
  57. package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +16 -19
  58. package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +5 -6
  59. package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.js +9 -10
  60. package/build/hooks/likes/dynamic/useGetTableLikes.d.ts +4 -5
  61. package/build/hooks/likes/dynamic/useGetTableLikes.js +14 -21
  62. package/build/hooks/likes/index.d.ts +1 -1
  63. package/build/hooks/likes/index.js +12 -12
  64. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +5 -5
  65. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +39 -47
  66. package/build/modules/gallery/store.d.ts +3 -3
  67. package/build/modules/gallery/store.js +7 -11
  68. package/build/modules/gallery/ui/EditGallery.d.ts +2 -2
  69. package/build/modules/gallery/ui/EditGallery.js +11 -11
  70. package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +3 -3
  71. package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +1 -1
  72. package/build/modules/gallery/ui/chooseGalleryItems/index.d.ts +1 -1
  73. package/build/modules/gallery/ui/chooseGalleryItems/index.js +19 -20
  74. package/build/modules/gallery/ui/itemsPreview/index.d.ts +2 -3
  75. package/build/modules/gallery/ui/itemsPreview/index.js +9 -4
  76. package/build/modules/gallery/useToGalleryAsset.d.ts +5 -5
  77. package/build/modules/gallery/useToGalleryAsset.js +7 -7
  78. package/build/modules/opportunity/OpportunityCard.js +25 -27
  79. package/build/modules/virtuoso/types.d.ts +0 -3
  80. package/build/system/Cards/CardContent/CardCategory/CardCategory.test.d.ts +1 -1
  81. package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +9 -9
  82. package/build/system/Cards/CardContent/CardCategory/index.d.ts +1 -1
  83. package/build/system/Cards/CardContent/CardCategory/index.js +3 -3
  84. package/build/system/Cards/CreationCard/CardHead.d.ts +2 -3
  85. package/build/system/Cards/CreationCard/CardHead.js +16 -30
  86. package/build/system/Cards/CreationCard/index.d.ts +4 -4
  87. package/build/system/Cards/CreationCard/index.js +10 -9
  88. package/build/system/Cards/MultiMediaCard/index.d.ts +5 -6
  89. package/build/system/Cards/MultiMediaCard/index.js +8 -7
  90. package/build/utils/extractItemIds.d.ts +2 -2
  91. package/build/utils/extractItemIds.js +1 -7
  92. package/package.json +1 -1
@@ -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
- const react_1 = require("react");
7
- const api_1 = require("@ludo.ninja/api");
3
+ const builder_1 = require("../../../../entities/creation/builder");
8
4
  const getPageSizeAssets_1 = require("../../../../utils/getPageSizeAssets");
9
- const CreationEntity_1 = __importDefault(require("../../../../dto/CreationEntity"));
5
+ const api_1 = require("@ludo.ninja/api");
6
+ const react_1 = require("react");
10
7
  const limit = 20;
11
8
  const useFindUserCreations = ({ ownerId, input, scrollTab, }) => {
12
9
  const [creations, setCreations] = (0, react_1.useState)([]);
@@ -19,9 +16,9 @@ const useFindUserCreations = ({ ownerId, input, scrollTab, }) => {
19
16
  context: {
20
17
  uri: api_1.hosts.searchHost,
21
18
  },
22
- fetchPolicy: 'no-cache',
19
+ fetchPolicy: "no-cache",
23
20
  onCompleted: ({ findUserCreations: { creations, ...nextPage } }) => {
24
- setCreations(creations.map((creation) => new CreationEntity_1.default(creation)));
21
+ setCreations(creations.map((creation) => (0, builder_1.buildCreation)(creation)));
25
22
  setResults(nextPage.nextPage?.elements || 0);
26
23
  setIsLoading(false);
27
24
  nextPageToken.current = nextPage.nextPage?.token || null;
@@ -43,7 +40,7 @@ const useFindUserCreations = ({ ownerId, input, scrollTab, }) => {
43
40
  scrollTab,
44
41
  limit,
45
42
  }),
46
- token: '',
43
+ token: "",
47
44
  },
48
45
  },
49
46
  });
@@ -72,7 +69,7 @@ const useFindUserCreations = ({ ownerId, input, scrollTab, }) => {
72
69
  const { creations: nextCreations, ...nextPage } = data.findUserCreations;
73
70
  setCreations((prevCreations) => [
74
71
  ...prevCreations,
75
- ...nextCreations.map((creation) => new CreationEntity_1.default(creation)),
72
+ ...nextCreations.map((creation) => (0, builder_1.buildCreation)(creation)),
76
73
  ]);
77
74
  setResults(nextPage.nextPage?.elements || 0);
78
75
  nextPageToken.current = nextPage.nextPage?.token || null;
@@ -1,5 +1,5 @@
1
- import { searchSchema as schema } from '@ludo.ninja/api';
2
- import CreationEntity from '../../../../dto/CreationEntity';
1
+ import { TCreation } from '../../../../entities/creation/types';
2
+ import { searchSchema as schema } from "@ludo.ninja/api";
3
3
  declare const useFindUserLudoCreations: ({ ownerId, scrollTab, }: {
4
4
  scrollTab: string | undefined;
5
5
  ownerId: schema.IQueryFindUserLudoCreationsArgs["ownerId"];
@@ -7,7 +7,7 @@ declare const useFindUserLudoCreations: ({ ownerId, scrollTab, }: {
7
7
  isLoading: boolean;
8
8
  error: import("@apollo/client").ApolloError | undefined;
9
9
  totalResults: number;
10
- creations: CreationEntity[];
10
+ creations: TCreation[];
11
11
  refetchQuery: () => Promise<void>;
12
12
  loadMore: () => Promise<void>;
13
13
  isNextLoading: boolean;
@@ -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
- const react_1 = require("react");
7
- const api_1 = require("@ludo.ninja/api");
3
+ const builder_1 = require("../../../../entities/creation/builder");
8
4
  const getPageSizeAssets_1 = require("../../../../utils/getPageSizeAssets");
9
- const CreationEntity_1 = __importDefault(require("../../../../dto/CreationEntity"));
5
+ const api_1 = require("@ludo.ninja/api");
6
+ const react_1 = require("react");
10
7
  const limit = 20;
11
8
  const useFindUserLudoCreations = ({ ownerId, scrollTab, }) => {
12
9
  const [creations, setCreations] = (0, react_1.useState)([]);
@@ -19,9 +16,9 @@ const useFindUserLudoCreations = ({ ownerId, scrollTab, }) => {
19
16
  context: {
20
17
  uri: api_1.hosts.searchHost,
21
18
  },
22
- fetchPolicy: 'no-cache',
19
+ fetchPolicy: "no-cache",
23
20
  onCompleted: ({ findUserLudoCreations: { creations, ...nextPage } }) => {
24
- setCreations(creations.map((creation) => new CreationEntity_1.default(creation)));
21
+ setCreations(creations.map((creation) => (0, builder_1.buildCreation)(creation)));
25
22
  setResults(nextPage.nextPage?.elements || 0);
26
23
  setIsLoading(false);
27
24
  nextPageToken.current = nextPage.nextPage?.token || null;
@@ -42,7 +39,7 @@ const useFindUserLudoCreations = ({ ownerId, scrollTab, }) => {
42
39
  scrollTab,
43
40
  limit,
44
41
  }),
45
- token: '',
42
+ token: "",
46
43
  },
47
44
  },
48
45
  });
@@ -70,7 +67,7 @@ const useFindUserLudoCreations = ({ ownerId, scrollTab, }) => {
70
67
  const { creations: nextCreations, ...nextPage } = data.findUserLudoCreations;
71
68
  setCreations((prevCreations) => [
72
69
  ...prevCreations,
73
- ...nextCreations.map((creation) => new CreationEntity_1.default(creation)),
70
+ ...nextCreations.map((creation) => (0, builder_1.buildCreation)(creation)),
74
71
  ]);
75
72
  setResults(nextPage.nextPage?.elements || 0);
76
73
  nextPageToken.current = nextPage.nextPage?.token || null;
@@ -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;
@@ -4,15 +4,15 @@ 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_1 = require("react");
8
- const styled_components_1 = __importDefault(require("styled-components"));
7
+ const useAddCreationsToGallery_1 = require("../../../../api/server-galleries/mutations/useAddCreationsToGallery");
8
+ const useCreateGallery_1 = require("../../../../api/server-galleries/mutations/useCreateGallery");
9
9
  const chooseGalleryItems_1 = __importDefault(require("../../../../modules/gallery/ui/chooseGalleryItems"));
10
10
  const createGalleryForm_1 = __importDefault(require("../../../../modules/gallery/ui/createGalleryForm"));
11
11
  const itemsPreview_1 = __importDefault(require("../../../../modules/gallery/ui/itemsPreview"));
12
12
  const useToGalleryAsset_1 = require("../../../../modules/gallery/useToGalleryAsset");
13
13
  const ui_1 = require("../../../../store/ui");
14
- const useAddCreationsToGallery_1 = require("../../../../api/server-galleries/mutations/useAddCreationsToGallery");
15
- const useCreateGallery_1 = require("../../../../api/server-galleries/mutations/useCreateGallery");
14
+ const react_1 = require("react");
15
+ const styled_components_1 = __importDefault(require("styled-components"));
16
16
  // Styles
17
17
  const StyledAddGallery = styled_components_1.default.div `
18
18
  display: flex;
@@ -37,12 +37,12 @@ const AddCreationToGallery = () => {
37
37
  actionResetCheckboxes();
38
38
  closeModalSidebarPortal();
39
39
  };
40
- const ids = creationsToGallery.map((creations) => creations.getCreationId());
41
- return ((0, jsx_runtime_1.jsxs)(StyledAddGallery, { children: [(0, jsx_runtime_1.jsx)(itemsPreview_1.default, { creations: creationsToGallery, title: 'Add to Gallery', deleteMethod: (itemId) => {
40
+ const ids = creationsToGallery.map((creations) => creations.creationId);
41
+ return ((0, jsx_runtime_1.jsxs)(StyledAddGallery, { children: [(0, jsx_runtime_1.jsx)(itemsPreview_1.default, { creations: creationsToGallery, title: "Add to Gallery", deleteMethod: (itemId) => {
42
42
  removeCreationFromGalleryWithCallback(itemId, closeModalSidebarPortal);
43
43
  } }), isNeedAddGallery ? ((0, jsx_runtime_1.jsx)(createGalleryForm_1.default, { setAddGallery: setAddGallery,
44
44
  // ids={ids as string[]}
45
- title: 'Create Gallery', createMethod: createGallery, inputPlaceHolderText: 'Gallery Name', error: errorCreateGallery })) : ((0, jsx_runtime_1.jsx)(chooseGalleryItems_1.default, { setAddGallery: setAddGallery, title: 'Choose Gallery', titleBtn: '+ New Gallery', ids: ids, addMethod: addMethod, isAdded: isAdded, error: error, isGetMyGalleries: true }))] }));
45
+ title: "Create Gallery", createMethod: createGallery, inputPlaceHolderText: "Gallery Name", error: errorCreateGallery })) : ((0, jsx_runtime_1.jsx)(chooseGalleryItems_1.default, { setAddGallery: setAddGallery, title: "Choose Gallery", titleBtn: "+ New Gallery", ids: ids, addMethod: addMethod, isAdded: isAdded, error: error, isGetMyGalleries: true }))] }));
46
46
  };
47
47
  // Export
48
48
  exports.default = AddCreationToGallery;
@@ -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;
@@ -1,6 +1,6 @@
1
- import { collectionsSchema } from '@ludo.ninja/api';
2
- import { BlockChainEntity, MarketPlaceEntity, ProfileEntity } from '@ludo.ninja/core';
3
1
  import ICollectionEntity from './interface';
2
+ import { collectionsSchema } from "@ludo.ninja/api";
3
+ import { BlockChainEntity, MarketPlaceEntity, ProfileEntity } from "@ludo.ninja/core";
4
4
  declare class CollectionEntity implements ICollectionEntity {
5
5
  private collectionTitle;
6
6
  private collectionId;
@@ -34,7 +34,7 @@ class CollectionEntity {
34
34
  this.liked = collection.liked;
35
35
  }
36
36
  getCollectionId() {
37
- return this.collectionId ? this.collectionId : 'no id';
37
+ return this.collectionId ? this.collectionId : "no id";
38
38
  }
39
39
  getBlockchain() {
40
40
  return this.blockchain;
@@ -1,8 +1,8 @@
1
- import { searchSchema as schema } from '@ludo.ninja/api';
2
- import { BlockChainEntity } from '@ludo.ninja/core';
3
1
  import ICreationEntity 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 { searchSchema as schema } from "@ludo.ninja/api";
5
+ import { BlockChainEntity } from "@ludo.ninja/core";
6
6
  declare class CreationEntity implements ICreationEntity {
7
7
  private itemId;
8
8
  private itemType;