@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
|
@@ -4,10 +4,10 @@ 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 styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
9
7
|
const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
|
|
10
8
|
const typography_1 = require("../../../../styles/typography");
|
|
9
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
10
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
11
11
|
// Styles
|
|
12
12
|
const StyledCardCategory = styled_components_1.default.div `
|
|
13
13
|
display: flex;
|
|
@@ -48,7 +48,7 @@ const StyledCardCategory = styled_components_1.default.div `
|
|
|
48
48
|
const CardCategory = ({ label }) => {
|
|
49
49
|
if (!label)
|
|
50
50
|
return null;
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(StyledCardCategory, { background: label.backgroundColor, color: label.color, children: (0, jsx_runtime_1.jsx)("div", { className:
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(StyledCardCategory, { background: label.backgroundColor, color: label.color, children: (0, jsx_runtime_1.jsx)("div", { className: "category", children: (0, jsx_runtime_1.jsx)("span", { className: "label", children: label.text }) }) }));
|
|
52
52
|
};
|
|
53
53
|
// Export
|
|
54
54
|
exports.default = CardCategory;
|
|
@@ -5,11 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CardHead = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const router_1 = require("next/router");
|
|
9
8
|
const addCreationToFavoriteList_1 = __importDefault(require("../../../components/favoriteList/add/addCreationToFavoriteList"));
|
|
10
9
|
const CollectionCreationEntity_1 = __importDefault(require("../../../dto/Collection/CollectionCreationEntity"));
|
|
11
|
-
const
|
|
10
|
+
const types_1 = require("../../../entities/labelCreationType/types");
|
|
12
11
|
const store_1 = require("../../../modules/user/store");
|
|
12
|
+
const addToFavListIcon_svg_1 = __importDefault(require("../../../public/cards/addToFavListIcon"));
|
|
13
|
+
const addToGalleryIcon_svg_1 = __importDefault(require("../../../public/cards/addToGalleryIcon"));
|
|
14
|
+
const heart_svg_1 = __importDefault(require("../../../public/cards/heart"));
|
|
13
15
|
const env_1 = require("../../../store/env");
|
|
14
16
|
const ui_1 = require("../../../store/ui");
|
|
15
17
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
@@ -17,9 +19,7 @@ const CardRank_1 = __importDefault(require("../CardRank"));
|
|
|
17
19
|
const Headicons_1 = __importDefault(require("../Styles/Headicons"));
|
|
18
20
|
const auth_1 = require("../../../utils/auth");
|
|
19
21
|
const screen_1 = require("../../../utils/screen");
|
|
20
|
-
const
|
|
21
|
-
const addToGalleryIcon_svg_1 = __importDefault(require("../../../public/cards/addToGalleryIcon"));
|
|
22
|
-
const heart_svg_1 = __importDefault(require("../../../public/cards/heart"));
|
|
22
|
+
const router_1 = require("next/router");
|
|
23
23
|
// Component
|
|
24
24
|
const CardHead = ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteLikeFromCard, isUserProfile, isDisabled, isShowCheckbox, currentMyGalleryId, }) => {
|
|
25
25
|
const redirectToLoginWindow = (0, auth_1.useRedirectToLoginWindow)();
|
|
@@ -28,49 +28,44 @@ const CardHead = ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteL
|
|
|
28
28
|
const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
29
29
|
const isLicked = isIconLiked && isSignedIn;
|
|
30
30
|
const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
|
|
31
|
-
const isMobile = !!(windowDimensions?.windowWidth &&
|
|
32
|
-
windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
|
|
31
|
+
const isMobile = !!(windowDimensions?.windowWidth && windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
|
|
33
32
|
const router = (0, router_1.useRouter)();
|
|
34
|
-
const isGallery = router.pathname.includes(
|
|
33
|
+
const isGallery = router.pathname.includes("gallery");
|
|
35
34
|
const handleClick = async (e, type) => {
|
|
36
35
|
e.preventDefault();
|
|
37
36
|
e.stopPropagation();
|
|
38
37
|
if (!isSignedIn) {
|
|
39
38
|
redirectToLoginWindow();
|
|
40
39
|
}
|
|
41
|
-
else if (type ===
|
|
40
|
+
else if (type === "fav-list") {
|
|
42
41
|
openModalSidebarPortal((0, jsx_runtime_1.jsx)(addCreationToFavoriteList_1.default, { ids: [
|
|
43
42
|
creation instanceof CollectionCreationEntity_1.default
|
|
44
|
-
? `${creation.getItemType() +
|
|
43
|
+
? `${creation.getItemType() + "." + creation.getCreationId()}`
|
|
45
44
|
: creation.getCreationId(),
|
|
46
45
|
], currentMyGalleryId: currentMyGalleryId }));
|
|
47
46
|
}
|
|
48
|
-
else if (type ===
|
|
47
|
+
else if (type === "likes") {
|
|
49
48
|
if (!isLicked) {
|
|
50
|
-
await addLikeToCard(creation instanceof CollectionCreationEntity_1.default &&
|
|
51
|
-
creation.getItemType() !== ItemType_1.LabelKeys.collection
|
|
49
|
+
await addLikeToCard(creation instanceof CollectionCreationEntity_1.default && creation.getItemType() !== types_1.LabelKeys.collection
|
|
52
50
|
? creation.getCollectionCreationId()
|
|
53
51
|
: creation.getItemId());
|
|
54
52
|
}
|
|
55
53
|
else {
|
|
56
|
-
await deleteLikeFromCard(creation instanceof CollectionCreationEntity_1.default &&
|
|
57
|
-
creation.getItemType() !== ItemType_1.LabelKeys.collection
|
|
54
|
+
await deleteLikeFromCard(creation instanceof CollectionCreationEntity_1.default && creation.getItemType() !== types_1.LabelKeys.collection
|
|
58
55
|
? creation.getCollectionCreationId()
|
|
59
56
|
: creation.getItemId());
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
};
|
|
63
60
|
const renderLikeButton = () => {
|
|
64
|
-
if ([
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLicked ?
|
|
61
|
+
if ([types_1.LabelKeys.asset, types_1.LabelKeys.collection].includes(creation.getItemType())) {
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLicked ? "liked" : ""}`, onClick: (e) => handleClick(e, "likes"), children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, {}) }));
|
|
66
63
|
}
|
|
67
64
|
};
|
|
68
65
|
return ((0, jsx_runtime_1.jsxs)(Headicons_1.default, { isMobile: isMobile, style: isDisabled
|
|
69
66
|
? {
|
|
70
|
-
pointerEvents:
|
|
67
|
+
pointerEvents: "none",
|
|
71
68
|
}
|
|
72
|
-
: {}, children: [(0, jsx_runtime_1.jsx)("div", { className:
|
|
73
|
-
? 'fav-list'
|
|
74
|
-
: 'gallery'), children: isRegularCard || !isUserProfile || isGallery ? ((0, jsx_runtime_1.jsx)(addToFavListIcon_svg_1.default, {})) : ((0, jsx_runtime_1.jsx)(addToGalleryIcon_svg_1.default, {})) }), renderLikeButton()] }))] }));
|
|
69
|
+
: {}, children: [(0, jsx_runtime_1.jsx)("div", { className: "rank", children: (0, jsx_runtime_1.jsx)(CardRank_1.default, { rank: creation.getRank() }) }), !isProd() && !isShowCheckbox && ((0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: (e) => handleClick(e, isRegularCard || !isUserProfile || isGallery ? "fav-list" : "gallery"), children: isRegularCard || !isUserProfile || isGallery ? (0, jsx_runtime_1.jsx)(addToFavListIcon_svg_1.default, {}) : (0, jsx_runtime_1.jsx)(addToGalleryIcon_svg_1.default, {}) }), renderLikeButton()] }))] }));
|
|
75
70
|
};
|
|
76
71
|
exports.CardHead = CardHead;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TGallery } from '../../../entities/gallery/types';
|
|
2
2
|
import { TCreationAndCollection } from '../../../modules/virtuoso/types';
|
|
3
3
|
import { searchSchema as schema } from "@ludo.ninja/api";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
export type RemoveToolsType = {
|
|
6
|
-
gallery?:
|
|
6
|
+
gallery?: TGallery;
|
|
7
7
|
removeFn: (itemType: "asset" | "collection") => void;
|
|
8
8
|
};
|
|
9
9
|
export interface ICheckboxState {
|
|
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.CreationCard = void 0;
|
|
30
30
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
-
const
|
|
31
|
+
const types_1 = require("../../../entities/labelCreationType/types");
|
|
32
32
|
const likes_1 = __importDefault(require("../../../hooks/likes"));
|
|
33
33
|
const env_1 = require("../../../store/env");
|
|
34
34
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
@@ -109,11 +109,11 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
|
|
|
109
109
|
const isHideProd = isProd();
|
|
110
110
|
const HideLink = isHideProd ? react_1.default.Fragment : link_1.default;
|
|
111
111
|
const getLink = (href) => {
|
|
112
|
-
if (creation.getItemType() ===
|
|
113
|
-
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}/${href.replace(`/${
|
|
112
|
+
if (creation.getItemType() === types_1.LabelKeys.asset) {
|
|
113
|
+
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}/${href.replace(`/${types_1.LabelKeys.asset}/`, "")}`;
|
|
114
114
|
}
|
|
115
|
-
if (creation.getItemType() ===
|
|
116
|
-
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["collections"]}/${href.replace(`/${
|
|
115
|
+
if (creation.getItemType() === types_1.LabelKeys.collection) {
|
|
116
|
+
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["collections"]}/${href.replace(`/${types_1.LabelKeys.collection}/`, "")}`;
|
|
117
117
|
}
|
|
118
118
|
return href;
|
|
119
119
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import CollectionCreationEntity from '../../../dto/Collection/CollectionCreationEntity';
|
|
2
2
|
import CreationEntity from '../../../dto/CreationEntity';
|
|
3
|
-
import
|
|
3
|
+
import { TGallery } from '../../../entities/gallery/types';
|
|
4
4
|
declare const MultiMediaCard: ({ gallery, assets, collections, }: {
|
|
5
|
-
gallery:
|
|
5
|
+
gallery: TGallery;
|
|
6
6
|
assets: CreationEntity[] | null;
|
|
7
7
|
collections: CollectionCreationEntity[] | null;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -96,7 +96,7 @@ const MultiMediaCard = ({ gallery, assets, collections, }) => {
|
|
|
96
96
|
// (!collections || collections.length === 0)
|
|
97
97
|
// )
|
|
98
98
|
// return null;
|
|
99
|
-
const galleryCreationIds = gallery.
|
|
99
|
+
const galleryCreationIds = gallery.creationIds;
|
|
100
100
|
const cardsMedia = [];
|
|
101
101
|
for (let i = 0; i < 4; i++) {
|
|
102
102
|
const creationId = galleryCreationIds[i];
|
|
@@ -116,10 +116,10 @@ const MultiMediaCard = ({ gallery, assets, collections, }) => {
|
|
|
116
116
|
}
|
|
117
117
|
return cardsMedia;
|
|
118
118
|
};
|
|
119
|
-
const secondName = gallery.
|
|
119
|
+
const secondName = gallery.username !== "" ? gallery.username : "";
|
|
120
120
|
// const userCreationAddresses = gallery?.getGalleryCreations()[0]?.getOwnersAddresses();
|
|
121
121
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
122
|
-
return ((0, jsx_runtime_1.jsx)(StyledMultiCard, { children: (0, jsx_runtime_1.jsxs)(link_1.default, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}${gallery.
|
|
122
|
+
return ((0, jsx_runtime_1.jsx)(StyledMultiCard, { children: (0, jsx_runtime_1.jsxs)(link_1.default, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}${gallery.creationLink}`, children: [(0, jsx_runtime_1.jsx)(MultiHead_1.default, { children: renderMedia() }), (0, jsx_runtime_1.jsx)(CardContent_1.default, { firstName: gallery.name, secondName: secondName, wallets: gallery.userWallets, isNeedShowMoreButton: false, itemId: gallery.galleryId, children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "flex-end", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: gallery.label }), (0, jsx_runtime_1.jsx)(CardLikes_1.default, { isLiked: false, likes: 0 })] }) })] }) }));
|
|
123
123
|
};
|
|
124
124
|
// Export
|
|
125
125
|
exports.default = MultiMediaCard;
|