@bindu-dashing/dam-solution-v2 5.8.52 → 5.8.53
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.
|
@@ -23,43 +23,6 @@ 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
|
-
};
|
|
63
26
|
const handleClick = (folder) => {
|
|
64
27
|
const id = get(folder, "_id");
|
|
65
28
|
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
@@ -89,11 +52,6 @@ const FolderGridView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
89
52
|
return;
|
|
90
53
|
}
|
|
91
54
|
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
|
-
}
|
|
97
55
|
if (fileType === EntityType.FILE) {
|
|
98
56
|
const alreadySelected = includes(selectedFileIds, id);
|
|
99
57
|
setSelectedItems({
|
|
@@ -126,7 +84,7 @@ const FolderGridView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
126
84
|
(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) => {
|
|
127
85
|
const isSelected = includes(selectedFolderIds, get(folder, "_id")) ||
|
|
128
86
|
get(selectedPickerFile, "_id") === 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),
|
|
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")));
|
|
130
88
|
}) }), _jsx(FilesGridView, { files: files, handleClick: handleClick, selectedFileIds: selectedFileIds, isImagePicker: isImagePicker, selectedPickerFile: selectedPickerFile }), _jsx(LoadMoreItems, { hasNextPage: hasNextPage, isItemsFetching: foldersFetching, fetchNextPage: fetchNextPage }), (!!get(selectedFileIds, "length") ||
|
|
131
89
|
!!get(selectedFolderIds, "length")) && (_jsx(ActionsBar, { fileIds: selectedFileIds, folderIds: selectedFolderIds, onCloseSelection: () => setSelectedItems({ fileIds: [], folderIds: [] }) })), showPreviewModal && (_jsx(FileDetails, { open: showPreviewModal, handleClose: () => {
|
|
132
90
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { showPreviewModal: false, selectedFile: {} })));
|
|
@@ -48,7 +48,6 @@ 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);
|
|
52
51
|
const assetIds = Array.from(new Set(folders
|
|
53
52
|
.filter((f) => get(f, "type") === EntityType.FILE)
|
|
54
53
|
.map((f) => get(f, "assetId"))
|
|
@@ -61,42 +60,6 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
61
60
|
.flat();
|
|
62
61
|
return allFields;
|
|
63
62
|
}, [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
|
-
};
|
|
100
63
|
const handleClick = (folder) => {
|
|
101
64
|
const id = get(folder, "_id");
|
|
102
65
|
const fileType = get(folder, "type", EntityType.FOLDER);
|
|
@@ -126,11 +89,6 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
126
89
|
return;
|
|
127
90
|
}
|
|
128
91
|
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
|
-
}
|
|
134
92
|
if (fileType === EntityType.FILE) {
|
|
135
93
|
const alreadySelected = includes(selectedFileIds, id);
|
|
136
94
|
setSelectedItems({
|
|
@@ -203,7 +161,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
|
|
|
203
161
|
includes(selectedFolderIds, id)) ||
|
|
204
162
|
get(selectedPickerFile, "_id") === id;
|
|
205
163
|
const currentAsset = assets.find((asset) => asset._id === get(folder, "assetId"));
|
|
206
|
-
return (_jsxs("div", { onClick: () => handleClick(folder),
|
|
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
|
|
207
165
|
? "md-lib-bg-borderColor dark:md-lib-bg-darkSecondaryBg"
|
|
208
166
|
: ""}`, 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") ===
|
|
209
167
|
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") ===
|
package/build/MyDrive/index.js
CHANGED
|
@@ -35,7 +35,6 @@ function App(props) {
|
|
|
35
35
|
props === null || props === void 0 ? void 0 : props.id,
|
|
36
36
|
props === null || props === void 0 ? void 0 : props.parentId,
|
|
37
37
|
props === null || props === void 0 ? void 0 : props.showSubfolders,
|
|
38
|
-
props === null || props === void 0 ? void 0 : props.routerVersion,
|
|
39
38
|
]);
|
|
40
39
|
const [folders, setFolders] = useState([]);
|
|
41
40
|
if (typeof window !== "undefined" && !window.process) {
|