@ludo.ninja/components 1.8.6 → 1.8.8

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 (63) hide show
  1. package/dist/components/favoriteList/add/addAssetToFavoriteList/index.js +1 -1
  2. package/dist/components/favoriteList/add/addCollectionToFavoriteList/index.js +1 -1
  3. package/dist/components/favoriteList/add/addCreationToFavoriteList/index.js +1 -1
  4. package/dist/components/gallery/add/addAssetToGallery/index.js +1 -1
  5. package/dist/components/gallery/add/addCreationToGallery/index.js +1 -1
  6. package/dist/components/headers/header/index.js +1 -1
  7. package/dist/components/headers/headerSearch/index.js +1 -1
  8. package/dist/components/myWallets/myWalletItem/index.js +1 -1
  9. package/dist/components/profile/wallets/index.js +1 -1
  10. package/dist/components/search/SearchInputContainer.js +1 -1
  11. package/dist/components/search/searchSelectsGalleries/index.js +1 -1
  12. package/dist/components/search/searchSelectsSets/index.js +1 -1
  13. package/dist/components/shareDialog/index.d.ts +2 -2
  14. package/dist/components/shareDialog/index.js +31 -30
  15. package/dist/components/sidebar/index.js +14 -15
  16. package/dist/hooks/likes/dynamic/useFindCollectionsAndLikes.js +1 -1
  17. package/dist/modules/notifications/CreatorNotifications.js +1 -1
  18. package/dist/modules/user/profileData/profileDataInitialization.js +4 -4
  19. package/dist/store/ui/utils.d.ts +1 -1
  20. package/dist/system/Alert/index.js +1 -1
  21. package/dist/system/Cards/CardContent/CardShowMore/index.js +3 -3
  22. package/dist/system/Cards/CardHeadIcons/index.js +3 -3
  23. package/dist/system/Modals/Modal/Modal.test.js +4 -4
  24. package/dist/system/Modals/ModalSidebar/CreatorModalSidebarPortal.js +1 -1
  25. package/dist/system/Modals/ModalSidebar/ModalSidebar.test.js +2 -2
  26. package/dist/system/Overlay/Overlay.test.js +2 -2
  27. package/dist/system/Overlay/index.js +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/package.json +1 -1
  30. package/dist/components/assetJSONLD.d.ts +0 -1
  31. package/dist/components/assetJSONLD.js +0 -31
  32. package/dist/components/editProfile/Cropper/index.d.ts +0 -21
  33. package/dist/components/editProfile/Cropper/index.js +0 -113
  34. package/dist/components/editProfile/UserPicProfile/index.d.ts +0 -5
  35. package/dist/components/editProfile/UserPicProfile/index.js +0 -282
  36. package/dist/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +0 -22
  37. package/dist/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +0 -283
  38. package/dist/modules/gallery/api/useGetFavoriteGallery.d.ts +0 -6
  39. package/dist/modules/gallery/api/useGetFavoriteGallery.js +0 -43
  40. package/dist/modules/gallery/store.d.ts +0 -26
  41. package/dist/modules/gallery/store.js +0 -147
  42. package/dist/modules/gallery/ui/AllResults.d.ts +0 -4
  43. package/dist/modules/gallery/ui/AllResults.js +0 -19
  44. package/dist/modules/gallery/ui/Description.d.ts +0 -5
  45. package/dist/modules/gallery/ui/Description.js +0 -70
  46. package/dist/modules/gallery/ui/EditGallery.d.ts +0 -10
  47. package/dist/modules/gallery/ui/EditGallery.js +0 -99
  48. package/dist/modules/gallery/ui/GalleryDeleteIcon.d.ts +0 -5
  49. package/dist/modules/gallery/ui/GalleryDeleteIcon.js +0 -51
  50. package/dist/modules/gallery/ui/PlaceholderItemsGallery.d.ts +0 -2
  51. package/dist/modules/gallery/ui/PlaceholderItemsGallery.js +0 -24
  52. package/dist/modules/gallery/ui/STopSections.d.ts +0 -2
  53. package/dist/modules/gallery/ui/STopSections.js +0 -15
  54. package/dist/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +0 -8
  55. package/dist/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +0 -37
  56. package/dist/modules/gallery/ui/chooseGalleryItems/index.d.ts +0 -16
  57. package/dist/modules/gallery/ui/chooseGalleryItems/index.js +0 -146
  58. package/dist/modules/gallery/ui/createGalleryForm/index.d.ts +0 -14
  59. package/dist/modules/gallery/ui/createGalleryForm/index.js +0 -146
  60. package/dist/modules/gallery/ui/editGalleryForm/index.d.ts +0 -9
  61. package/dist/modules/gallery/ui/editGalleryForm/index.js +0 -187
  62. package/dist/modules/gallery/ui/itemsPreview/index.d.ts +0 -20
  63. package/dist/modules/gallery/ui/itemsPreview/index.js +0 -203
