@bindu-dashing/dam-solution-v2 5.8.50 → 5.8.52
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.
|
@@ -165,6 +165,6 @@ const AddDrive = () => {
|
|
|
165
165
|
},
|
|
166
166
|
];
|
|
167
167
|
const toggleGenerateThumbnails = () => setState((prevState) => (Object.assign(Object.assign({}, prevState), { showGenerateThumbnails: !prevState.showGenerateThumbnails })));
|
|
168
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "md-lib-flex md-lib-gap-3", children: [_jsx(CustomButton, { label: "Generate Thumbnails", icon: _jsx(RiGalleryLineIcon, {}), size: "large", onClick: toggleGenerateThumbnails }), _jsx(Dropdown, { menu: { items }, trigger: ["click"], placement: "bottomRight", children: _jsxs(Button, { icon: _jsx(GoPlusIcon, { size: 16 }), type: "primary", size: "large", children: ["Add ", _jsx(MdKeyboardArrowDownIconIcon, {})] }) })] }), _jsx("input", { ref: fileInputRef, type: "file",
|
|
168
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "md-lib-flex md-lib-gap-3", children: [_jsx(CustomButton, { label: "Generate Thumbnails", icon: _jsx(RiGalleryLineIcon, {}), size: "large", onClick: toggleGenerateThumbnails }), _jsx(Dropdown, { menu: { items }, trigger: ["click"], placement: "bottomRight", children: _jsxs(Button, { icon: _jsx(GoPlusIcon, { size: 16 }), type: "primary", size: "large", children: ["Add ", _jsx(MdKeyboardArrowDownIconIcon, {})] }) })] }), _jsx("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleNativeFileUpload }), openFolderModal && (_jsx(AddFolder, { open: openFolderModal, handleCancel: toggleFolderModal })), openMapFile && (_jsx(MapFile, { open: openMapFile, handleCancel: toggleOpenMapFile, filesList: filesList, fromUpload: true })), showUploadStatus && (_jsx(UploadStatusModal, { open: showUploadStatus, statusList: uploadStatusList, onClose: () => setState((prevState) => (Object.assign(Object.assign({}, prevState), { showUploadStatus: false }))) })), openBlukUploadModal && (_jsx(BulkUploadModal, { toggleUpload: toggleFolderBulkModal, folderId: folderId !== null && folderId !== void 0 ? folderId : rootFolderId })), showGenerateThumbnails && (_jsx(BulkUploadModal, { toggleUpload: toggleGenerateThumbnails, thumbnailsOnly: true, folderId: folderId !== null && folderId !== void 0 ? folderId : rootFolderId }))] }));
|
|
169
169
|
};
|
|
170
170
|
export default AddDrive;
|
|
@@ -23,6 +23,43 @@ const FolderGridView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
23
23
|
const { showPreviewModal, selectedFile } = state;
|
|
24
24
|
const { type } = useAppParams();
|
|
25
25
|
const clickTimer = useRef(null);
|
|
26
|
+
const doubleClickDetected = useRef(false);
|
|
27
|
+
const handleDoubleClick = (folder) => {
|
|
28
|
+
const id = get(folder, "_id");
|
|
29
|
+
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
30
|
+
// Mark that double-click was detected
|
|
31
|
+
doubleClickDetected.current = true;
|
|
32
|
+
// Clear any pending single-click timer
|
|
33
|
+
if (clickTimer.current) {
|
|
34
|
+
clearTimeout(clickTimer.current);
|
|
35
|
+
clickTimer.current = null;
|
|
36
|
+
}
|
|
37
|
+
if (isImagePicker) {
|
|
38
|
+
if (fileType === EntityType.FILE) {
|
|
39
|
+
setSelectedFile === null || setSelectedFile === void 0 ? void 0 : setSelectedFile(folder);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
setParentFolderId === null || setParentFolderId === void 0 ? void 0 : setParentFolderId(id);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (type === DriveModes.FOLDERS) {
|
|
46
|
+
if (navigate) {
|
|
47
|
+
navigate(FETCH_ENTITY_SCREEN.replace(":id", id).replace(":type", fileType));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (fileType === EntityType.FOLDER && navigate) {
|
|
52
|
+
navigate(SUBFOLDERS_SCREEN.replace(":folderId", id));
|
|
53
|
+
}
|
|
54
|
+
if (fileType === EntityType.FILE && type !== DriveModes.TRASH) {
|
|
55
|
+
setState((prevState) => (Object.assign(Object.assign({}, prevState), { selectedFile: folder, showPreviewModal: true })));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Reset the flag after a short delay
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
doubleClickDetected.current = false;
|
|
61
|
+
}, 300);
|
|
62
|
+
};
|
|
26
63
|
const handleClick = (folder) => {
|
|
27
64
|
const id = get(folder, "_id");
|
|
28
65
|
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
@@ -52,6 +89,11 @@ const FolderGridView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
52
89
|
return;
|
|
53
90
|
}
|
|
54
91
|
clickTimer.current = setTimeout(() => {
|
|
92
|
+
// Don't execute single-click action if double-click was detected
|
|
93
|
+
if (doubleClickDetected.current) {
|
|
94
|
+
clickTimer.current = null;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
55
97
|
if (fileType === EntityType.FILE) {
|
|
56
98
|
const alreadySelected = includes(selectedFileIds, id);
|
|
57
99
|
setSelectedItems({
|
|
@@ -84,7 +126,7 @@ const FolderGridView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
84
126
|
(sortOrder === SortOrders.ASCEND ? (_jsx(ArrowUpOutlined, { className: "md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-w-4 md-lib-h-4" })) : (_jsx(ArrowDownOutlined, { className: "md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-w-4 md-lib-h-4" }))), sortBy !== SortByKeys.SIZE && (_jsx(FaSortIcon, { className: "md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-w-4 md-lib-h-4" }))] })] })] }), _jsx("div", { className: "md-lib-grid md-lib-grid-cols-2 md:md-lib-grid-cols-3 xl:md-lib-grid-cols-4 2xl:md-lib-grid-cols-5 md-lib-gap-x-4 md-lib-gap-y-10", children: _.map(folders, (folder) => {
|
|
85
127
|
const isSelected = includes(selectedFolderIds, get(folder, "_id")) ||
|
|
86
128
|
get(selectedPickerFile, "_id") === get(folder, "_id");
|
|
87
|
-
return (_jsxs("div", { className: `md-lib-border md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-rounded-lg md-lib-px-5 md-lib-h-16 md-lib-flex md-lib-items-center md-lib-justify-between md-lib-cursor-pointer ${isSelected ? "md-lib-bg-borderColor dark:md-lib-bg-darkSecondaryBg" : ""}`, onClick: () => handleClick(folder), children: [_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-2 md-lib-w-[calc(100%-20px)]", children: [_jsxs("div", { children: [" ", _jsx(FaFolderIcon, { className: "md-lib-text-primaryColor", size: 32 })] }), _jsx("p", { className: "md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-truncate", title: get(folder, "name", "N/A"), children: get(folder, "name") })] }), !isImagePicker && type !== DriveModes.FOLDERS && (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(FolderMenuOptions, { folder: folder }) }))] }, get(folder, "_id")));
|
|
129
|
+
return (_jsxs("div", { className: `md-lib-border md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-rounded-lg md-lib-px-5 md-lib-h-16 md-lib-flex md-lib-items-center md-lib-justify-between md-lib-cursor-pointer ${isSelected ? "md-lib-bg-borderColor dark:md-lib-bg-darkSecondaryBg" : ""}`, onClick: () => handleClick(folder), onDoubleClick: () => handleDoubleClick(folder), children: [_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-2 md-lib-w-[calc(100%-20px)]", children: [_jsxs("div", { children: [" ", _jsx(FaFolderIcon, { className: "md-lib-text-primaryColor", size: 32 })] }), _jsx("p", { className: "md-lib-text-textColor dark:md-lib-text-darkTextColor md-lib-truncate", title: get(folder, "name", "N/A"), children: get(folder, "name") })] }), !isImagePicker && type !== DriveModes.FOLDERS && (_jsx("div", { onClick: (e) => e.stopPropagation(), children: _jsx(FolderMenuOptions, { folder: folder }) }))] }, get(folder, "_id")));
|
|
88
130
|
}) }), _jsx(FilesGridView, { files: files, handleClick: handleClick, selectedFileIds: selectedFileIds, isImagePicker: isImagePicker, selectedPickerFile: selectedPickerFile }), _jsx(LoadMoreItems, { hasNextPage: hasNextPage, isItemsFetching: foldersFetching, fetchNextPage: fetchNextPage }), (!!get(selectedFileIds, "length") ||
|
|
89
131
|
!!get(selectedFolderIds, "length")) && (_jsx(ActionsBar, { fileIds: selectedFileIds, folderIds: selectedFolderIds, onCloseSelection: () => setSelectedItems({ fileIds: [], folderIds: [] }) })), showPreviewModal && (_jsx(FileDetails, { open: showPreviewModal, handleClose: () => {
|
|
90
132
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { showPreviewModal: false, selectedFile: {} })));
|
|
@@ -48,6 +48,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
48
48
|
const { showPreviewModal, selectedFile } = state;
|
|
49
49
|
const { type } = useAppParams();
|
|
50
50
|
const clickTimer = useRef(null);
|
|
51
|
+
const doubleClickDetected = useRef(false);
|
|
51
52
|
const assetIds = Array.from(new Set(folders
|
|
52
53
|
.filter((f) => get(f, "type") === EntityType.FILE)
|
|
53
54
|
.map((f) => get(f, "assetId"))
|
|
@@ -60,6 +61,42 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
60
61
|
.flat();
|
|
61
62
|
return allFields;
|
|
62
63
|
}, [assetIds, assets]);
|
|
64
|
+
const handleDoubleClick = (folder) => {
|
|
65
|
+
const id = get(folder, "_id");
|
|
66
|
+
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
67
|
+
// Mark that double-click was detected
|
|
68
|
+
doubleClickDetected.current = true;
|
|
69
|
+
// Clear any pending single-click timer
|
|
70
|
+
if (clickTimer.current) {
|
|
71
|
+
clearTimeout(clickTimer.current);
|
|
72
|
+
clickTimer.current = null;
|
|
73
|
+
}
|
|
74
|
+
if (isImagePicker) {
|
|
75
|
+
if (fileType === EntityType.FILE) {
|
|
76
|
+
setSelectedFile === null || setSelectedFile === void 0 ? void 0 : setSelectedFile(folder);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
setParentFolderId === null || setParentFolderId === void 0 ? void 0 : setParentFolderId(id);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (type === DriveModes.FOLDERS) {
|
|
83
|
+
if (navigate) {
|
|
84
|
+
navigate(FETCH_ENTITY_SCREEN.replace(":id", id).replace(":type", fileType));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
if (fileType === EntityType.FOLDER && navigate) {
|
|
89
|
+
navigate(SUBFOLDERS_SCREEN.replace(":folderId", id));
|
|
90
|
+
}
|
|
91
|
+
if (fileType === EntityType.FILE && type !== DriveModes.TRASH) {
|
|
92
|
+
setState((prevState) => (Object.assign(Object.assign({}, prevState), { selectedFile: folder, showPreviewModal: true })));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Reset the flag after a short delay
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
doubleClickDetected.current = false;
|
|
98
|
+
}, 300);
|
|
99
|
+
};
|
|
63
100
|
const handleClick = (folder) => {
|
|
64
101
|
const id = get(folder, "_id");
|
|
65
102
|
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
@@ -89,6 +126,11 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
89
126
|
return;
|
|
90
127
|
}
|
|
91
128
|
clickTimer.current = setTimeout(() => {
|
|
129
|
+
// Don't execute single-click action if double-click was detected
|
|
130
|
+
if (doubleClickDetected.current) {
|
|
131
|
+
clickTimer.current = null;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
92
134
|
if (fileType === EntityType.FILE) {
|
|
93
135
|
const alreadySelected = includes(selectedFileIds, id);
|
|
94
136
|
setSelectedItems({
|
|
@@ -161,7 +203,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
161
203
|
includes(selectedFolderIds, id)) ||
|
|
162
204
|
get(selectedPickerFile, "_id") === id;
|
|
163
205
|
const currentAsset = assets.find((asset) => asset._id === get(folder, "assetId"));
|
|
164
|
-
return (_jsxs("div", { onClick: () => handleClick(folder), className: `md-lib-flex md-lib-justify-between md-lib-gap-2 md-lib-items-center md-lib-min-w-fit md-lib-py-3 md-lib-px-2 md-lib-rounded-xl md-lib-cursor-pointer hover:md-lib-bg-borderColor dark:hover:md-lib-bg-darkSecondaryBg ${isSelected
|
|
206
|
+
return (_jsxs("div", { onClick: () => handleClick(folder), onDoubleClick: () => handleDoubleClick(folder), className: `md-lib-flex md-lib-justify-between md-lib-gap-2 md-lib-items-center md-lib-min-w-fit md-lib-py-3 md-lib-px-2 md-lib-rounded-xl md-lib-cursor-pointer hover:md-lib-bg-borderColor dark:hover:md-lib-bg-darkSecondaryBg ${isSelected
|
|
165
207
|
? "md-lib-bg-borderColor dark:md-lib-bg-darkSecondaryBg"
|
|
166
208
|
: ""}`, children: [" ", !isImagePicker && type !== DriveModes.FOLDERS && (_jsx("div", { className: "md-lib-w-6", onClick: (e) => e.stopPropagation(), children: get(folder, "type") === EntityType.FILE ? (get(folder, "fileUploadStatus") ===
|
|
167
209
|
ThumbnailStatus.PENDING ? (_jsx(_Fragment, {})) : (_jsx(FileMenuOptions, { file: folder }))) : (_jsx(FolderMenuOptions, { folder: folder })) })), _jsx("div", { className: "md-lib-flex md-lib-items-center md-lib-justify-between md-lib-w-[280px] md-lib-text-[15px] md-lib-text-textColor dark:md-lib-text-darkTextColor", title: name, children: _jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-2 md-lib-overflow-hidden", children: [_jsx("div", { children: get(folder, "type") === EntityType.FILE ? (get(folder, "fileUploadStatus") ===
|