@bindu-dashing/dam-solution-v2 5.8.53 → 5.8.54

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.
@@ -100,7 +100,6 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
100
100
  }
101
101
  }, []);
102
102
  const folders = useMemo(() => {
103
- console.log('## foldersPaginatedData', foldersPaginatedData);
104
103
  return !!foldersPaginatedData
105
104
  ? flatMap(get(foldersPaginatedData, "pages"), "folders")
106
105
  : [];
@@ -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 lastClickedId = useRef(null);
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"))
@@ -63,6 +64,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
63
64
  const handleClick = (folder) => {
64
65
  const id = get(folder, "_id");
65
66
  const fileType = get(folder, "type", EntityType.FOLDER);
67
+ console.log('## handleClick', folder, id, fileType);
66
68
  if (isImagePicker) {
67
69
  if (fileType === EntityType.FILE) {
68
70
  setSelectedFile === null || setSelectedFile === void 0 ? void 0 : setSelectedFile(folder);
@@ -77,18 +79,33 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
77
79
  }
78
80
  }
79
81
  else {
80
- if (clickTimer.current) {
81
- clearTimeout(clickTimer.current);
82
+ // Check if this is a double click (same item clicked within timer window)
83
+ const isDoubleClick = clickTimer.current !== null && lastClickedId.current === id;
84
+ if (isDoubleClick) {
85
+ // Double click detected - clear timer and handle double click action
86
+ if (clickTimer.current) {
87
+ clearTimeout(clickTimer.current);
88
+ }
82
89
  clickTimer.current = null;
90
+ lastClickedId.current = null;
83
91
  if (fileType === EntityType.FOLDER && navigate) {
92
+ // Double click on folder: navigate into folder
84
93
  navigate(SUBFOLDERS_SCREEN.replace(":folderId", id));
85
94
  }
86
- if (fileType === EntityType.FILE && type !== DriveModes.TRASH) {
95
+ else if (fileType === EntityType.FILE && type !== DriveModes.TRASH) {
96
+ // Double click on file: show preview
87
97
  setState((prevState) => (Object.assign(Object.assign({}, prevState), { selectedFile: folder, showPreviewModal: true })));
88
98
  }
89
99
  return;
90
100
  }
101
+ // Single click - set timer for selection
102
+ if (clickTimer.current) {
103
+ // Different item clicked, clear previous timer
104
+ clearTimeout(clickTimer.current);
105
+ }
106
+ lastClickedId.current = id;
91
107
  clickTimer.current = setTimeout(() => {
108
+ // Single click action: toggle selection
92
109
  if (fileType === EntityType.FILE) {
93
110
  const alreadySelected = includes(selectedFileIds, id);
94
111
  setSelectedItems({
@@ -106,6 +123,7 @@ const FolderListView = ({ folders, foldersFetching, hasNextPage, fetchNextPage,
106
123
  });
107
124
  }
108
125
  clickTimer.current = null;
126
+ lastClickedId.current = null;
109
127
  }, 250);
110
128
  }
111
129
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bindu-dashing/dam-solution-v2",
3
- "version": "5.8.53",
3
+ "version": "5.8.54",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.0.1",
6
6
  "@emoji-mart/data": "^1.2.1",