@@ -1,187 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
41
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
42
- return new (P || (P = Promise))(function (resolve, reject) {
43
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
44
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
45
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
46
- step((generator = generator.apply(thisArg, _arguments || [])).next());
47
- });
48
- };
49
- var __generator = (this && this.__generator) || function (thisArg, body) {
50
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
51
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
52
- function verb(n) { return function (v) { return step([n, v]); }; }
53
- function step(op) {
54
- if (f) throw new TypeError("Generator is already executing.");
55
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
56
- 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;
57
- if (y = 0, t) op = [op[0] & 2, t.value];
58
- switch (op[0]) {
59
- case 0: case 1: t = op; break;
60
- case 4: _.label++; return { value: op[1], done: false };
61
- case 5: _.label++; y = op[1]; op = [0]; continue;
62
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
63
- default:
64
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
65
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
66
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
67
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
68
- if (t[2]) _.ops.pop();
69
- _.trys.pop(); continue;
70
- }
71
- op = body.call(thisArg, _);
72
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
73
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
74
- }
75
- };
76
- var __importDefault = (this && this.__importDefault) || function (mod) {
77
- return (mod && mod.__esModule) ? mod : { "default": mod };
78
- };
79
- Object.defineProperty(exports, "__esModule", { value: true });
80
- var react_1 = __importStar(require("react"));
81
- var react_hook_form_1 = require("react-hook-form");
82
- var styled_components_1 = __importDefault(require("styled-components"));
83
- var type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
84
- var _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
85
- var store_1 = require("@/modules/gallery/store");
86
- var ui_1 = require("@/store/ui");
87
- var useEditGallery_1 = __importDefault(require("@/api/server-galleries/mutations/useEditGallery"));
88
- var styles_1 = require("@ludo.ninja/components/dist/styles");
89
- var colors_1 = require("@/styles/colors");
90
- var typography_1 = require("@/styles/typography");
91
- var MainButton_1 = __importDefault(require("@/system/Buttons/MainButton"));
92
- var Forms_1 = require("@/system/Forms");
93
- var Messages_1 = __importDefault(require("@/system/Forms/Messages"));
94
- // Styles
95
- var StyledCreateForm = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: 344px;\n min-height: calc(460px - 24px);\n position: relative;\n\n .head {\n margin-bottom: 20px;\n\n .tittle {\n ", ";\n color: ", ";\n margin: 0;\n }\n }\n\n .content {\n margin-bottom: 60px;\n\n .input_group {\n position: relative;\n margin-bottom: 16px;\n }\n }\n\n .btns {\n margin-top: 16px;\n display: flex;\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n gap: 16px;\n\n .add {\n width: 100%;\n\n & button {\n font-size: 15px;\n font-weight: 500;\n line-height: 1.47;\n\n @media (max-width: 767px) {\n font-size: 14px;\n line-height: 1.43;\n }\n }\n }\n\n .cancel {\n width: 100%;\n }\n\n & button {\n width: 100%;\n padding: 9px 0;\n }\n }\n\n @media (max-width: 767px) {\n margin-right: 0;\n .content {\n width: auto;\n }\n\n .btns {\n position: static;\n justify-content: center;\n }\n\n .add,\n .cancel {\n max-width: 140px;\n }\n }\n\n ", " {\n min-width: ", ";\n min-height: calc(", " - ", ");\n\n .head {\n margin-bottom: ", ";\n }\n\n .content {\n margin-bottom: ", ";\n\n .input_group {\n margin-bottom: ", ";\n }\n }\n\n .btns {\n margin-top: ", ";\n gap: ", ";\n\n .add {\n & button {\n font-size: ", ";\n }\n }\n\n & button {\n padding: ", " 0;\n }\n }\n }\n"], ["\n min-width: 344px;\n min-height: calc(460px - 24px);\n position: relative;\n\n .head {\n margin-bottom: 20px;\n\n .tittle {\n ", ";\n color: ", ";\n margin: 0;\n }\n }\n\n .content {\n margin-bottom: 60px;\n\n .input_group {\n position: relative;\n margin-bottom: 16px;\n }\n }\n\n .btns {\n margin-top: 16px;\n display: flex;\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n gap: 16px;\n\n .add {\n width: 100%;\n\n & button {\n font-size: 15px;\n font-weight: 500;\n line-height: 1.47;\n\n @media (max-width: 767px) {\n font-size: 14px;\n line-height: 1.43;\n }\n }\n }\n\n .cancel {\n width: 100%;\n }\n\n & button {\n width: 100%;\n padding: 9px 0;\n }\n }\n\n @media (max-width: 767px) {\n margin-right: 0;\n .content {\n width: auto;\n }\n\n .btns {\n position: static;\n justify-content: center;\n }\n\n .add,\n .cancel {\n max-width: 140px;\n }\n }\n\n ", " {\n min-width: ", ";\n min-height: calc(", " - ", ");\n\n .head {\n margin-bottom: ", ";\n }\n\n .content {\n margin-bottom: ", ";\n\n .input_group {\n margin-bottom: ", ";\n }\n }\n\n .btns {\n margin-top: ", ";\n gap: ", ";\n\n .add {\n & button {\n font-size: ", ";\n }\n }\n\n & button {\n padding: ", " 0;\n }\n }\n }\n"])), typography_1.FH3, colors_1.BlackColor, styles_1.mediaQuery.minWidthFourK, (0, _4k_1.adaptiveValueCalc)(344), (0, _4k_1.adaptiveValueCalc)(460), (0, _4k_1.adaptiveValueCalc)(24), (0, _4k_1.adaptiveValueCalc)(20), (0, _4k_1.adaptiveValueCalc)(60), (0, _4k_1.adaptiveValueCalc)(16), (0, _4k_1.adaptiveValueCalc)(16), (0, _4k_1.adaptiveValueCalc)(16), (0, _4k_1.adaptiveValueCalc)(15), (0, _4k_1.adaptiveValueCalc)(9));
96
- // Component
97
- var EditGalleryForm = function (_a) {
98
- var title = _a.title, inputPlaceHolderText = _a.inputPlaceHolderText, galleryId = _a.galleryId, name = _a.name, description = _a.description;
99
- var updateGalleryInfo = (0, store_1.useGalleryStore)(function (state) { return state.updateGalleryInfo; });
100
- var editGallery = (0, useEditGallery_1.default)().editGallery;
101
- var _b = (0, react_hook_form_1.useForm)({
102
- mode: 'all',
103
- }), register = _b.register, handleSubmit = _b.handleSubmit, errors = _b.formState.errors, reset = _b.reset;
104
- (0, react_1.useEffect)(function () {
105
- var defaultValues = {
106
- galleryName: name,
107
- galleryDescription: description,
108
- };
109
- reset(__assign({}, defaultValues));
110
- }, [name, description]);
111
- var openAlert = (0, ui_1.useUiStore)(function (state) { return state.openAlert; });
112
- var closeModalSidebar = (0, ui_1.useUiStore)(function (state) { return state.closeModalSidebar; });
113
- var dataForgalleryName = {
114
- labelText: 'galleryName',
115
- name: 'galleryName',
116
- placeHolder: inputPlaceHolderText,
117
- };
118
- var dataForBio = {
119
- labelText: 'Bio',
120
- name: 'galleryDescription',
121
- placeHolder: 'Description (tags and hashtags are supported)',
122
- };
123
- var registergalleryName = register('galleryName', Messages_1.default[dataForgalleryName.name]);
124
- var registergalleryDescription = register('galleryDescription', Messages_1.default[dataForBio.name]);
125
- var errorGalleryName = {
126
- isNeedShowError: Boolean(errors === null || errors === void 0 ? void 0 : errors.galleryName),
127
- message: (errors === null || errors === void 0 ? void 0 : errors.galleryName) && (errors === null || errors === void 0 ? void 0 : errors.galleryName.message),
128
- };
129
- var errorGalleryDescription = {
130
- isNeedShowError: Boolean(errors === null || errors === void 0 ? void 0 : errors.galleryDescription),
131
- message: (errors === null || errors === void 0 ? void 0 : errors.galleryDescription) && (errors === null || errors === void 0 ? void 0 : errors.galleryDescription.message),
132
- };
133
- var onSubmit = function (_a) {
134
- var galleryName = _a.galleryName, galleryDescription = _a.galleryDescription;
135
- return __awaiter(void 0, void 0, void 0, function () {
136
- var data, error_1;
137
- return __generator(this, function (_b) {
138
- switch (_b.label) {
139
- case 0:
140
- _b.trys.push([0, 2, , 3]);
141
- return [4 /*yield*/, editGallery({
142
- galleryId: galleryId,
143
- name: galleryName,
144
- description: galleryDescription,
145
- })];
146
- case 1:
147
- data = _b.sent();
148
- if (data.data.editGallery) {
149
- updateGalleryInfo({
150
- galleryName: galleryName,
151
- galleryDescription: galleryDescription,
152
- });
153
- }
154
- closeModalSidebar();
155
- return [3 /*break*/, 3];
156
- case 2:
157
- error_1 = _b.sent();
158
- openAlert({
159
- type: type_1.alertVariants.error,
160
- caption: error_1 === null || error_1 === void 0 ? void 0 : error_1.message,
161
- });
162
- return [3 /*break*/, 3];
163
- case 3: return [2 /*return*/];
164
- }
165
- });
166
- });
167
- };
168
- return (react_1.default.createElement(StyledCreateForm, null,
169
- react_1.default.createElement("div", { className: 'head' },
170
- react_1.default.createElement("h3", { className: 'tittle' }, title)),
171
- react_1.default.createElement("form", { onSubmit: handleSubmit(onSubmit) },
172
- react_1.default.createElement("div", { className: 'content' },
173
- react_1.default.createElement("div", { className: "input_group" },
174
- react_1.default.createElement(Forms_1.Input, { register: registergalleryName, error: errorGalleryName, data: dataForgalleryName })),
175
- react_1.default.createElement("div", { className: "input_group" },
176
- react_1.default.createElement(Forms_1.BasicTextArea, { register: registergalleryDescription,
177
- // counter={0}
178
- isNeedBiggerArea: false, error: errorGalleryDescription, data: dataForBio }))),
179
- react_1.default.createElement("div", { className: "btns" },
180
- react_1.default.createElement("div", { className: 'add' },
181
- react_1.default.createElement(MainButton_1.default, { text: 'Save', type: 'submit', variant: "primaryL", onClick: function () { return null; } })),
182
- react_1.default.createElement("div", { className: 'cancel' },
183
- react_1.default.createElement(MainButton_1.default, { text: 'Cancel', variant: "outline", onClick: closeModalSidebar }))))));
184
- };
185
- // Export
186
- exports.default = EditGalleryForm;
187
- var templateObject_1;
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import CollectionCreationEntity from '@/dto/Collection/CollectionCreationEntity';
3
- import CreationEntity from '@/dto/CreationEntity';
4
- export declare const useVirtuosoData: <TData>({ creations, isMobile, }: {
5
- isMobile: boolean;
6
- creations: TData[];
7
- }) => {
8
- virtuosoData: TVirtuosoData<TData>;
9
- placeholderData: number[][];
10
- };
11
- declare const ItemsPreview: ({ creations, deleteMethod, title, loadMore, isLoading, isNextLoading, allCount, }: {
12
- creations: (CreationEntity | CollectionCreationEntity)[];
13
- deleteMethod: (itemId: string) => void;
14
- title: string;
15
- loadMore?: () => void;
16
- isLoading?: boolean;
17
- isNextLoading?: boolean;
18
- allCount?: number;
19
- }) => React.JSX.Element;
20
- export default ItemsPreview;
@@ -1,203 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || function (mod) {
23
- if (mod && mod.__esModule) return mod;
24
- var result = {};
25
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
- __setModuleDefault(result, mod);
27
- return result;
28
- };
29
- var __importDefault = (this && this.__importDefault) || function (mod) {
30
- return (mod && mod.__esModule) ? mod : { "default": mod };
31
- };
32
- Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.useVirtuosoData = void 0;
34
- var react_1 = __importStar(require("react"));
35
- var react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
36
- var react_virtuoso_1 = require("react-virtuoso");
37
- var styled_components_1 = __importDefault(require("styled-components"));
38
- var ScreenWidth_1 = require("@ludo.ninja/ui/build/styles/ScreenWidth");
39
- var _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
40
- var styles_1 = require("@ludo.ninja/components/dist/styles");
41
- var colors_1 = require("@/styles/colors");
42
- var typography_1 = require("@/styles/typography");
43
- var CardImage_1 = __importDefault(require("@/system/Cards/CardMedia/CardImage"));
44
- var CardsHolderLoader_1 = __importDefault(require("@/system/CardsHolderWithSkeleton/CardsHolderLoader"));
45
- var check4k_1 = require("@/utils/adaptive/check4k");
46
- var screen_1 = require("@/utils/screen");
47
- var CollectionCreationEntity_1 = __importDefault(require("@/dto/Collection/CollectionCreationEntity"));
48
- // import DeleteIcon from '@/public/gallery/delete.svg';
49
- // Styles
50
- var StyledItemsPreview = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-right: 40px;\n\n .head {\n margin-bottom: 20px;\n\n .tittle {\n ", ";\n color: ", ";\n margin: 0;\n }\n }\n\n .content {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n max-height: 302px;\n min-width: 168px;\n overflow-x: auto;\n }\n\n .content-item {\n position: relative;\n width: 80px;\n height: 80px;\n cursor: pointer;\n transition: transform 0.2s;\n transform: scale(1);\n will-change: transform;\n\n > img,\n video {\n border-radius: 6px;\n }\n\n .content-item-gallery-pic {\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .content-item-gallery-deleteIcon {\n position: absolute;\n right: 4px;\n bottom: 4px;\n transition: transform 0.2s;\n transform: scale(1);\n\n :hover {\n transform: scale(1.15);\n transition: transform 0.2s;\n }\n }\n\n &:hover {\n .content-item-gallery-deleteIcon {\n transform: scale(1.15);\n transition: transform 0.2s;\n }\n }\n }\n\n @media (max-width: 767px) {\n margin-right: 0;\n margin-bottom: 32px;\n\n .content-item {\n width: 68px;\n height: 68px;\n }\n\n .content {\n height: 144px;\n grid-template-columns: 1fr 1fr 1fr 1fr;\n }\n }\n\n ", " {\n margin-right: ", ";\n\n .head {\n margin-bottom: ", ";\n }\n\n .content {\n gap: ", ";\n max-height: ", ";\n min-width: ", ";\n }\n\n .content-item {\n width: ", ";\n height: ", ";\n\n > img,\n video {\n border-radius: ", ";\n }\n\n .content-item-gallery-pic {\n border-radius: ", ";\n }\n\n .content-item-gallery-deleteIcon {\n right: ", ";\n bottom: ", ";\n width: ", ";\n height: ", ";\n }\n }\n }\n"], ["\n margin-right: 40px;\n\n .head {\n margin-bottom: 20px;\n\n .tittle {\n ", ";\n color: ", ";\n margin: 0;\n }\n }\n\n .content {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n max-height: 302px;\n min-width: 168px;\n overflow-x: auto;\n }\n\n .content-item {\n position: relative;\n width: 80px;\n height: 80px;\n cursor: pointer;\n transition: transform 0.2s;\n transform: scale(1);\n will-change: transform;\n\n > img,\n video {\n border-radius: 6px;\n }\n\n .content-item-gallery-pic {\n border-radius: 6px;\n width: 100%;\n height: 100%;\n }\n\n .content-item-gallery-deleteIcon {\n position: absolute;\n right: 4px;\n bottom: 4px;\n transition: transform 0.2s;\n transform: scale(1);\n\n :hover {\n transform: scale(1.15);\n transition: transform 0.2s;\n }\n }\n\n &:hover {\n .content-item-gallery-deleteIcon {\n transform: scale(1.15);\n transition: transform 0.2s;\n }\n }\n }\n\n @media (max-width: 767px) {\n margin-right: 0;\n margin-bottom: 32px;\n\n .content-item {\n width: 68px;\n height: 68px;\n }\n\n .content {\n height: 144px;\n grid-template-columns: 1fr 1fr 1fr 1fr;\n }\n }\n\n ", " {\n margin-right: ", ";\n\n .head {\n margin-bottom: ", ";\n }\n\n .content {\n gap: ", ";\n max-height: ", ";\n min-width: ", ";\n }\n\n .content-item {\n width: ", ";\n height: ", ";\n\n > img,\n video {\n border-radius: ", ";\n }\n\n .content-item-gallery-pic {\n border-radius: ", ";\n }\n\n .content-item-gallery-deleteIcon {\n right: ", ";\n bottom: ", ";\n width: ", ";\n height: ", ";\n }\n }\n }\n"])), typography_1.FH3, colors_1.BlackColor, styles_1.mediaQuery.minWidthFourK, (0, _4k_1.adaptiveValueCalc)(40), (0, _4k_1.adaptiveValueCalc)(20), (0, _4k_1.adaptiveValueCalc)(8), (0, _4k_1.adaptiveValueCalc)(302), (0, _4k_1.adaptiveValueCalc)(168), (0, _4k_1.adaptiveValueCalc)(80), (0, _4k_1.adaptiveValueCalc)(80), (0, _4k_1.adaptiveValueCalc)(6), (0, _4k_1.adaptiveValueCalc)(6), (0, _4k_1.adaptiveValueCalc)(4), (0, _4k_1.adaptiveValueCalc)(4), (0, _4k_1.adaptiveValueCalc)(24), (0, _4k_1.adaptiveValueCalc)(24));
51
- var SCardsRow = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"], ["\n display: flex;\n justify-content: space-between;\n"])));
52
- // Component
53
- var useVirtuosoData = function (_a) {
54
- var creations = _a.creations, isMobile = _a.isMobile;
55
- var virtuosoData = (0, react_1.useMemo)(function () {
56
- var columnCount = isMobile ? 4 : 2;
57
- var creationPacks = [];
58
- var indexPack = 0;
59
- creations.forEach(function (creation) {
60
- if (!creationPacks[indexPack]) {
61
- creationPacks[indexPack] = [];
62
- }
63
- creationPacks[indexPack].push(creation);
64
- if (creationPacks[indexPack].length >= columnCount) {
65
- indexPack++;
66
- }
67
- });
68
- return { creationPacks: creationPacks, creations: creations };
69
- }, [isMobile, creations]);
70
- var placeholderData = (0, react_1.useMemo)(function () {
71
- var columnCount = isMobile ? 4 : 2;
72
- var creationPacks = [[]];
73
- var indexPack = 0;
74
- Array.from({
75
- length: 12,
76
- }).forEach(function (_, index) {
77
- if (!creationPacks[indexPack]) {
78
- creationPacks[indexPack] = [];
79
- }
80
- creationPacks[indexPack].push(index);
81
- if (creationPacks[indexPack].length >= columnCount) {
82
- indexPack++;
83
- }
84
- });
85
- return creationPacks;
86
- }, [isMobile]);
87
- return {
88
- virtuosoData: virtuosoData,
89
- placeholderData: placeholderData,
90
- };
91
- };
92
- exports.useVirtuosoData = useVirtuosoData;
93
- var ItemsPreview = function (_a) {
94
- var creations = _a.creations, deleteMethod = _a.deleteMethod, title = _a.title, loadMore = _a.loadMore, isLoading = _a.isLoading, isNextLoading = _a.isNextLoading, allCount = _a.allCount;
95
- var _b = (0, screen_1.useWindowDimensionsWithServerInitial)(), isMobile = _b.isMobile, windowDimensions = _b.windowDimensions;
96
- var _c = (0, exports.useVirtuosoData)({
97
- creations: creations,
98
- isMobile: isMobile,
99
- }), virtuosoData = _c.virtuosoData, placeholderData = _c.placeholderData;
100
- var virtuosoBody = (function () {
101
- var getGapCards = function () {
102
- if (windowDimensions &&
103
- windowDimensions.windowWidth >= ScreenWidth_1.ScreenWidth.FOUR_K_MIN) {
104
- return (0, _4k_1.getAdaptiveValue)({
105
- currentSize: 8,
106
- windowWidth: windowDimensions.windowWidth,
107
- });
108
- }
109
- return 8;
110
- };
111
- if (isLoading) {
112
- return {
113
- totalCount: placeholderData.length,
114
- itemContent: function (index) {
115
- return (react_1.default.createElement(SCardsRow, { style: {
116
- paddingBottom: (function () {
117
- if (index === virtuosoData.creationPacks.length - 1) {
118
- return 0;
119
- }
120
- return getGapCards();
121
- })(),
122
- gap: getGapCards(),
123
- } }, placeholderData[index].map(function (_, ind) { return (react_1.default.createElement(react_loading_skeleton_1.default, { height: isMobile
124
- ? 68
125
- : (0, check4k_1.getAdaptiveValueWithCheck4k)({
126
- currentSize: 80,
127
- windowDimensions: windowDimensions,
128
- }), width: isMobile
129
- ? 68
130
- : (0, check4k_1.getAdaptiveValueWithCheck4k)({
131
- currentSize: 80,
132
- windowDimensions: windowDimensions,
133
- }), key: ind })); })));
134
- },
135
- };
136
- }
137
- // if (error) {
138
- // return {
139
- // totalCount: 1,
140
- // itemContent: () => {
141
- // return <CardsError refetch={refetchQuery}/>;
142
- // },
143
- // };
144
- // }
145
- return {
146
- totalCount: virtuosoData.creationPacks.length,
147
- itemContent: function (index) {
148
- var data = virtuosoData.creationPacks[index];
149
- return (react_1.default.createElement(SCardsRow, { style: {
150
- paddingBottom: (function () {
151
- if (index === virtuosoData.creationPacks.length - 1) {
152
- return 0;
153
- }
154
- return getGapCards();
155
- })(),
156
- } }, data.map(function (creation) {
157
- var _a, _b;
158
- return (react_1.default.createElement("div", { className: "content-item", key: creation.getCreationId() },
159
- creation instanceof CollectionCreationEntity_1.default ? (react_1.default.createElement(CardImage_1.default, { alt: "".concat(creation.getName(), " ").concat(creation.getAddress() || ''), imgSrc: (_b = (_a = creation.getOriginalUrls()) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '', errorImg: '/noContent/noContent.svg' })) : (creation.detectMediaType().displaySingleMedia()),
160
- react_1.default.createElement("img", { src: "/gallery/delete.svg", alt: "delete", width: 24, height: 24, className: 'content-item-gallery-deleteIcon', onClick: function () {
161
- return deleteMethod(creation instanceof CollectionCreationEntity_1.default
162
- ? "".concat(creation.getItemType() +
163
- '.' +
164
- creation.getCreationId())
165
- : creation.getCreationId());
166
- } })));
167
- })));
168
- },
169
- };
170
- })();
171
- return (react_1.default.createElement(StyledItemsPreview, null,
172
- react_1.default.createElement("div", { className: 'head' },
173
- react_1.default.createElement("h3", { className: 'tittle' }, "".concat(title, " (").concat(allCount || (creations === null || creations === void 0 ? void 0 : creations.length), ")"))),
174
- react_1.default.createElement(react_virtuoso_1.Virtuoso, { style: {
175
- height: isMobile
176
- ? 144
177
- : (function () {
178
- if (windowDimensions &&
179
- windowDimensions.windowWidth >= ScreenWidth_1.ScreenWidth.FOUR_K_MIN) {
180
- return (0, _4k_1.getAdaptiveValue)({
181
- currentSize: 302,
182
- windowWidth: windowDimensions.windowWidth,
183
- });
184
- }
185
- return 302;
186
- })(),
187
- minWidth: (function () {
188
- if (windowDimensions &&
189
- windowDimensions.windowWidth >= ScreenWidth_1.ScreenWidth.FOUR_K_MIN) {
190
- return (0, _4k_1.getAdaptiveValue)({
191
- currentSize: 168,
192
- windowWidth: windowDimensions.windowWidth,
193
- });
194
- }
195
- return 168;
196
- })(),
197
- }, totalCount: virtuosoBody.totalCount, endReached: loadMore, overscan: 200, itemContent: virtuosoBody.itemContent, components: {
198
- Footer: function () { return (isNextLoading ? react_1.default.createElement(CardsHolderLoader_1.default, null) : null); },
199
- } })));
200
- };
201
- // Export
202
- exports.default = ItemsPreview;
203
- var templateObject_1, templateObject_2;