@ludo.ninja/components 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/likes/useGetLikesAsset.js +140 -305
- package/dist/index.js +1 -0
- package/dist/modules/index.js +3 -0
- package/dist/modules/sessionScroll/index.js +33 -43
- package/dist/modules/user/auth/index.js +1 -0
- package/dist/modules/user/index.js +3 -0
- package/dist/modules/user/profileData/index.js +1 -0
- package/dist/store/index.js +4 -5
- package/dist/types/api/server-search/queries/useFetchCollections/index.d.ts +13 -23
- package/dist/types/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +9 -13
- package/dist/types/components/CreationCard/CardHead.d.ts +10 -22
- package/dist/types/components/CreationCard/index.d.ts +18 -39
- package/dist/types/components/addWalletsRedirectPage/index.d.ts +2 -5
- package/dist/types/components/assetPage/assetLikes/index.d.ts +4 -9
- package/dist/types/components/assetPage/assetNft/index.d.ts +1 -5
- package/dist/types/components/assetPage/assetWrapper/index.d.ts +5 -12
- package/dist/types/components/assetPage/audioVideoPlayer/Duration.d.ts +1 -2
- package/dist/types/components/assetPage/audioVideoPlayer/index.d.ts +87 -99
- package/dist/types/components/assetPage/category/index.d.ts +2 -5
- package/dist/types/components/assetPage/description/index.d.ts +1 -5
- package/dist/types/components/assetPage/detailsAccordeon/index.d.ts +2 -6
- package/dist/types/components/assetPage/figCaption/index.d.ts +2 -6
- package/dist/types/components/assetPage/information/index.d.ts +2 -6
- package/dist/types/components/assetPage/moreDropDown/index.d.ts +4 -5
- package/dist/types/components/assetPage/participants/index.d.ts +5 -12
- package/dist/types/components/assetPage/priceRank/index.d.ts +5 -11
- package/dist/types/components/assetPage/properties/index.d.ts +1 -5
- package/dist/types/components/assetPage/slider/index.d.ts +2 -7
- package/dist/types/components/assetPage/tittle/index.d.ts +5 -12
- package/dist/types/components/assetPage/viewer3D/index.d.ts +4 -10
- package/dist/types/components/collectionPage/collectionLike/index.d.ts +4 -9
- package/dist/types/components/deleteDialog/index.d.ts +5 -11
- package/dist/types/components/editProfile/UserPicProfile/index.d.ts +2 -5
- package/dist/types/components/favoriteList/add/addAssetToFavoriteList/index.d.ts +1 -2
- package/dist/types/components/favoriteList/add/addCollectionToFavoriteList/index.d.ts +1 -2
- package/dist/types/components/favoriteList/add/addCreationToFavoriteList/index.d.ts +2 -3
- package/dist/types/components/filters/index.d.ts +7 -23
- package/dist/types/components/forms/form/index.d.ts +8 -10
- package/dist/types/components/forms/formsNavigation/index.d.ts +0 -1
- package/dist/types/components/forms/formsTemplate/index.d.ts +6 -9
- package/dist/types/components/gallery/add/addAssetToGallery/index.d.ts +1 -2
- package/dist/types/components/gallery/add/addCreationToGallery/index.d.ts +0 -1
- package/dist/types/components/gradientLabel/index.d.ts +0 -1
- package/dist/types/components/headers/headerSearch/index.d.ts +0 -1
- package/dist/types/components/headers/headerSimple/index.d.ts +0 -1
- package/dist/types/components/inviteCodesPage/components/index.d.ts +0 -1
- package/dist/types/components/inviteCodesPage/components/inviteCodes/inviteCode/index.d.ts +3 -8
- package/dist/types/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/index.d.ts +4 -9
- package/dist/types/components/inviteCodesPage/components/inviteCodes/inviteCodeCopy/index.d.ts +2 -6
- package/dist/types/components/inviteCodesPage/components/inviteCodes/inviteCodeDate/index.d.ts +2 -5
- package/dist/types/components/inviteCodesPage/wrappers/index.d.ts +0 -1
- package/dist/types/components/inviteCodesPage/wrappers/resumeCodes/index.d.ts +5 -11
- package/dist/types/components/inviteCodesPage/wrappers/unusedCodes/index.d.ts +3 -8
- package/dist/types/components/inviteCodesPage/wrappers/usedCodes/index.d.ts +3 -8
- package/dist/types/components/linkTabs/linkTab/index.d.ts +5 -11
- package/dist/types/components/myWallets/index.d.ts +0 -1
- package/dist/types/components/navigation/index.d.ts +3 -4
- package/dist/types/components/profile/ProfileTabs.d.ts +5 -11
- package/dist/types/components/profile/aboutText/index.d.ts +2 -21
- package/dist/types/components/profile/addToGalleryBtns/index.d.ts +2 -5
- package/dist/types/components/profile/followersSocial/followers/index.d.ts +3 -7
- package/dist/types/components/profile/info/index.d.ts +2 -6
- package/dist/types/components/profile/profileUserCards/profileUserCard/index.d.ts +7 -16
- package/dist/types/components/profile/rank/index.d.ts +1 -5
- package/dist/types/components/profile/wallets/index.d.ts +0 -1
- package/dist/types/components/profile/wrapper/index.d.ts +4 -10
- package/dist/types/components/registrationPage/registrationSelection/index.d.ts +10 -12
- package/dist/types/components/rewards/FAQ/index.d.ts +0 -1
- package/dist/types/components/rewards/clarifications/index.d.ts +6 -8
- package/dist/types/components/rewards/logoBottom/index.d.ts +1 -1
- package/dist/types/components/rewards/seasonBanner/index.d.ts +3 -5
- package/dist/types/components/rewards/taskExpTab/index.d.ts +10 -21
- package/dist/types/components/rewards/tasksGrid/index.d.ts +3 -6
- package/dist/types/components/rewards/userExp/index.d.ts +8 -17
- package/dist/types/components/search/SearchInputContainer.d.ts +21 -35
- package/dist/types/components/search/index.d.ts +0 -1
- package/dist/types/components/search/searchCloseMoreButtons/index.d.ts +9 -14
- package/dist/types/components/search/searchSimpleInput/index.d.ts +2 -5
- package/dist/types/components/shareDialog/index.d.ts +29 -33
- package/dist/types/components/sidebar/index.d.ts +0 -1
- package/dist/types/components/sidebar/initializer.d.ts +1 -1
- package/dist/types/components/socialButtons/index.d.ts +0 -1
- package/dist/types/components/toTopBtn/index.d.ts +2 -5
- package/dist/types/dto/AssetEntity/views/AssetAudio/index.d.ts +3 -11
- package/dist/types/dto/AssetEntity/views/AssetObject/index.d.ts +5 -14
- package/dist/types/dto/AssetEntity/views/AssetVideo/index.d.ts +3 -11
- package/dist/types/dto/Collection/CollectionCreationEntity/index.d.ts +37 -39
- package/dist/types/dto/CreationEntity/index.d.ts +41 -43
- package/dist/types/dto/common/ItemViews/CreationAudio/index.d.ts +3 -11
- package/dist/types/dto/common/ItemViews/CreationObject/index.d.ts +2 -10
- package/dist/types/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +16 -23
- package/dist/types/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +17 -28
- package/dist/types/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +17 -26
- package/dist/types/hooks/likes/dynamic/useGetCollectionInfoAndLikes.d.ts +11 -18
- package/dist/types/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +13 -18
- package/dist/types/hooks/likes/dynamic/useGetTableLikes.d.ts +9 -19
- package/dist/types/hooks/likes/index.d.ts +12 -20
- package/dist/types/hooks/likes/useGetLikesAsset.d.ts +8 -20
- package/dist/types/hooks/useToGalleryAsset/index.d.ts +12 -21
- package/dist/types/index.d.ts +1 -0
- package/dist/types/layouts/GlobalLayout.d.ts +2 -5
- package/dist/types/layouts/base/LWithRegularHeader/index.d.ts +0 -1
- package/dist/types/layouts/base/LWithRegularHeader/type.d.ts +1 -3
- package/dist/types/layouts/base/LWithSearchHeader/index.d.ts +0 -1
- package/dist/types/layouts/base/LWithSearchHeader/type.d.ts +1 -3
- package/dist/types/layouts/base/LWithSimpleHeader/index.d.ts +0 -1
- package/dist/types/layouts/base/LWithSimpleHeader/type.d.ts +1 -3
- package/dist/types/layouts/base/LWithoutHeader/index.d.ts +0 -1
- package/dist/types/layouts/custom/accountLayout/index.d.ts +0 -1
- package/dist/types/layouts/custom/formsLayout/index.d.ts +0 -1
- package/dist/types/layouts/custom/mainLayout/index.d.ts +0 -1
- package/dist/types/layouts/custom/searchLayout/index.d.ts +0 -1
- package/dist/types/layouts/custom/simpleLayout/index.d.ts +0 -1
- package/dist/types/layouts/pageWithLayout.d.ts +3 -10
- package/dist/types/modules/gallery/ui/AllResults.d.ts +2 -5
- package/dist/types/modules/gallery/ui/EditGallery.d.ts +7 -18
- package/dist/types/modules/gallery/ui/GalleryDeleteIcon.d.ts +3 -7
- package/dist/types/modules/gallery/ui/chooseGalleryItems/index.d.ts +10 -15
- package/dist/types/modules/gallery/ui/itemsPreview/index.d.ts +13 -27
- package/dist/types/modules/index.d.ts +3 -0
- package/dist/types/modules/sessionScroll/index.d.ts +7 -10
- package/dist/types/modules/sessionScroll/useVirtuosoInitialScroll.d.ts +6 -14
- package/dist/types/modules/user/auth/index.d.ts +1 -0
- package/dist/types/modules/user/index.d.ts +3 -0
- package/dist/types/modules/user/profileData/index.d.ts +1 -0
- package/dist/types/modules/virtuoso/VirtuosoPageBuilder.d.ts +14 -32
- package/dist/types/modules/virtuoso/VirtuosoToTopBtn.d.ts +5 -9
- package/dist/types/modules/virtuoso/types.d.ts +2 -3
- package/dist/types/modules/virtuoso/useVirtuosoData.d.ts +8 -16
- package/dist/types/store/index.d.ts +7 -14
- package/dist/types/system/Cards/CardContent/CardLikes/index.d.ts +3 -7
- package/dist/types/system/Cards/CardHeadIcons/index.d.ts +10 -24
- package/dist/types/system/Cards/CardMedia/CardAudio/index.d.ts +5 -11
- package/dist/types/system/Cards/CardRank/index.d.ts +3 -2
- package/dist/types/system/Cards/CardsGrid/index.d.ts +9 -19
- package/dist/types/system/Cards/MultiMediaCard/index.d.ts +4 -10
- package/dist/types/system/Cards/RegularCard/index.d.ts +14 -28
- package/dist/types/system/CardsHolderWithSkeleton/CardsHolder/index.d.ts +13 -20
- package/dist/types/system/CardsHolderWithSkeleton/CardsHolderLoader/index.d.ts +0 -1
- package/dist/types/system/CardsHolderWithSkeleton/index.d.ts +20 -27
- package/dist/types/system/Forms/Selects/DesktopSelect/index.d.ts +6 -15
- package/dist/types/system/Img/Profilepic/index.d.ts +4 -6
- package/dist/types/system/ShareIconResize.d.ts +1 -1
- package/dist/types/utils/adaptive/check4k.d.ts +3 -7
- package/dist/types/utils/adaptive/scale.d.ts +8 -14
- package/dist/types/utils/copyBtn/index.d.ts +3 -8
- package/dist/types/utils/extractItemIds/index.d.ts +1 -4
- package/dist/types/utils/getPageSizeAssets.d.ts +3 -6
- package/dist/types/utils/index.d.ts +3 -6
- package/dist/types/utils/screen/index.d.ts +9 -9
- package/dist/utils/index.js +3 -6
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/store/index.ts +2 -0
- package/src/utils/index.ts +4 -6
|
@@ -1,320 +1,155 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useLazyQuery } from '@apollo/client';
|
|
4
|
-
|
|
5
|
-
import { hosts, searchSchema } from '@ludo.ninja/api';
|
|
6
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
7
|
-
|
|
8
|
-
import { useUiStore } from '@/store/ui';
|
|
9
|
-
|
|
10
|
-
var __assign =
|
|
11
|
-
(this && this.__assign) ||
|
|
12
|
-
function () {
|
|
13
|
-
__assign =
|
|
14
|
-
Object.assign ||
|
|
15
|
-
function (t) {
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
16
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
20
7
|
}
|
|
21
8
|
return t;
|
|
22
|
-
|
|
9
|
+
};
|
|
23
10
|
return __assign.apply(this, arguments);
|
|
24
|
-
|
|
25
|
-
var __awaiter =
|
|
26
|
-
|
|
27
|
-
function (thisArg, _arguments, P, generator) {
|
|
28
|
-
function adopt(value) {
|
|
29
|
-
return value instanceof P
|
|
30
|
-
? value
|
|
31
|
-
: new P(function (resolve) {
|
|
32
|
-
resolve(value);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
35
14
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
reject(e);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function rejected(value) {
|
|
44
|
-
try {
|
|
45
|
-
step(generator['throw'](value));
|
|
46
|
-
} catch (e) {
|
|
47
|
-
reject(e);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function step(result) {
|
|
51
|
-
result.done
|
|
52
|
-
? resolve(result.value)
|
|
53
|
-
: adopt(result.value).then(fulfilled, rejected);
|
|
54
|
-
}
|
|
55
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56
19
|
});
|
|
57
|
-
|
|
58
|
-
var __generator =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
label: 0,
|
|
63
|
-
sent: function () {
|
|
64
|
-
if (t[0] & 1) throw t[1];
|
|
65
|
-
return t[1];
|
|
66
|
-
},
|
|
67
|
-
trys: [],
|
|
68
|
-
ops: [],
|
|
69
|
-
},
|
|
70
|
-
f,
|
|
71
|
-
y,
|
|
72
|
-
t,
|
|
73
|
-
g;
|
|
74
|
-
return (
|
|
75
|
-
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
|
|
76
|
-
typeof Symbol === 'function' &&
|
|
77
|
-
(g[Symbol.iterator] = function () {
|
|
78
|
-
return this;
|
|
79
|
-
}),
|
|
80
|
-
g
|
|
81
|
-
);
|
|
82
|
-
function verb(n) {
|
|
83
|
-
return function (v) {
|
|
84
|
-
return step([n, v]);
|
|
85
|
-
};
|
|
86
|
-
}
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
87
25
|
function step(op) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
op[0]
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
break;
|
|
109
|
-
case 4:
|
|
110
|
-
_.label++;
|
|
111
|
-
return { value: op[1], done: false };
|
|
112
|
-
case 5:
|
|
113
|
-
_.label++;
|
|
114
|
-
y = op[1];
|
|
115
|
-
op = [0];
|
|
116
|
-
continue;
|
|
117
|
-
case 7:
|
|
118
|
-
op = _.ops.pop();
|
|
119
|
-
_.trys.pop();
|
|
120
|
-
continue;
|
|
121
|
-
default:
|
|
122
|
-
if (
|
|
123
|
-
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
|
|
124
|
-
(op[0] === 6 || op[0] === 2)
|
|
125
|
-
) {
|
|
126
|
-
_ = 0;
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
130
|
-
_.label = op[1];
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
134
|
-
_.label = t[1];
|
|
135
|
-
t = op;
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
if (t && _.label < t[2]) {
|
|
139
|
-
_.label = t[2];
|
|
140
|
-
_.ops.push(op);
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
if (t[2]) _.ops.pop();
|
|
144
|
-
_.trys.pop();
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
op = body.call(thisArg, _);
|
|
148
|
-
} catch (e) {
|
|
149
|
-
op = [6, e];
|
|
150
|
-
y = 0;
|
|
151
|
-
} finally {
|
|
152
|
-
f = t = 0;
|
|
153
|
-
}
|
|
154
|
-
if (op[0] & 5) throw op[1];
|
|
155
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
156
46
|
}
|
|
157
|
-
|
|
158
|
-
var __spreadArray =
|
|
159
|
-
|
|
160
|
-
function (to, from, pack) {
|
|
161
|
-
if (pack || arguments.length === 2)
|
|
162
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
47
|
+
};
|
|
48
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
163
50
|
if (ar || !(i in from)) {
|
|
164
|
-
|
|
165
|
-
|
|
51
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
+
ar[i] = from[i];
|
|
166
53
|
}
|
|
167
|
-
|
|
54
|
+
}
|
|
168
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
169
|
-
|
|
170
|
-
|
|
56
|
+
};
|
|
57
|
+
import { useMemo, useState } from 'react';
|
|
58
|
+
import { useLazyQuery } from '@apollo/client';
|
|
59
|
+
import { hosts, searchSchema } from '@ludo.ninja/api';
|
|
60
|
+
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
61
|
+
import { useUiStore } from '@/store/ui';
|
|
171
62
|
export var useGetLikesAsset = function () {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
63
|
+
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
64
|
+
var _a = useState(0), activeRequestsCountLikes = _a[0], setActiveRequestsCountLikes = _a[1];
|
|
65
|
+
var isLoadingLikes = useMemo(function () { return activeRequestsCountLikes !== 0; }, [activeRequestsCountLikes]);
|
|
66
|
+
var _b = useState([]), assetsLikes = _b[0], setAssetsLikes = _b[1];
|
|
67
|
+
var _c = useState([]), collectionsLikes = _c[0], setCollectionsLikes = _c[1];
|
|
68
|
+
var fetchAssetsLikes = useLazyQuery(searchSchema.FetchDynamicAssetsLikesDocument, {
|
|
69
|
+
context: {
|
|
70
|
+
uri: hosts.searchHost,
|
|
71
|
+
},
|
|
72
|
+
fetchPolicy: 'no-cache',
|
|
73
|
+
onCompleted: function (_a) {
|
|
74
|
+
var fetchDynamicAssetsData = _a.fetchDynamicAssetsData;
|
|
75
|
+
setAssetsLikes(fetchDynamicAssetsData);
|
|
76
|
+
setActiveRequestsCountLikes(function (prev) { return prev - 1; });
|
|
77
|
+
},
|
|
78
|
+
onError: function () {
|
|
79
|
+
openAlert({
|
|
80
|
+
type: alertVariants.error,
|
|
81
|
+
caption: 'Oops, something went wrong with assets likes.',
|
|
82
|
+
});
|
|
83
|
+
setAssetsLikes([]);
|
|
84
|
+
setActiveRequestsCountLikes(function (prev) { return prev - 1; });
|
|
85
|
+
},
|
|
86
|
+
})[0];
|
|
87
|
+
var fetchCollectionsLikes = useLazyQuery(searchSchema.FetchDynamicCollectionsDataDocument, {
|
|
88
|
+
context: { uri: hosts.searchHost },
|
|
89
|
+
onCompleted: function (_a) {
|
|
90
|
+
var fetchDynamicCollectionsData = _a.fetchDynamicCollectionsData;
|
|
91
|
+
setCollectionsLikes(fetchDynamicCollectionsData);
|
|
92
|
+
setActiveRequestsCountLikes(function (prev) { return prev - 1; });
|
|
93
|
+
},
|
|
94
|
+
fetchPolicy: 'no-cache',
|
|
95
|
+
onError: function () {
|
|
96
|
+
openAlert({
|
|
97
|
+
type: alertVariants.error,
|
|
98
|
+
caption: 'Oops, something went wrong with collections likes.',
|
|
99
|
+
});
|
|
100
|
+
setCollectionsLikes([]);
|
|
101
|
+
setActiveRequestsCountLikes(function (prev) { return prev - 1; });
|
|
102
|
+
},
|
|
103
|
+
})[0];
|
|
104
|
+
var handle = useMemo(function () { return ({
|
|
105
|
+
fetchLikes: function (itemsIdsArray, currentItemType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_a) {
|
|
107
|
+
switch (_a.label) {
|
|
108
|
+
case 0:
|
|
109
|
+
setActiveRequestsCountLikes(function (prev) { return prev + 1; });
|
|
110
|
+
if (!(itemsIdsArray.length > 0)) return [3 /*break*/, 4];
|
|
111
|
+
if (!(currentItemType === 'asset')) return [3 /*break*/, 2];
|
|
112
|
+
return [4 /*yield*/, fetchAssetsLikes({ variables: { assetIds: itemsIdsArray } })];
|
|
113
|
+
case 1:
|
|
114
|
+
_a.sent();
|
|
115
|
+
return [3 /*break*/, 4];
|
|
116
|
+
case 2:
|
|
117
|
+
if (!(currentItemType === 'collection')) return [3 /*break*/, 4];
|
|
118
|
+
return [4 /*yield*/, fetchCollectionsLikes({
|
|
119
|
+
variables: {
|
|
120
|
+
input: itemsIdsArray.map(function (collectionId) {
|
|
121
|
+
return {
|
|
122
|
+
collectionId: collectionId,
|
|
123
|
+
};
|
|
124
|
+
}),
|
|
125
|
+
},
|
|
126
|
+
})];
|
|
127
|
+
case 3:
|
|
128
|
+
_a.sent();
|
|
129
|
+
_a.label = 4;
|
|
130
|
+
case 4: return [2 /*return*/];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); },
|
|
134
|
+
reset: function () {
|
|
135
|
+
setAssetsLikes([]);
|
|
136
|
+
setCollectionsLikes([]);
|
|
137
|
+
},
|
|
138
|
+
}); }, []);
|
|
139
|
+
var likes = useMemo(function () {
|
|
140
|
+
var likesForAssetsWithId = assetsLikes
|
|
141
|
+
? assetsLikes.map(function (like) { return (__assign({ id: like.assetId }, like)); })
|
|
142
|
+
: [];
|
|
143
|
+
var likesForCollectionsWithId = collectionsLikes
|
|
144
|
+
? collectionsLikes.map(function (like) { return (__assign({ id: like.collectionId }, like)); })
|
|
145
|
+
: [];
|
|
146
|
+
var combinedLikes = __spreadArray(__spreadArray([], likesForAssetsWithId, true), likesForCollectionsWithId, true);
|
|
147
|
+
return new Map(combinedLikes.map(function (like) { return [like.id, like]; }));
|
|
148
|
+
}, [assetsLikes, collectionsLikes]);
|
|
241
149
|
return {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
case 0:
|
|
247
|
-
setActiveRequestsCountLikes(function (prev) {
|
|
248
|
-
return prev + 1;
|
|
249
|
-
});
|
|
250
|
-
if (!(itemsIdsArray.length > 0)) return [3 /*break*/, 4];
|
|
251
|
-
if (!(currentItemType === 'asset')) return [3 /*break*/, 2];
|
|
252
|
-
return [
|
|
253
|
-
4 /*yield*/,
|
|
254
|
-
fetchAssetsLikes({ variables: { assetIds: itemsIdsArray } }),
|
|
255
|
-
];
|
|
256
|
-
case 1:
|
|
257
|
-
_a.sent();
|
|
258
|
-
return [3 /*break*/, 4];
|
|
259
|
-
case 2:
|
|
260
|
-
if (!(currentItemType === 'collection'))
|
|
261
|
-
return [3 /*break*/, 4];
|
|
262
|
-
return [
|
|
263
|
-
4 /*yield*/,
|
|
264
|
-
fetchCollectionsLikes({
|
|
265
|
-
variables: {
|
|
266
|
-
input: itemsIdsArray.map(function (collectionId) {
|
|
267
|
-
return {
|
|
268
|
-
collectionId: collectionId,
|
|
269
|
-
};
|
|
270
|
-
}),
|
|
271
|
-
},
|
|
272
|
-
}),
|
|
273
|
-
];
|
|
274
|
-
case 3:
|
|
275
|
-
_a.sent();
|
|
276
|
-
_a.label = 4;
|
|
277
|
-
case 4:
|
|
278
|
-
return [2 /*return*/];
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
},
|
|
283
|
-
reset: function () {
|
|
284
|
-
setAssetsLikes([]);
|
|
285
|
-
setCollectionsLikes([]);
|
|
286
|
-
},
|
|
150
|
+
isLoadingLikes: isLoadingLikes,
|
|
151
|
+
fetchLikes: handle.fetchLikes,
|
|
152
|
+
likes: likes,
|
|
153
|
+
resetLikes: handle.reset,
|
|
287
154
|
};
|
|
288
|
-
}, []);
|
|
289
|
-
var likes = useMemo(
|
|
290
|
-
function () {
|
|
291
|
-
var likesForAssetsWithId = assetsLikes
|
|
292
|
-
? assetsLikes.map(function (like) {
|
|
293
|
-
return __assign({ id: like.assetId }, like);
|
|
294
|
-
})
|
|
295
|
-
: [];
|
|
296
|
-
var likesForCollectionsWithId = collectionsLikes
|
|
297
|
-
? collectionsLikes.map(function (like) {
|
|
298
|
-
return __assign({ id: like.collectionId }, like);
|
|
299
|
-
})
|
|
300
|
-
: [];
|
|
301
|
-
var combinedLikes = __spreadArray(
|
|
302
|
-
__spreadArray([], likesForAssetsWithId, true),
|
|
303
|
-
likesForCollectionsWithId,
|
|
304
|
-
true
|
|
305
|
-
);
|
|
306
|
-
return new Map(
|
|
307
|
-
combinedLikes.map(function (like) {
|
|
308
|
-
return [like.id, like];
|
|
309
|
-
})
|
|
310
|
-
);
|
|
311
|
-
},
|
|
312
|
-
[assetsLikes, collectionsLikes]
|
|
313
|
-
);
|
|
314
|
-
return {
|
|
315
|
-
isLoadingLikes: isLoadingLikes,
|
|
316
|
-
fetchLikes: handle.fetchLikes,
|
|
317
|
-
likes: likes,
|
|
318
|
-
resetLikes: handle.reset,
|
|
319
|
-
};
|
|
320
155
|
};
|
package/dist/index.js
CHANGED
package/dist/modules/index.js
CHANGED
|
@@ -1,65 +1,55 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
2
|
import { useRouter } from 'next/router';
|
|
4
|
-
|
|
5
3
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
6
|
-
|
|
7
4
|
import { getSessionKey, isServer } from '@ludo.ninja/utils';
|
|
8
|
-
|
|
5
|
+
export * from './globalTabs';
|
|
9
6
|
var sessionKey = 'scrollPositions';
|
|
10
7
|
export var getScrollKeys = function () {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
var result = getSessionKey(sessionKey);
|
|
9
|
+
if (result) {
|
|
10
|
+
return JSON.parse(result);
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
16
13
|
};
|
|
17
14
|
export var removeScrollKeys = function () {
|
|
18
|
-
|
|
15
|
+
sessionStorage.removeItem(sessionKey);
|
|
19
16
|
};
|
|
20
17
|
export var setScrollKeys = function (data) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
if (isServer)
|
|
19
|
+
return;
|
|
20
|
+
removeScrollKeys();
|
|
21
|
+
sessionStorage.setItem(sessionKey, JSON.stringify(data));
|
|
24
22
|
};
|
|
25
|
-
export var useScrollState = createWithEqualityFn()(function (
|
|
26
|
-
setState,
|
|
27
|
-
getState
|
|
28
|
-
) {
|
|
29
|
-
return {
|
|
23
|
+
export var useScrollState = createWithEqualityFn()(function (setState, getState) { return ({
|
|
30
24
|
isHandleUpdateScroll: false,
|
|
31
25
|
setIsHandleUpdateScroll: function (isHandleUpdateScroll) {
|
|
32
|
-
|
|
26
|
+
setState({ isHandleUpdateScroll: isHandleUpdateScroll });
|
|
33
27
|
},
|
|
34
28
|
backRoute: '',
|
|
35
29
|
setBackRoute: function (backRoute) {
|
|
36
|
-
|
|
30
|
+
setState({ backRoute: backRoute });
|
|
37
31
|
},
|
|
38
32
|
removeScrollKeysWithCheckRoute: function (url) {
|
|
39
|
-
|
|
40
|
-
isHandleUpdateScroll
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
}
|
|
33
|
+
var _a = getState(), isHandleUpdateScroll = _a.isHandleUpdateScroll, backRoute = _a.backRoute;
|
|
34
|
+
if (!isHandleUpdateScroll && url !== backRoute) {
|
|
35
|
+
removeScrollKeys();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
setState({
|
|
39
|
+
isHandleUpdateScroll: false,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
49
42
|
},
|
|
50
|
-
|
|
51
|
-
});
|
|
43
|
+
}); });
|
|
52
44
|
// custom Component Interceptor scroll state without global page rerender in effect
|
|
53
45
|
export var DeleteScrollStateInterceptor = function () {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, []);
|
|
64
|
-
return null;
|
|
46
|
+
var removeScrollKeysWithCheckRoute = useScrollState(function (state) { return state.removeScrollKeysWithCheckRoute; });
|
|
47
|
+
var router = useRouter();
|
|
48
|
+
useEffect(function () {
|
|
49
|
+
router.events.on('routeChangeStart', removeScrollKeysWithCheckRoute);
|
|
50
|
+
return function () {
|
|
51
|
+
router.events.off('routeChangeStart', removeScrollKeysWithCheckRoute);
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
54
|
+
return null;
|
|
65
55
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './';
|
package/dist/store/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createProvider } from 'next-zustand';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export * from './ui';
|
|
3
|
+
export * from './media';
|
|
4
|
+
var creators = createProvider()(function ( /*setState*/) { return ({
|
|
5
5
|
isMobile: false,
|
|
6
6
|
// setIsMobile: (isMobile) => {
|
|
7
7
|
// setState({ isMobile });
|
|
8
8
|
// },
|
|
9
|
-
|
|
10
|
-
});
|
|
9
|
+
}); });
|
|
11
10
|
export var useSSRStore = creators.getUseStore();
|
|
12
11
|
export var SSRProvider = creators.Provider;
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
import { searchSchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
|
|
3
2
|
import CollectionCreationEntity from '@/dto/Collection/CollectionCreationEntity';
|
|
4
|
-
|
|
5
|
-
export declare const useFindCollections: ({
|
|
6
|
-
term,
|
|
7
|
-
input,
|
|
8
|
-
page,
|
|
9
|
-
}: schema.IQueryFindCollectionsArgs) => {
|
|
10
|
-
loadMore: (pageToken: string) => Promise<void>;
|
|
11
|
-
loading: boolean;
|
|
12
|
-
error: import('@apollo/client').ApolloError | undefined;
|
|
13
|
-
results: number;
|
|
14
|
-
collections: CollectionCreationEntity[];
|
|
15
|
-
nextPageToken: string | null;
|
|
16
|
-
refetchQuery: () => Promise<void>;
|
|
17
|
-
};
|
|
18
|
-
declare const _default: {
|
|
19
|
-
useFindCollections: ({
|
|
20
|
-
term,
|
|
21
|
-
input,
|
|
22
|
-
page,
|
|
23
|
-
}: schema.IQueryFindCollectionsArgs) => {
|
|
3
|
+
export declare const useFindCollections: ({ term, input, page, }: schema.IQueryFindCollectionsArgs) => {
|
|
24
4
|
loadMore: (pageToken: string) => Promise<void>;
|
|
25
5
|
loading: boolean;
|
|
26
|
-
error: import(
|
|
6
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
27
7
|
results: number;
|
|
28
8
|
collections: CollectionCreationEntity[];
|
|
29
9
|
nextPageToken: string | null;
|
|
30
10
|
refetchQuery: () => Promise<void>;
|
|
31
|
-
|
|
11
|
+
};
|
|
12
|
+
declare const _default: {
|
|
13
|
+
useFindCollections: ({ term, input, page, }: schema.IQueryFindCollectionsArgs) => {
|
|
14
|
+
loadMore: (pageToken: string) => Promise<void>;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
17
|
+
results: number;
|
|
18
|
+
collections: CollectionCreationEntity[];
|
|
19
|
+
nextPageToken: string | null;
|
|
20
|
+
refetchQuery: () => Promise<void>;
|
|
21
|
+
};
|
|
32
22
|
};
|
|
33
23
|
export default _default;
|