@bindu-dashing/dam-solution-v2 5.8.39 → 5.8.41

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.
@@ -18,11 +18,14 @@ import { getFormattedValue } from "../hocs/helpers";
18
18
  import { createApiClient } from "../hocs/configureAxios";
19
19
  import { useDamConfig } from "../hocs/DamConfigContext";
20
20
  import { FETCH_ASSET_URL, FETCH_SHARED_FILE_URL, } from "../utilities/constants/apiUrls";
21
+ import { FoldersProvider } from "../utilities/FoldersContext";
21
22
  function TestImagePickerModal({ imagePicker, open, toggleModal, setSelectedFile, }) {
22
23
  const [state, setState] = useState({
23
24
  parentFolderId: get(imagePicker, "folderId"),
24
25
  fileForConfirmation: {},
25
26
  });
27
+ const [folders, setFolders] = useState([]);
28
+ const [globalSearch, setGlobalSearch] = useState("");
26
29
  const damConfig = useDamConfig();
27
30
  const api = useMemo(() => createApiClient(damConfig), [damConfig]);
28
31
  const { parentFolderId, fileForConfirmation } = state;
@@ -50,12 +53,12 @@ function TestImagePickerModal({ imagePicker, open, toggleModal, setSelectedFile,
50
53
  onSelectFile();
51
54
  } }, "confirm")) : null, children: get(imagePicker, "assetId") ? (_jsx(TestImageFromMetalData, { imagePicker: imagePicker, selectedPickerFile: fileForConfirmation, setSelectedFile: (file) => {
52
55
  setState((prevState) => (Object.assign(Object.assign({}, prevState), { fileForConfirmation: file })));
53
- } })) : (_jsx(DriveContainer, { setSelectedFile: (file, localFile = false) => {
54
- console.log("local file", file);
55
- setState((prevState) => (Object.assign(Object.assign({}, prevState), { fileForConfirmation: file })));
56
- if (localFile) {
57
- setSelectedFile(get(file, "s3Url", ""), get(file, "thumbnailUrl", ""));
58
- }
59
- }, parentFolderId: parentFolderId, setParentFolderId: (id) => setState((prevState) => (Object.assign(Object.assign({}, prevState), { parentFolderId: id, fileForConfirmation: {} }))), pickerFolderId: get(imagePicker, "folderId"), selectedPickerFile: fileForConfirmation, imagePicker: imagePicker })) }));
56
+ } })) : (_jsx(FoldersProvider, { value: { folders, setFolders, globalSearch }, children: _jsx(DriveContainer, { setSelectedFile: (file, localFile = false) => {
57
+ console.log("local file", file);
58
+ setState((prevState) => (Object.assign(Object.assign({}, prevState), { fileForConfirmation: file })));
59
+ if (localFile) {
60
+ setSelectedFile(get(file, "s3Url", ""), get(file, "thumbnailUrl", ""));
61
+ }
62
+ }, parentFolderId: parentFolderId, setParentFolderId: (id) => setState((prevState) => (Object.assign(Object.assign({}, prevState), { parentFolderId: id, fileForConfirmation: {} }))), pickerFolderId: get(imagePicker, "folderId"), selectedPickerFile: fileForConfirmation, imagePicker: imagePicker, globalSearch: globalSearch, setGlobalSearch: setGlobalSearch }) })) }));
60
63
  }
61
64
  export default TestImagePickerModal;
@@ -62,8 +62,6 @@ function BreadCrumbList({ folder, parentFolderId, setParentFolderId, pickerFolde
62
62
  setParentFolderId(treeId);
63
63
  }
64
64
  if (!pickerFolderId && !isLast && setSelectedKeys) {
65
- // Use state-based navigation for all folders including root
66
- // This works regardless of whether Router context is available
67
65
  setSelectedKeys(treeId);
68
66
  }
69
67
  };
@@ -5,14 +5,8 @@ import useAppParams from "../utilities/useAppParams";
5
5
  export default function AppRoutes({ folders, setFolders, routerVersion, }) {
6
6
  const params = useAppParams();
7
7
  const { type, id } = params;
8
- // Determine which component to render based on params
9
- // If type and id are present, it's likely an image picker or entity view
10
8
  if (type && id) {
11
- // This matches FETCH_ENTITY_SCREEN pattern
12
9
  return _jsx(ImagePickerDrive, {});
13
10
  }
14
- // Otherwise, render the main drive container
15
- // This handles both MY_DRIVE_SCREEN and SUBFOLDERS_SCREEN
16
- // The folderId param will be handled by MyDriveMainContainer
17
11
  return (_jsx(MyDriveMainContainer, { folders: folders, setFolders: setFolders }));
18
12
  }
@@ -83,7 +83,7 @@ export declare const USER_LOGIN = "/users/login/keys";
83
83
  export declare const FETCH_BRAND_USING_SUBDOMAIN = "/brands/subdomain";
84
84
  export declare const CREATE_SUB_BRAND = "/brands/sub-brand";
85
85
  export declare const FETCH_IMAGEPICKERS_URL = "/image-picker";
86
- export declare const FETCH_IMAGEPICKER_URL = "/image-picker/:id";
86
+ export declare const FETCH_IMAGEPICKER_URL = "/image-picker/68b6c81d9a533b6d1207fe39";
87
87
  export declare const FETCH_META_FIELD_OPTIONS_URL = "/image-picker/file-filters/:id";
88
88
  export declare const FETCH_META_FIELD_FILES_URL = "/image-picker/files/:id";
89
89
  export declare const UPLOAD_IMAGE_PICKER_LOCAL_FILE_URL = "/image-picker/upload";
@@ -100,7 +100,7 @@ export const FETCH_BRAND_USING_SUBDOMAIN = "/brands/subdomain";
100
100
  export const CREATE_SUB_BRAND = "/brands/sub-brand";
101
101
  //image picker
102
102
  export const FETCH_IMAGEPICKERS_URL = "/image-picker";
103
- export const FETCH_IMAGEPICKER_URL = "/image-picker/:id";
103
+ export const FETCH_IMAGEPICKER_URL = "/image-picker/68b6c81d9a533b6d1207fe39";
104
104
  export const FETCH_META_FIELD_OPTIONS_URL = "/image-picker/file-filters/:id";
105
105
  export const FETCH_META_FIELD_FILES_URL = "/image-picker/files/:id";
106
106
  export const UPLOAD_IMAGE_PICKER_LOCAL_FILE_URL = "/image-picker/upload";
@@ -5,12 +5,7 @@ if (rrd.useNavigate) {
5
5
  // ✅ v6+
6
6
  const { useNavigate } = rrd;
7
7
  useAppNavigate = () => {
8
- // We need to call useNavigate unconditionally (hook rules)
9
- // But we'll wrap it in an error boundary pattern
10
- // If Router context is not available, this will throw
11
- // The component using this should handle the error gracefully
12
8
  let navigateFn = null;
13
- // Use a ref to track if we've successfully initialized
14
9
  const hasRouterContext = React.useRef(false);
15
10
  try {
16
11
  const navigate = useNavigate();
@@ -18,8 +13,6 @@ if (rrd.useNavigate) {
18
13
  navigateFn = (to) => navigate(to);
19
14
  }
20
15
  catch (e) {
21
- // Router context not available - this will throw synchronously
22
- // Return null so caller can use fallback
23
16
  hasRouterContext.current = false;
24
17
  navigateFn = null;
25
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bindu-dashing/dam-solution-v2",
3
- "version": "5.8.39",
3
+ "version": "5.8.41",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.0.1",
6
6
  "@emoji-mart/data": "^1.2.1",