@ludo.ninja/components 2.2.35 → 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.
- package/build/api/server-galleries/queries/useFetchGallery/index.d.ts +5 -5
- package/build/api/server-galleries/queries/useFetchGallery/index.js +5 -8
- package/build/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +3 -3
- package/build/api/server-galleries/queries/useFetchMyFavorites/index.js +5 -11
- package/build/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +3 -3
- package/build/api/server-galleries/queries/useFetchMyGalleries/index.js +5 -11
- package/build/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +4 -4
- package/build/api/server-galleries/queries/useFetchUserFavorites/index.js +6 -9
- package/build/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.d.ts +6 -6
- package/build/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.js +4 -7
- package/build/components/assetPage/assetLikes/index.js +7 -7
- package/build/components/search/searchSuggestions/index.d.ts +2 -2
- package/build/components/search/searchSuggestions/index.js +4 -46
- package/build/dto/AssetEntity/index.d.ts +3 -3
- package/build/dto/AssetEntity/index.js +16 -33
- package/build/dto/AssetSearchEntity/index.d.ts +2 -2
- package/build/dto/AssetSearchEntity/index.js +12 -29
- package/build/dto/Collection/CollectionCreationEntity/index.d.ts +3 -3
- package/build/dto/Collection/CollectionCreationEntity/index.js +13 -13
- package/build/dto/Collection/CollectionCreationEntity/interface.d.ts +2 -2
- package/build/dto/Collection/CollectionEntity/index.d.ts +2 -2
- package/build/dto/Collection/CollectionEntity/index.js +1 -1
- package/build/dto/CreationEntity/index.d.ts +3 -3
- package/build/dto/CreationEntity/index.js +9 -9
- package/build/dto/GalleryEntityV2/index.d.ts +4 -4
- package/build/dto/GalleryEntityV2/index.js +6 -8
- package/build/dto/common/ItemType/data.d.ts +1 -1
- package/build/dto/common/ItemType/data.js +25 -25
- package/build/entities/asset/AssetMediasViews.js +6 -6
- package/build/entities/asset/builder.js +2 -2
- package/build/entities/asset/{assetMediasOpengraph.d.ts → getAssetMediasOpengraph.d.ts} +1 -1
- package/build/entities/asset/{assetMediasOpengraph.js → getAssetMediasOpengraph.js} +7 -7
- package/build/entities/asset/getAssetMiniatureUrl.d.ts +4 -0
- package/build/entities/asset/getAssetMiniatureUrl.js +37 -0
- package/build/entities/asset/types.d.ts +1 -1
- package/build/entities/collection/builder.d.ts +3 -0
- package/build/entities/collection/builder.js +31 -0
- package/build/entities/collection/types.d.ts +17 -0
- package/build/entities/collection/types.js +2 -0
- package/build/entities/creation/CreationMediaView.d.ts +4 -0
- package/build/entities/creation/CreationMediaView.js +46 -0
- package/build/entities/creation/builder.d.ts +3 -0
- package/build/entities/creation/builder.js +63 -0
- package/build/entities/creation/collectionCreationBuilder.d.ts +3 -0
- package/build/entities/creation/collectionCreationBuilder.js +25 -0
- package/build/entities/creation/types.d.ts +23 -0
- package/build/entities/creation/types.js +2 -0
- package/build/entities/gallery/builder.d.ts +3 -0
- package/build/entities/gallery/builder.js +35 -0
- package/build/entities/gallery/types.d.ts +18 -0
- package/build/entities/gallery/types.js +2 -0
- package/build/entities/labelCreationType/data.d.ts +3 -0
- package/build/entities/labelCreationType/data.js +36 -0
- package/build/entities/labelCreationType/types.d.ts +45 -0
- package/build/entities/labelCreationType/types.js +42 -0
- package/build/entities/media/builder.d.ts +4 -0
- package/build/entities/media/builder.js +11 -1
- package/build/entities/media/types.d.ts +1 -1
- package/build/entities/media/urls.d.ts +31 -0
- package/build/entities/media/urls.js +125 -0
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +4 -4
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +17 -19
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +5 -5
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +23 -33
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +5 -5
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +23 -33
- package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +1 -1
- package/build/hooks/likes/index.d.ts +1 -1
- package/build/hooks/likes/index.js +12 -12
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +4 -4
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +35 -40
- package/build/modules/gallery/store.d.ts +3 -3
- package/build/modules/gallery/store.js +7 -11
- package/build/modules/gallery/ui/EditGallery.d.ts +2 -2
- package/build/modules/gallery/ui/EditGallery.js +11 -11
- package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +3 -3
- package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +1 -1
- package/build/modules/gallery/ui/chooseGalleryItems/index.d.ts +1 -1
- package/build/modules/gallery/ui/chooseGalleryItems/index.js +19 -20
- package/build/modules/opportunity/OpportunityCard.js +25 -27
- package/build/system/Cards/CardContent/CardCategory/CardCategory.test.d.ts +1 -1
- package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +9 -9
- package/build/system/Cards/CardContent/CardCategory/index.d.ts +1 -1
- package/build/system/Cards/CardContent/CardCategory/index.js +3 -3
- package/build/system/Cards/CreationCard/CardHead.js +16 -21
- package/build/system/Cards/CreationCard/index.d.ts +2 -2
- package/build/system/Cards/CreationCard/index.js +5 -5
- package/build/system/Cards/MultiMediaCard/index.d.ts +2 -2
- package/build/system/Cards/MultiMediaCard/index.js +3 -3
- package/package.json +1 -1
|
@@ -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 =
|
|
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
|
-
|
|
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
|
-
|
|
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() ===
|
|
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 ??
|
|
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() ===
|
|
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;
|
|
@@ -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;
|
|
@@ -3,14 +3,14 @@ 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 ItemType_1 = require("../common/ItemType");
|
|
8
|
-
const data_1 = __importDefault(require("../common/ItemType/data"));
|
|
9
6
|
const CreationAudio_1 = __importDefault(require("../common/ItemViews/CreationAudio"));
|
|
10
7
|
const CreationImage_1 = __importDefault(require("../common/ItemViews/CreationImage"));
|
|
11
8
|
const CreationObject_1 = __importDefault(require("../common/ItemViews/CreationObject"));
|
|
12
9
|
const CreationOther_1 = __importDefault(require("../common/ItemViews/CreationOther"));
|
|
13
10
|
const CreationVideo_1 = __importDefault(require("../common/ItemViews/CreationVideo"));
|
|
11
|
+
const types_1 = require("../../entities/labelCreationType/types");
|
|
12
|
+
const data_1 = __importDefault(require("../../entities/labelCreationType/data"));
|
|
13
|
+
const core_1 = require("@ludo.ninja/core");
|
|
14
14
|
class CreationEntity {
|
|
15
15
|
itemId;
|
|
16
16
|
itemType;
|
|
@@ -57,13 +57,13 @@ class CreationEntity {
|
|
|
57
57
|
}
|
|
58
58
|
// accessors
|
|
59
59
|
getAddress() {
|
|
60
|
-
return this.address ? this.address :
|
|
60
|
+
return this.address ? this.address : "";
|
|
61
61
|
}
|
|
62
62
|
getId() {
|
|
63
|
-
return this.id ? this.id :
|
|
63
|
+
return this.id ? this.id : "";
|
|
64
64
|
}
|
|
65
65
|
getTokenId() {
|
|
66
|
-
return this.tokenId ? this.tokenId :
|
|
66
|
+
return this.tokenId ? this.tokenId : "";
|
|
67
67
|
}
|
|
68
68
|
getItemId() {
|
|
69
69
|
return this.itemId;
|
|
@@ -87,7 +87,7 @@ class CreationEntity {
|
|
|
87
87
|
return this.isCheckboxSelected;
|
|
88
88
|
}
|
|
89
89
|
getCreationLink() {
|
|
90
|
-
if (this.getItemType() ===
|
|
90
|
+
if (this.getItemType() === types_1.LabelKeys.asset) {
|
|
91
91
|
const blockChainPrivateLabel = this.getBlockchain().getBlockChainPrivateLabel();
|
|
92
92
|
if (blockChainPrivateLabel === core_1.BlockChainKeys.elrond) {
|
|
93
93
|
return `/${this.getItemType()}/${this.getBlockchain().getBlockChainPrivateLabel()}/${this.getId()}`;
|
|
@@ -144,10 +144,10 @@ class CreationEntity {
|
|
|
144
144
|
return null;
|
|
145
145
|
return isMobileView
|
|
146
146
|
? this.name && this.name.length >= 20
|
|
147
|
-
? this.name?.substring(0, 22).concat(
|
|
147
|
+
? this.name?.substring(0, 22).concat("...")
|
|
148
148
|
: this.name
|
|
149
149
|
: this.name && this.name.length >= 11
|
|
150
|
-
? this.name?.substring(0, 13).concat(
|
|
150
|
+
? this.name?.substring(0, 13).concat("...")
|
|
151
151
|
: this.name;
|
|
152
152
|
}
|
|
153
153
|
// methods
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { LabelKeys, LabelType } from "../common/ItemType";
|
|
2
|
+
import IGalleryEntityV2 from "./interface";
|
|
3
|
+
import { galleriesSchema as schema } from "@ludo.ninja/api";
|
|
4
|
+
import { ProfileEntity } from "@ludo.ninja/core";
|
|
5
5
|
declare class GalleryEntityV2 implements IGalleryEntityV2 {
|
|
6
6
|
private galleryId;
|
|
7
7
|
private galleryType;
|
|
@@ -3,8 +3,8 @@ 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 data_1 = __importDefault(require("../../entities/labelCreationType/data"));
|
|
6
7
|
const core_1 = require("@ludo.ninja/core");
|
|
7
|
-
const data_1 = __importDefault(require("../common/ItemType/data"));
|
|
8
8
|
class GalleryEntityV2 {
|
|
9
9
|
galleryId;
|
|
10
10
|
galleryType;
|
|
@@ -45,10 +45,10 @@ class GalleryEntityV2 {
|
|
|
45
45
|
return this.galleryId;
|
|
46
46
|
}
|
|
47
47
|
getGalleryUsername() {
|
|
48
|
-
return this.username ??
|
|
48
|
+
return this.username ?? "";
|
|
49
49
|
}
|
|
50
50
|
getGalleryUserpic() {
|
|
51
|
-
return this.userpic ??
|
|
51
|
+
return this.userpic ?? "";
|
|
52
52
|
}
|
|
53
53
|
getGalleryUserWallets() {
|
|
54
54
|
return this.userWallets;
|
|
@@ -57,15 +57,13 @@ class GalleryEntityV2 {
|
|
|
57
57
|
return this.name;
|
|
58
58
|
}
|
|
59
59
|
getGalleryItemsCount() {
|
|
60
|
-
return this.items
|
|
61
|
-
? `${this?.items > 1 ? `${this?.items} items` : `${this?.items} item`}`
|
|
62
|
-
: '0 items';
|
|
60
|
+
return this.items ? `${this?.items > 1 ? `${this?.items} items` : `${this?.items} item`}` : "0 items";
|
|
63
61
|
}
|
|
64
62
|
getGalleryCreationIds() {
|
|
65
63
|
return this.creationIds ? this.creationIds : [];
|
|
66
64
|
}
|
|
67
65
|
getGalleryDescription() {
|
|
68
|
-
return this.description ? this.description :
|
|
66
|
+
return this.description ? this.description : "";
|
|
69
67
|
}
|
|
70
68
|
getGalleryType() {
|
|
71
69
|
return this.galleryType;
|
|
@@ -74,7 +72,7 @@ class GalleryEntityV2 {
|
|
|
74
72
|
return data_1.default[this.getGalleryType()];
|
|
75
73
|
}
|
|
76
74
|
getCreationLink() {
|
|
77
|
-
return this.getGalleryType() ===
|
|
75
|
+
return this.getGalleryType() === "likelist"
|
|
78
76
|
? `/favorites/${this.getGalleryId()}`
|
|
79
77
|
: `/${this.getGalleryType()}/${this.getGalleryId()}`;
|
|
80
78
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const types_1 = require("../../../entities/labelCreationType/types");
|
|
4
4
|
const labelsData = {
|
|
5
|
-
[
|
|
6
|
-
backgroundColor:
|
|
7
|
-
color:
|
|
8
|
-
text:
|
|
5
|
+
[types_1.LabelKeys.asset]: {
|
|
6
|
+
backgroundColor: types_1.LabelBackground.asset,
|
|
7
|
+
color: types_1.LabelColor.asset,
|
|
8
|
+
text: types_1.LabelText.asset,
|
|
9
9
|
},
|
|
10
|
-
[
|
|
11
|
-
backgroundColor:
|
|
12
|
-
color:
|
|
13
|
-
text:
|
|
10
|
+
[types_1.LabelKeys.collection]: {
|
|
11
|
+
backgroundColor: types_1.LabelBackground.collection,
|
|
12
|
+
color: types_1.LabelColor.collection,
|
|
13
|
+
text: types_1.LabelText.collection,
|
|
14
14
|
},
|
|
15
|
-
[
|
|
16
|
-
backgroundColor:
|
|
17
|
-
color:
|
|
18
|
-
text:
|
|
15
|
+
[types_1.LabelKeys.gallery]: {
|
|
16
|
+
backgroundColor: types_1.LabelBackground.gallery,
|
|
17
|
+
color: types_1.LabelColor.gallery,
|
|
18
|
+
text: types_1.LabelText.gallery,
|
|
19
19
|
},
|
|
20
|
-
[
|
|
21
|
-
backgroundColor:
|
|
22
|
-
color:
|
|
23
|
-
text:
|
|
20
|
+
[types_1.LabelKeys.favorites]: {
|
|
21
|
+
backgroundColor: types_1.LabelBackground.favorites,
|
|
22
|
+
color: types_1.LabelColor.favorites,
|
|
23
|
+
text: types_1.LabelText.favorites,
|
|
24
24
|
},
|
|
25
|
-
[
|
|
26
|
-
backgroundColor:
|
|
27
|
-
color:
|
|
28
|
-
text:
|
|
25
|
+
[types_1.LabelKeys.likelist]: {
|
|
26
|
+
backgroundColor: types_1.LabelBackground.likelist,
|
|
27
|
+
color: types_1.LabelColor.likelist,
|
|
28
|
+
text: types_1.LabelText.likelist,
|
|
29
29
|
},
|
|
30
|
-
[
|
|
31
|
-
backgroundColor:
|
|
32
|
-
color:
|
|
33
|
-
text:
|
|
30
|
+
[types_1.LabelKeys.opportunity]: {
|
|
31
|
+
backgroundColor: types_1.LabelBackground.opportunity,
|
|
32
|
+
color: types_1.LabelColor.opportunity,
|
|
33
|
+
text: types_1.LabelText.opportunity,
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
exports.default = labelsData;
|
|
@@ -8,9 +8,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
8
8
|
const assetPage_1 = require("../../components/assetPage");
|
|
9
9
|
const AssetImage_1 = __importDefault(require("../../components/assetPage/media/AssetImage"));
|
|
10
10
|
const AssetImage_2 = __importDefault(require("../../components/assetPage/media/AssetImage"));
|
|
11
|
-
const Urls_1 = require("../../dto/common/Media/Urls");
|
|
12
11
|
const getMediaVariant_1 = require("../media/getMediaVariant");
|
|
13
12
|
const types_1 = require("../media/types");
|
|
13
|
+
const urls_1 = require("../media/urls");
|
|
14
14
|
const env_1 = require("../../store/env");
|
|
15
15
|
const constants_1 = require("@ludo.ninja/core/build/constants");
|
|
16
16
|
const AssetMediasViews = ({ medias }) => {
|
|
@@ -30,25 +30,25 @@ const AssetMediasViews = ({ medias }) => {
|
|
|
30
30
|
case types_1.EMediaVariants.other:
|
|
31
31
|
return (0, jsx_runtime_1.jsx)(AssetOtherMediaView, { media: media });
|
|
32
32
|
default:
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(AssetImage_2.default, { alt: media.alt, imageUrl:
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(AssetImage_2.default, { alt: media.alt, imageUrl: `${constants_1.staticLink}/public/noContent/noContent.svg`, errorImg: `${constants_1.staticLink}/public/noContent/noContent.svg` }));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
exports.AssetMediasViews = AssetMediasViews;
|
|
38
38
|
const AssetImageMediaView = ({ media, isScreenshot }) => {
|
|
39
39
|
const NEXT_PUBLIC_STATIC_DOMAIN = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_STATIC_DOMAIN);
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)(AssetImage_1.default, { alt: media.alt, imageUrl: (0,
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(AssetImage_1.default, { alt: media.alt, imageUrl: (0, urls_1.isExternalMediaImage)(media.media, urls_1.mediaSizes.regular, NEXT_PUBLIC_STATIC_DOMAIN), errorImg: `${constants_1.staticLink}/public/noContent/noContent.svg`, originalUrl: media.originalUrl, isScreenshot: isScreenshot }));
|
|
41
41
|
};
|
|
42
42
|
const AssetAudioMediaView = ({ media }) => {
|
|
43
43
|
const getAudioENVDomain = (0, env_1.useEnvStore)((state) => state.getAudioDomain);
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(assetPage_1.AudioVideoPlayer, { playerType: "audio", poster: null, src: (0,
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(assetPage_1.AudioVideoPlayer, { playerType: "audio", poster: null, src: (0, urls_1.isExternalMediaAudio)(media.media, getAudioENVDomain) }));
|
|
45
45
|
};
|
|
46
46
|
const AssetVideoMediaView = ({ media }) => {
|
|
47
47
|
const getVideoENVDomain = (0, env_1.useEnvStore)((state) => state.getVideoDomain);
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(assetPage_1.AudioVideoPlayer, { playerType: "video", poster: null, src: (0,
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(assetPage_1.AudioVideoPlayer, { playerType: "video", poster: null, src: (0, urls_1.isExternalMediaVideo)(media.media, getVideoENVDomain) }));
|
|
49
49
|
};
|
|
50
50
|
const AssetOtherMediaView = ({ media }) => {
|
|
51
51
|
const NEXT_PUBLIC_STATIC_DOMAIN = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_STATIC_DOMAIN);
|
|
52
|
-
const mediaUrl = (0,
|
|
52
|
+
const mediaUrl = (0, urls_1.isExternalMediaImage)(media.media, urls_1.mediaSizes.regular, NEXT_PUBLIC_STATIC_DOMAIN);
|
|
53
53
|
return ((0, jsx_runtime_1.jsx)(AssetImage_2.default, { alt: media.alt, imageUrl: mediaUrl, errorImg: `${constants_1.staticLink}/public/noContent/noContent.svg`, originalUrl: media.originalUrl ?? mediaUrl }));
|
|
54
54
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildAsset = void 0;
|
|
4
|
-
const
|
|
4
|
+
const types_1 = require("../labelCreationType/types");
|
|
5
5
|
const builder_1 = require("../media/builder");
|
|
6
6
|
const core_1 = require("@ludo.ninja/core");
|
|
7
7
|
const utils_1 = require("@ludo.ninja/utils");
|
|
@@ -16,7 +16,7 @@ const buildAsset = (asset) => {
|
|
|
16
16
|
})) || [],
|
|
17
17
|
ownersProfiles: (asset.ownersProfiles || []),
|
|
18
18
|
ownersAddresses: (asset.ownersAddresses || null),
|
|
19
|
-
itemType:
|
|
19
|
+
itemType: types_1.LabelKeys.asset,
|
|
20
20
|
address: asset.address,
|
|
21
21
|
tokenId: asset.tokenId,
|
|
22
22
|
name: asset.name,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAssetMediasOpengraph = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Urls_1 = require("../../dto/common/Media/Urls");
|
|
6
5
|
const getMediaVariant_1 = require("../media/getMediaVariant");
|
|
7
6
|
const types_1 = require("../media/types");
|
|
7
|
+
const urls_1 = require("../media/urls");
|
|
8
8
|
const env_1 = require("../../store/env");
|
|
9
9
|
// render as function (bug in next js for next/head)
|
|
10
10
|
// export as function, don't use as Component
|
|
11
|
-
const
|
|
11
|
+
const getAssetMediasOpengraph = ({ medias, alt }) => {
|
|
12
12
|
const { NEXT_PUBLIC_STATIC_DOMAIN, getAudioDomain, getVideoDomain } = (0, env_1.useEnvStore)((state) => ({
|
|
13
13
|
NEXT_PUBLIC_STATIC_DOMAIN: state.NEXT_PUBLIC_STATIC_DOMAIN,
|
|
14
14
|
getAudioDomain: state.getAudioDomain,
|
|
@@ -20,9 +20,9 @@ const assetMediasOpengraph = ({ medias, alt }) => {
|
|
|
20
20
|
const mediaVariant = (0, getMediaVariant_1.getMediaVariant)({ media });
|
|
21
21
|
switch (mediaVariant) {
|
|
22
22
|
case types_1.EMediaVariants.audio:
|
|
23
|
-
return (0, jsx_runtime_1.jsx)("meta", { property: "og:audio", content: (0,
|
|
23
|
+
return (0, jsx_runtime_1.jsx)("meta", { property: "og:audio", content: (0, urls_1.isExternalMediaAudio)(media.media, getAudioDomain) });
|
|
24
24
|
case types_1.EMediaVariants.video:
|
|
25
|
-
const url = (0,
|
|
25
|
+
const url = (0, urls_1.isExternalMediaVideo)(media.media, getVideoDomain);
|
|
26
26
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("meta", { property: "og:video", content: url }), (0, jsx_runtime_1.jsx)("meta", { property: "og:video:secure_url", content: url }), (0, jsx_runtime_1.jsx)("meta", { property: "og:video:type", content: "application/x-shockwave-flash" }), (0, jsx_runtime_1.jsx)("meta", { property: "og:image", content: url }), (0, jsx_runtime_1.jsx)("meta", { property: "\u201Dog:image:width\u201D", content: "1280" }), (0, jsx_runtime_1.jsx)("meta", { property: "\u201Dog:image:height\u201D", content: "720" })] }));
|
|
27
27
|
case types_1.EMediaVariants.object3d:
|
|
28
28
|
//todo: add preview url
|
|
@@ -32,8 +32,8 @@ const assetMediasOpengraph = ({ medias, alt }) => {
|
|
|
32
32
|
case types_1.EMediaVariants.other:
|
|
33
33
|
case types_1.EMediaVariants.screenshot:
|
|
34
34
|
default:
|
|
35
|
-
const urlDefault = (0,
|
|
35
|
+
const urlDefault = (0, urls_1.isExternalMediaImage)(media.media, urls_1.mediaSizes.regular, NEXT_PUBLIC_STATIC_DOMAIN);
|
|
36
36
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("meta", { property: "og:image", content: urlDefault }), (0, jsx_runtime_1.jsx)("meta", { property: "og:image:alt", content: alt }), (0, jsx_runtime_1.jsx)("meta", { name: "twitter:image", content: urlDefault }), (0, jsx_runtime_1.jsx)("meta", { property: "twitter:image:alt", content: alt })] }));
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
exports.
|
|
39
|
+
exports.getAssetMediasOpengraph = getAssetMediasOpengraph;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetMiniatureUrl = void 0;
|
|
4
|
+
const getMediaVariant_1 = require("../media/getMediaVariant");
|
|
5
|
+
const types_1 = require("../media/types");
|
|
6
|
+
const urls_1 = require("../media/urls");
|
|
7
|
+
const env_1 = require("../../store/env");
|
|
8
|
+
const constants_1 = require("@ludo.ninja/core/build/constants");
|
|
9
|
+
const getAssetMiniatureUrl = ({ asset }) => {
|
|
10
|
+
const { NEXT_PUBLIC_STATIC_DOMAIN, getAudioDomain, getVideoDomain } = (0, env_1.useEnvStore)((state) => ({
|
|
11
|
+
NEXT_PUBLIC_STATIC_DOMAIN: state.NEXT_PUBLIC_STATIC_DOMAIN,
|
|
12
|
+
getAudioDomain: state.getAudioDomain,
|
|
13
|
+
getVideoDomain: state.getVideoDomain,
|
|
14
|
+
}));
|
|
15
|
+
const media = asset.medias[0];
|
|
16
|
+
if (!media)
|
|
17
|
+
return `${constants_1.staticLink}/public/noContent/noContent.svg`;
|
|
18
|
+
const mediaVariant = (0, getMediaVariant_1.getMediaVariant)({ media });
|
|
19
|
+
switch (mediaVariant) {
|
|
20
|
+
case types_1.EMediaVariants.audio:
|
|
21
|
+
return (0, urls_1.isExternalMediaAudio)(media.previewUrl || null, getAudioDomain);
|
|
22
|
+
case types_1.EMediaVariants.video:
|
|
23
|
+
return (0, urls_1.isExternalMediaVideo)(media.previewUrl || null, getVideoDomain);
|
|
24
|
+
case types_1.EMediaVariants.object3d:
|
|
25
|
+
// todo: add for 3d preview
|
|
26
|
+
// miniatureUrl = isExternalMediaAudio(
|
|
27
|
+
// currentMedia?.previewUrl || null
|
|
28
|
+
// );
|
|
29
|
+
return `${constants_1.staticLink}/public/noContent/noContentObject.svg`;
|
|
30
|
+
case types_1.EMediaVariants.image:
|
|
31
|
+
case types_1.EMediaVariants.other:
|
|
32
|
+
case types_1.EMediaVariants.screenshot:
|
|
33
|
+
default:
|
|
34
|
+
return (0, urls_1.isExternalMediaImage)(media.media, urls_1.mediaSizes.small, NEXT_PUBLIC_STATIC_DOMAIN);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.getAssetMiniatureUrl = getAssetMiniatureUrl;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LabelKeys } from '
|
|
1
|
+
import { LabelKeys } from '../labelCreationType/types';
|
|
2
2
|
import { IMedia } from '../media/types';
|
|
3
3
|
import assetSchema, { IAsset, IProfile, IAttribute } from "@ludo.ninja/api/build/graphql_tools/__generated__/assetsHost/schema";
|
|
4
4
|
import { BlockChainEntity, MarketPlaceEntity } from "@ludo.ninja/core";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildCollection = void 0;
|
|
4
|
+
const core_1 = require("@ludo.ninja/core");
|
|
5
|
+
const buildCollection = (collection) => {
|
|
6
|
+
const newCollection = {
|
|
7
|
+
collectionTitle: collection.collectionTitle || null,
|
|
8
|
+
collectionId: collection.collectionId,
|
|
9
|
+
collectionItems: collection.items || 0,
|
|
10
|
+
owners: collection.owners || 0,
|
|
11
|
+
creatorsProfiles: collection.creatorsProfiles
|
|
12
|
+
? collection.creatorsProfiles.map((profile) => new core_1.ProfileEntity(profile))
|
|
13
|
+
: null,
|
|
14
|
+
contractAddress: collection.contractAddress || null,
|
|
15
|
+
collectionMarkets: collection.collectionMarkets?.map((market) => new core_1.MarketPlaceEntity({
|
|
16
|
+
marketName: market?.marketName,
|
|
17
|
+
marketUrl: market?.marketUrl,
|
|
18
|
+
marketId: market?.marketUrl,
|
|
19
|
+
})) || [],
|
|
20
|
+
creatorsAddresses: (collection.creatorsAddresses || []),
|
|
21
|
+
blockchain: new core_1.BlockChainEntity(collection.blockchain),
|
|
22
|
+
rank: collection.rank ? Math.round(collection.rank) : 0,
|
|
23
|
+
likes: collection.likes || 0,
|
|
24
|
+
liked: !!collection.liked,
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
...newCollection,
|
|
28
|
+
creationLink: `/${newCollection.collectionId}/${newCollection.collectionId}`,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.buildCollection = buildCollection;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LabelKeys } from '../labelCreationType/types';
|
|
2
|
+
import { BlockChainEntity, MarketPlaceEntity, ProfileEntity } from "@ludo.ninja/core";
|
|
3
|
+
export type TCollection = {
|
|
4
|
+
collectionTitle: string | null;
|
|
5
|
+
collectionId: LabelKeys;
|
|
6
|
+
collectionItems: number;
|
|
7
|
+
owners: number;
|
|
8
|
+
creatorsProfiles: ProfileEntity[] | null;
|
|
9
|
+
contractAddress: string | null;
|
|
10
|
+
collectionMarkets: MarketPlaceEntity[];
|
|
11
|
+
creatorsAddresses: string[];
|
|
12
|
+
blockchain: BlockChainEntity;
|
|
13
|
+
rank: number;
|
|
14
|
+
likes: number;
|
|
15
|
+
liked: boolean;
|
|
16
|
+
creationLink: string;
|
|
17
|
+
};
|