@bindu-dashing/dam-solution-v2 5.8.6

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 (259) hide show
  1. package/README.md +53 -0
  2. package/build/AssetType/AddFieldProperties.d.ts +9 -0
  3. package/build/AssetType/AddFieldProperties.js +197 -0
  4. package/build/AssetType/AssetTemplatesTable.d.ts +10 -0
  5. package/build/AssetType/AssetTemplatesTable.js +153 -0
  6. package/build/AssetType/CreateAssetTemplate.d.ts +3 -0
  7. package/build/AssetType/CreateAssetTemplate.js +68 -0
  8. package/build/AssetType/CreateOrEditAssetTemplate.d.ts +1 -0
  9. package/build/AssetType/CreateOrEditAssetTemplate.js +77 -0
  10. package/build/AssetType/DraggedField.d.ts +14 -0
  11. package/build/AssetType/DraggedField.js +40 -0
  12. package/build/AssetType/EditAssetTemplate.d.ts +5 -0
  13. package/build/AssetType/EditAssetTemplate.js +179 -0
  14. package/build/AssetType/FieldsSection.d.ts +14 -0
  15. package/build/AssetType/FieldsSection.js +239 -0
  16. package/build/AssetType/assetTemplatesContainer.d.ts +2 -0
  17. package/build/AssetType/assetTemplatesContainer.js +71 -0
  18. package/build/AssetType/fieldProperties/DateField.d.ts +5 -0
  19. package/build/AssetType/fieldProperties/DateField.js +23 -0
  20. package/build/AssetType/fieldProperties/NumberField.d.ts +5 -0
  21. package/build/AssetType/fieldProperties/NumberField.js +91 -0
  22. package/build/AssetType/fieldProperties/OptionsField.d.ts +6 -0
  23. package/build/AssetType/fieldProperties/OptionsField.js +55 -0
  24. package/build/AssetType/fieldProperties/TextField.d.ts +5 -0
  25. package/build/AssetType/fieldProperties/TextField.js +92 -0
  26. package/build/AssetType/index.d.ts +11 -0
  27. package/build/AssetType/index.js +24 -0
  28. package/build/AssetType/routes.d.ts +3 -0
  29. package/build/AssetType/routes.js +17 -0
  30. package/build/BookView/ProductDescription.d.ts +4 -0
  31. package/build/BookView/ProductDescription.js +20 -0
  32. package/build/BookView/bookDetail.d.ts +4 -0
  33. package/build/BookView/bookDetail.js +106 -0
  34. package/build/BookView/bookInfo.d.ts +4 -0
  35. package/build/BookView/bookInfo.js +17 -0
  36. package/build/BookView/description.d.ts +4 -0
  37. package/build/BookView/description.js +5 -0
  38. package/build/BookView/index.d.ts +10 -0
  39. package/build/BookView/index.js +23 -0
  40. package/build/CreateClient/CreateClientBtn.d.ts +8 -0
  41. package/build/CreateClient/CreateClientBtn.js +12 -0
  42. package/build/CreateClient/CreateClientForm.d.ts +9 -0
  43. package/build/CreateClient/CreateClientForm.js +165 -0
  44. package/build/CreateClient/index.d.ts +14 -0
  45. package/build/CreateClient/index.js +18 -0
  46. package/build/ImagePicker/MetaFieldOptions.d.ts +14 -0
  47. package/build/ImagePicker/MetaFieldOptions.js +75 -0
  48. package/build/ImagePicker/TestImagePickerModal.d.ts +8 -0
  49. package/build/ImagePicker/TestImagePickerModal.js +61 -0
  50. package/build/ImagePicker/TestImgFromMetaData.d.ts +7 -0
  51. package/build/ImagePicker/TestImgFromMetaData.js +82 -0
  52. package/build/ImagePicker/imagePickerComponent.d.ts +6 -0
  53. package/build/ImagePicker/imagePickerComponent.js +63 -0
  54. package/build/ImagePicker/index.d.ts +13 -0
  55. package/build/ImagePicker/index.js +24 -0
  56. package/build/ImagePicker/routes.d.ts +6 -0
  57. package/build/ImagePicker/routes.js +17 -0
  58. package/build/ImagePickerFilters/ImagePickerFiltersComponent.d.ts +8 -0
  59. package/build/ImagePickerFilters/ImagePickerFiltersComponent.js +223 -0
  60. package/build/ImagePickerFilters/index.d.ts +12 -0
  61. package/build/ImagePickerFilters/index.js +19 -0
  62. package/build/MyDrive/ActionBar.d.ts +6 -0
  63. package/build/MyDrive/ActionBar.js +165 -0
  64. package/build/MyDrive/AddDrive.d.ts +3 -0
  65. package/build/MyDrive/AddDrive.js +169 -0
  66. package/build/MyDrive/AddFolder.d.ts +10 -0
  67. package/build/MyDrive/AddFolder.js +150 -0
  68. package/build/MyDrive/BreadCrumbList.d.ts +9 -0
  69. package/build/MyDrive/BreadCrumbList.js +86 -0
  70. package/build/MyDrive/BulkUploadModal.d.ts +2 -0
  71. package/build/MyDrive/BulkUploadModal.js +279 -0
  72. package/build/MyDrive/DriveContainer.d.ts +13 -0
  73. package/build/MyDrive/DriveContainer.js +276 -0
  74. package/build/MyDrive/FileDownloadHistory.d.ts +7 -0
  75. package/build/MyDrive/FileDownloadHistory.js +94 -0
  76. package/build/MyDrive/FileMenuOptions.d.ts +11 -0
  77. package/build/MyDrive/FileMenuOptions.js +397 -0
  78. package/build/MyDrive/FilesGridView.d.ts +9 -0
  79. package/build/MyDrive/FilesGridView.js +25 -0
  80. package/build/MyDrive/FolderGridView.d.ts +19 -0
  81. package/build/MyDrive/FolderGridView.js +91 -0
  82. package/build/MyDrive/FolderListView.d.ts +25 -0
  83. package/build/MyDrive/FolderListView.js +188 -0
  84. package/build/MyDrive/FolderMenuOptions.d.ts +5 -0
  85. package/build/MyDrive/FolderMenuOptions.js +350 -0
  86. package/build/MyDrive/FolderTree.d.ts +8 -0
  87. package/build/MyDrive/FolderTree.js +342 -0
  88. package/build/MyDrive/ImageEditor/EditImage.d.ts +6 -0
  89. package/build/MyDrive/ImageEditor/EditImage.js +97 -0
  90. package/build/MyDrive/ImageEditor/EditImageModal.d.ts +8 -0
  91. package/build/MyDrive/ImageEditor/EditImageModal.js +30 -0
  92. package/build/MyDrive/ImageEditor/TuiImageEditor.d.ts +10 -0
  93. package/build/MyDrive/ImageEditor/TuiImageEditor.js +99 -0
  94. package/build/MyDrive/ImagePickerBreadCrumbList.d.ts +8 -0
  95. package/build/MyDrive/ImagePickerBreadCrumbList.js +35 -0
  96. package/build/MyDrive/ImagePickerDrive.d.ts +1 -0
  97. package/build/MyDrive/ImagePickerDrive.js +41 -0
  98. package/build/MyDrive/MyDriveMainContainer.d.ts +1 -0
  99. package/build/MyDrive/MyDriveMainContainer.js +32 -0
  100. package/build/MyDrive/SearchFilter.d.ts +8 -0
  101. package/build/MyDrive/SearchFilter.js +73 -0
  102. package/build/MyDrive/ShareBtn.d.ts +5 -0
  103. package/build/MyDrive/ShareBtn.js +19 -0
  104. package/build/MyDrive/ToggleView.d.ts +4 -0
  105. package/build/MyDrive/ToggleView.js +12 -0
  106. package/build/MyDrive/UploadStatusModal.d.ts +12 -0
  107. package/build/MyDrive/UploadStatusModal.js +40 -0
  108. package/build/MyDrive/fileDetails/CommentEntity.d.ts +8 -0
  109. package/build/MyDrive/fileDetails/CommentEntity.js +102 -0
  110. package/build/MyDrive/fileDetails/Comments.d.ts +6 -0
  111. package/build/MyDrive/fileDetails/Comments.js +65 -0
  112. package/build/MyDrive/fileDetails/Compliance.d.ts +2 -0
  113. package/build/MyDrive/fileDetails/Compliance.js +18 -0
  114. package/build/MyDrive/fileDetails/CreateComment.d.ts +7 -0
  115. package/build/MyDrive/fileDetails/CreateComment.js +48 -0
  116. package/build/MyDrive/fileDetails/Editor.d.ts +6 -0
  117. package/build/MyDrive/fileDetails/Editor.js +55 -0
  118. package/build/MyDrive/fileDetails/EmojiPicker.d.ts +5 -0
  119. package/build/MyDrive/fileDetails/EmojiPicker.js +6 -0
  120. package/build/MyDrive/fileDetails/FileDetails.d.ts +10 -0
  121. package/build/MyDrive/fileDetails/FileDetails.js +78 -0
  122. package/build/MyDrive/fileDetails/FileHeader.d.ts +7 -0
  123. package/build/MyDrive/fileDetails/FileHeader.js +25 -0
  124. package/build/MyDrive/fileDetails/FileViewer.d.ts +10 -0
  125. package/build/MyDrive/fileDetails/FileViewer.js +31 -0
  126. package/build/MyDrive/fileDetails/ImageOptions.d.ts +2 -0
  127. package/build/MyDrive/fileDetails/ImageOptions.js +44 -0
  128. package/build/MyDrive/fileDetails/ImageViewer.d.ts +5 -0
  129. package/build/MyDrive/fileDetails/ImageViewer.js +16 -0
  130. package/build/MyDrive/fileDetails/ManageFile.d.ts +7 -0
  131. package/build/MyDrive/fileDetails/ManageFile.js +34 -0
  132. package/build/MyDrive/fileDetails/MetaForm.d.ts +15 -0
  133. package/build/MyDrive/fileDetails/MetaForm.js +195 -0
  134. package/build/MyDrive/fileDetails/Metadata.d.ts +8 -0
  135. package/build/MyDrive/fileDetails/Metadata.js +52 -0
  136. package/build/MyDrive/fileDetails/PdfOptions.d.ts +9 -0
  137. package/build/MyDrive/fileDetails/PdfOptions.js +35 -0
  138. package/build/MyDrive/fileDetails/PdfViewer.d.ts +8 -0
  139. package/build/MyDrive/fileDetails/PdfViewer.js +18 -0
  140. package/build/MyDrive/fileDetails/Previewdetails.d.ts +9 -0
  141. package/build/MyDrive/fileDetails/Previewdetails.js +53 -0
  142. package/build/MyDrive/fileDetails/VideoPlayer.d.ts +4 -0
  143. package/build/MyDrive/fileDetails/VideoPlayer.js +21 -0
  144. package/build/MyDrive/files/AssetSelectionFormItem.d.ts +7 -0
  145. package/build/MyDrive/files/AssetSelectionFormItem.js +14 -0
  146. package/build/MyDrive/files/FolderTabs.d.ts +6 -0
  147. package/build/MyDrive/files/FolderTabs.js +83 -0
  148. package/build/MyDrive/files/MapFile.d.ts +8 -0
  149. package/build/MyDrive/files/MapFile.js +217 -0
  150. package/build/MyDrive/files/MoveToAnotherFolder.d.ts +9 -0
  151. package/build/MyDrive/files/MoveToAnotherFolder.js +53 -0
  152. package/build/MyDrive/filesListView.d.ts +2 -0
  153. package/build/MyDrive/filesListView.js +57 -0
  154. package/build/MyDrive/index.d.ts +10 -0
  155. package/build/MyDrive/index.js +35 -0
  156. package/build/MyDrive/routes.d.ts +7 -0
  157. package/build/MyDrive/routes.js +17 -0
  158. package/build/PenView/PenDetails.d.ts +4 -0
  159. package/build/PenView/PenDetails.js +114 -0
  160. package/build/PenView/ProductDescription.d.ts +5 -0
  161. package/build/PenView/ProductDescription.js +51 -0
  162. package/build/PenView/index.d.ts +10 -0
  163. package/build/PenView/index.js +23 -0
  164. package/build/RefreshKey/RefreshKeyBtn.d.ts +1 -0
  165. package/build/RefreshKey/RefreshKeyBtn.js +42 -0
  166. package/build/RefreshKey/index.d.ts +9 -0
  167. package/build/RefreshKey/index.js +23 -0
  168. package/build/ShoesView/ProductDescription.d.ts +4 -0
  169. package/build/ShoesView/ProductDescription.js +25 -0
  170. package/build/ShoesView/ShoeDetails.d.ts +4 -0
  171. package/build/ShoesView/ShoeDetails.js +96 -0
  172. package/build/ShoesView/index.d.ts +10 -0
  173. package/build/ShoesView/index.js +23 -0
  174. package/build/common/Button.d.ts +2 -0
  175. package/build/common/Button.js +18 -0
  176. package/build/common/CustomElements.d.ts +98 -0
  177. package/build/common/CustomElements.js +77 -0
  178. package/build/common/LoadMoreItems.d.ts +7 -0
  179. package/build/common/LoadMoreItems.js +33 -0
  180. package/build/common/RenderFormItem.d.ts +42 -0
  181. package/build/common/RenderFormItem.js +98 -0
  182. package/build/common/RenderThumnail.d.ts +7 -0
  183. package/build/common/RenderThumnail.js +6 -0
  184. package/build/common/deleteModal.d.ts +1 -0
  185. package/build/common/deleteModal.js +12 -0
  186. package/build/common/folders/TypeAndDateFilters.d.ts +10 -0
  187. package/build/common/folders/TypeAndDateFilters.js +59 -0
  188. package/build/common/folders/getFolderOrFileIcon.d.ts +2 -0
  189. package/build/common/folders/getFolderOrFileIcon.js +41 -0
  190. package/build/common/loader/CustomLoader.d.ts +7 -0
  191. package/build/common/loader/CustomLoader.js +8 -0
  192. package/build/common/loader/loader.d.ts +1 -0
  193. package/build/common/loader/loader.js +6 -0
  194. package/build/common/notifications.d.ts +2 -0
  195. package/build/common/notifications.js +30 -0
  196. package/build/common/steps.d.ts +4 -0
  197. package/build/common/steps.js +7 -0
  198. package/build/hocs/AppProvider.d.ts +3 -0
  199. package/build/hocs/AppProvider.js +11 -0
  200. package/build/hocs/DamConfigContext.d.ts +2 -0
  201. package/build/hocs/DamConfigContext.js +108 -0
  202. package/build/hocs/ThemeContext.d.ts +15 -0
  203. package/build/hocs/ThemeContext.js +131 -0
  204. package/build/hocs/ToastProvider.d.ts +2 -0
  205. package/build/hocs/ToastProvider.js +6 -0
  206. package/build/hocs/appConstants.d.ts +124 -0
  207. package/build/hocs/appConstants.js +211 -0
  208. package/build/hocs/configureAxios.d.ts +2 -0
  209. package/build/hocs/configureAxios.js +65 -0
  210. package/build/hocs/helpers.d.ts +15 -0
  211. package/build/hocs/helpers.js +177 -0
  212. package/build/index.d.ts +11 -0
  213. package/build/index.js +11 -0
  214. package/build/react-query/hooks/brand-hooks.d.ts +3 -0
  215. package/build/react-query/hooks/brand-hooks.js +10 -0
  216. package/build/react-query/hooks/folder-hooks.d.ts +7 -0
  217. package/build/react-query/hooks/folder-hooks.js +119 -0
  218. package/build/react-query/services/brand-services.d.ts +3 -0
  219. package/build/react-query/services/brand-services.js +30 -0
  220. package/build/react-query/services/file-services.d.ts +43 -0
  221. package/build/react-query/services/file-services.js +69 -0
  222. package/build/react-query/services/folder-services.d.ts +44 -0
  223. package/build/react-query/services/folder-services.js +87 -0
  224. package/build/react-query/services/image-picker-services.d.ts +5 -0
  225. package/build/react-query/services/image-picker-services.js +48 -0
  226. package/build/settings/InviteTeamModal.d.ts +12 -0
  227. package/build/settings/InviteTeamModal.js +174 -0
  228. package/build/settings/UpdateInvitationAccessType.d.ts +9 -0
  229. package/build/settings/UpdateInvitationAccessType.js +96 -0
  230. package/build/settings/getUserAvatar.d.ts +7 -0
  231. package/build/settings/getUserAvatar.js +11 -0
  232. package/build/style.css +1 -0
  233. package/build/types/assetType.d.ts +8 -0
  234. package/build/types/assetType.js +1 -0
  235. package/build/ui/pageTitle.d.ts +3 -0
  236. package/build/ui/pageTitle.js +4 -0
  237. package/build/utilities/FoldersContext.d.ts +14 -0
  238. package/build/utilities/FoldersContext.js +10 -0
  239. package/build/utilities/NavigatorProvider.d.ts +2 -0
  240. package/build/utilities/NavigatorProvider.js +10 -0
  241. package/build/utilities/constants/apiUrls.d.ts +95 -0
  242. package/build/utilities/constants/apiUrls.js +115 -0
  243. package/build/utilities/constants/imageUrls.d.ts +6 -0
  244. package/build/utilities/constants/imageUrls.js +6 -0
  245. package/build/utilities/constants/interface.d.ts +371 -0
  246. package/build/utilities/constants/interface.js +142 -0
  247. package/build/utilities/constants/messages.d.ts +54 -0
  248. package/build/utilities/constants/messages.js +54 -0
  249. package/build/utilities/constants/queryKeys.d.ts +16 -0
  250. package/build/utilities/constants/queryKeys.js +33 -0
  251. package/build/utilities/constants/routes.d.ts +22 -0
  252. package/build/utilities/constants/routes.js +22 -0
  253. package/build/utilities/helpers/validators.d.ts +12 -0
  254. package/build/utilities/helpers/validators.js +89 -0
  255. package/build/utilities/useAppNavigate.d.ts +2 -0
  256. package/build/utilities/useAppNavigate.js +19 -0
  257. package/build/utilities/useAppParams.d.ts +6 -0
  258. package/build/utilities/useAppParams.js +27 -0
  259. package/package.json +93 -0
@@ -0,0 +1,77 @@
1
+ "use client";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { Avatar, Input, Modal, Popover, Select, Tooltip } from "antd";
13
+ import CustomButton from "./Button";
14
+ import { DeleteOutlined, RedoOutlined } from "@ant-design/icons";
15
+ import { NotificationStatus, } from "../utilities/constants/interface";
16
+ import { ACTIVE_INACTIVE_OPTIONS } from "../hocs/appConstants";
17
+ import Result from "antd/es/result";
18
+ import { showNotification } from "./notifications";
19
+ import { capitalize, find, get, map, toUpper } from "lodash";
20
+ import { formatBytes, getReadableFileType } from "../hocs/helpers";
21
+ import { NOT_FOUND_IMAGE_URL } from "../utilities/constants/imageUrls";
22
+ export function CustomFormFooter({ onCancel, onSave = () => { }, loading, okButtonLabel = "Save", icon, deleteAction, }) {
23
+ return (_jsxs("div", { className: "md-lib-flex md-lib-gap-2 md-lib-justify-end", children: [_jsx(CustomButton, { type: "default", onClick: onCancel, label: "Cancel" }), _jsx(CustomButton, { type: "primary", onClick: onSave, label: okButtonLabel, loading: loading, htmlType: "submit", icon: icon ? icon : _jsx(_Fragment, {}), danger: !!deleteAction })] }));
24
+ }
25
+ export const DeleteConfirmationModal = ({ showDeleteModal, toggleDeleteModal, onOk, description, okText, loading, subHeading, restore, icon, }) => {
26
+ return (_jsx(Modal, { maskClosable: false, centered: true, open: showDeleteModal, onCancel: toggleDeleteModal, footer: _jsx(CustomFormFooter, { onCancel: toggleDeleteModal, onSave: onOk, okButtonLabel: okText, loading: loading, icon: icon ? icon : restore ? _jsx(RedoOutlined, {}) : _jsx(DeleteOutlined, {}), deleteAction: !restore }), className: "setting-modal-style remove-modal", children: _jsx("div", { className: "body-content", children: _jsxs("div", { children: [_jsx("h4", { className: "md-lib-text-lg md-lib-truncate md-lib-font-semibold md-lib-mb-2 md-lib-text-textColor md-lib-dark:text-darkTextColor md-lib-capitalize", children: description }), subHeading && (_jsx("p", { className: "md-lib-text-sm md-lib-text-textColor md-lib-dark:text-darkTextColor md-lib-mb-4", children: subHeading }))] }) }) }));
27
+ };
28
+ export const RenderTableSearchFilters = ({ value, placeholder, onChange, onPressEnter, onClick, onClear, }) => {
29
+ return (_jsxs("div", { className: "md-lib-bg-white dark:md-lib-bg-darkPrimary md-lib-border md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-rounded-md md-lib-shadow-lg md-lib-min-w-[200px]", style: { padding: "5px" }, children: [_jsx("div", { className: "md-lib-mb-4", children: _jsx(Input, { placeholder: placeholder, value: value, onChange: onChange, onPressEnter: onPressEnter, className: "md-lib-w-full md-lib-h-10 md-lib-px-3 md-lib-border md-lib-border-borderColor dark:md-lib-border-darkBorderColor md-lib-rounded-md focus:md-lib-outline-none focus:md-lib-ring-2 focus:md-lib-ring-blue-500" }) }), _jsx(RenderTableFilterFooter, { onClear: onClear, onClick: onClick })] }));
30
+ };
31
+ export const RenderTableFilterFooter = ({ onClick, onClear, }) => {
32
+ return (_jsxs("div", { className: "flex justify-between gap-2", children: [_jsx(CustomButton, { type: "primary", onClick: onClick, label: "Search" }), _jsx(CustomButton, { onClick: onClear, label: "Reset" })] }));
33
+ };
34
+ export const RenderTableSelectFilters = ({ selectedKeys, placeholder, onChange, onClick, onClear, options, }) => {
35
+ return (_jsxs("div", { className: "p-2 flex flex-col bg-white dark:bg-darkPrimary", children: [_jsxs("div", { children: [" ", _jsx(RenderCustomSelect, { placeholder: placeholder, value: selectedKeys, onChange: onChange, className: "mb-2 w-full mr-2", options: options || ACTIVE_INACTIVE_OPTIONS, allowClear: true })] }), _jsx(RenderTableFilterFooter, { onClear: onClear, onClick: onClick })] }));
36
+ };
37
+ export function RenderCustomSelect({ onChange, value, mode, options, showSearch, allowClear, style, placeholder, className, placement, showArrow, bordered, loading, disabled, }) {
38
+ return (_jsx(Select, { mode: mode || undefined, placeholder: placeholder, onChange: onChange, value: value, style: style, options: options, disabled: disabled, filterOption: (input, option) => { var _a; return ((_a = option === null || option === void 0 ? void 0 : option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().indexOf(input.toLowerCase())) >= 0; }, showSearch: showSearch, allowClear: allowClear, className: className, placement: placement, loading: loading, showArrow: showArrow, bordered: bordered }));
39
+ }
40
+ export function CustomResult({ status, title, subTitle, result, }) {
41
+ return (_jsx(Result, { status: status, title: title, subTitle: _jsx("div", { className: "description" }), extra: _jsx(_Fragment, { children: result }) }));
42
+ }
43
+ export const handleCopy = (link) => __awaiter(void 0, void 0, void 0, function* () {
44
+ try {
45
+ yield navigator.clipboard.writeText(link);
46
+ showNotification("Link copied to clipboard!", NotificationStatus.SUCCESS);
47
+ }
48
+ catch (_a) {
49
+ showNotification("Failed to copy link.", NotificationStatus.ERROR);
50
+ }
51
+ });
52
+ export const RenderEmptyContent = ({ className, label, }) => {
53
+ return (_jsxs("div", { className: className ||
54
+ `flex flex-col items-center justify-center"
55
+ } `, children: [_jsx("img", { src: NOT_FOUND_IMAGE_URL, alt: label, width: 300, height: 200, className: "mt-28" }), _jsx("p", { className: "pt-3 font-semibold text-textColor dark:text-darkTextColor", children: label })] }));
56
+ };
57
+ export const RenderAvatar = ({ name, profilePicture, size, }) => {
58
+ return (_jsx(Tooltip, { title: name, children: profilePicture ? (_jsx(Avatar, { size: size, src: profilePicture })) : (_jsx(Avatar, { className: "bg-borderColor dark:bg-darkBorderColor", children: toUpper(name === null || name === void 0 ? void 0 : name.charAt(0)) })) }));
59
+ };
60
+ export const ManageUsers = ({ displayedUsers, extraUsers, }) => {
61
+ return (_jsx("div", { children: _jsxs("div", { className: "flex items-center space-x-[-10px]", children: [map(displayedUsers, (user) => {
62
+ const name = get(user, "name", get(user, "email", "Unknown"));
63
+ return (_jsx(RenderAvatar, { name: name, profilePicture: get(user, "profilePicture"), size: 40 }));
64
+ }), !!get(extraUsers, "length") && (_jsx(Popover, { content: _jsx("div", { className: "max-h-[200px] overflow-y-auto p-2", children: map(extraUsers, (user) => {
65
+ const name = get(user, "name", get(user, "email", "Unknown"));
66
+ return (_jsxs("div", { className: "flex items-center gap-3 p-2", children: [_jsx(RenderAvatar, { name: name, profilePicture: get(user, "profilePicture"), size: 40 }), _jsxs("div", { children: [_jsx("p", { className: "font-medium mb-0", children: get(user, "email") }), _jsx("p", { className: "text-secondaryTextColor dark:bg-darkSecondaryTextColor text-sm mb-0", children: capitalize(get(user, "role", "")).replace("_", " ") })] })] }, get(user, "_id")));
67
+ }) }), placement: "rightTop", children: _jsxs("div", { className: "w-10 h-10 flex items-center justify-center bg-primaryColor text-white text-sm font-bold rounded-full cursor-pointer space-x-[-10px] z-0 border-2 border-transparent avthar-box-shadow", children: ["+", get(extraUsers, "length")] }) }))] }) }));
68
+ };
69
+ export const FileInfoContent = ({ file }) => {
70
+ return (_jsxs("div", { className: "font-medium text-textColor dark:text-darkTextColor leading-relaxed", children: [_jsxs("div", { className: "text-xs", children: ["Type: ", getReadableFileType(file)] }), _jsxs("div", { className: "text-xs", children: ["Size: ", formatBytes(get(file, "size"))] }), _jsxs("div", { className: "text-xs truncate w-40", title: get(file, "createdBy.name", "Unknown"), children: ["Owner: ", get(file, "createdBy.name", "Unknown")] })] }));
71
+ };
72
+ export const RenderModalTitle = ({ title }) => {
73
+ return (_jsx("div", { className: "max-w-[400px] truncate", title: title, children: title }));
74
+ };
75
+ export const RenderBrandUserAvatar = ({ userId, brandId, userName, size = 30, brandUsers, }) => {
76
+ return (_jsx(RenderAvatar, { name: get(find(brandUsers, (user) => get(user, "_id") === userId), "name", get(find(brandUsers, (user) => get(user, "_id") === userId), "email")) || userName, profilePicture: get(find(brandUsers, (user) => get(user, "_id") === userId), "profilePicture", ""), size: size }));
77
+ };
@@ -0,0 +1,7 @@
1
+ interface LoadMoreItemsProps {
2
+ hasNextPage: boolean;
3
+ fetchNextPage: () => void;
4
+ isItemsFetching?: boolean;
5
+ }
6
+ declare const LoadMoreItems: ({ hasNextPage, fetchNextPage, isItemsFetching, }: LoadMoreItemsProps) => JSX.Element;
7
+ export default LoadMoreItems;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState, useCallback } from "react";
3
+ import CustomLoader from "./loader/CustomLoader";
4
+ const LoadMoreItems = ({ hasNextPage, fetchNextPage, isItemsFetching, }) => {
5
+ const sentinelRef = useRef(null);
6
+ const [isVisible, setIsVisible] = useState(false);
7
+ const handleObserver = useCallback((entries) => {
8
+ const [entry] = entries;
9
+ setIsVisible(entry.isIntersecting);
10
+ if (entry.isIntersecting && hasNextPage && !isItemsFetching) {
11
+ fetchNextPage();
12
+ }
13
+ }, [hasNextPage, fetchNextPage, isItemsFetching]);
14
+ useEffect(() => {
15
+ if (typeof window === "undefined" || !window.IntersectionObserver)
16
+ return;
17
+ const element = sentinelRef.current;
18
+ if (!element)
19
+ return;
20
+ const observer = new IntersectionObserver(handleObserver, {
21
+ root: null,
22
+ rootMargin: "150px 0px",
23
+ threshold: 0,
24
+ });
25
+ observer.observe(element);
26
+ return () => {
27
+ observer.unobserve(element);
28
+ observer.disconnect();
29
+ };
30
+ }, [handleObserver]);
31
+ return (_jsxs(_Fragment, { children: [_jsx("div", { ref: sentinelRef, style: { height: "1px" } }), hasNextPage && _jsx(CustomLoader, {})] }));
32
+ };
33
+ export default LoadMoreItems;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ interface CustomFormItemProps {
3
+ name: any;
4
+ label: string;
5
+ rules?: any[];
6
+ placeholder?: string;
7
+ inputClassName?: string;
8
+ [key: string]: any;
9
+ }
10
+ interface CustomCheckboxProps extends CustomFormItemProps {
11
+ showLabel?: boolean;
12
+ }
13
+ interface CustomRadioGroupProps extends CustomFormItemProps {
14
+ options: {
15
+ label: string;
16
+ value: string | number;
17
+ }[];
18
+ }
19
+ interface CustomCheckboxGroupProps extends CustomFormItemProps {
20
+ options: {
21
+ label: string;
22
+ value: string | number;
23
+ }[];
24
+ }
25
+ interface CustomSelectProps extends CustomFormItemProps {
26
+ options: {
27
+ label: any;
28
+ value: string | number;
29
+ }[];
30
+ }
31
+ export declare const CustomInputFormItem: React.FC<CustomFormItemProps>;
32
+ export declare const CustomTextAreaFormItem: React.FC<CustomFormItemProps>;
33
+ export declare const CustomSwitchFormItem: React.FC<CustomFormItemProps>;
34
+ export declare const CustomPasswordFormItem: React.FC<CustomFormItemProps>;
35
+ export declare const CustomNumberFormItem: React.FC<CustomFormItemProps>;
36
+ export declare const CustomRadioGroupFormItem: React.FC<CustomRadioGroupProps>;
37
+ export declare const CustomCheckBoxGroupFormItem: React.FC<CustomCheckboxGroupProps>;
38
+ export declare const CustomCheckboxFormItem: React.FC<CustomCheckboxProps>;
39
+ export declare const CustomDatePickerFormItem: React.FC<CustomFormItemProps>;
40
+ export declare const CustomSelectFormItem: React.FC<CustomSelectProps>;
41
+ export declare const CustomColorPickerFormItem: React.FC<CustomFormItemProps>;
42
+ export {};
@@ -0,0 +1,98 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { useState } from "react";
14
+ import { Input, Radio, DatePicker, Form, Select, InputNumber, Checkbox, ColorPicker, Switch, } from "antd";
15
+ import { map } from "lodash";
16
+ import dayjs from "dayjs";
17
+ const { TextArea } = Input;
18
+ // Custom Input Form Item
19
+ export const CustomInputFormItem = (_a) => {
20
+ var { name, label, rules, placeholder, inputClassName, disabled, onChange, size, showCount = false, hasLimit } = _a, rest = __rest(_a, ["name", "label", "rules", "placeholder", "inputClassName", "disabled", "onChange", "size", "showCount", "hasLimit"]);
21
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(Input, { placeholder: placeholder, className: `${inputClassName} md-lib-h-12`, disabled: disabled, onChange: onChange, size: "large", maxLength: hasLimit ? undefined : 255, showCount: showCount }) }), `field-${name}`));
22
+ };
23
+ // Custom TextArea Item
24
+ export const CustomTextAreaFormItem = (_a) => {
25
+ var { name, label, rules, placeholder, inputClassName, disabled, rows = 4 } = _a, rest = __rest(_a, ["name", "label", "rules", "placeholder", "inputClassName", "disabled", "rows"]);
26
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(TextArea, { placeholder: placeholder, className: inputClassName, disabled: disabled, rows: 3 }) }), `field-${name}`));
27
+ };
28
+ // Custom Toggle Item
29
+ export const CustomSwitchFormItem = (_a) => {
30
+ var { name, label, rules, placeholder, inputClassName, disabled, onChange } = _a, rest = __rest(_a, ["name", "label", "rules", "placeholder", "inputClassName", "disabled", "onChange"]);
31
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(Switch, { disabled: disabled, onChange: onChange }) }), `field-${name}`));
32
+ };
33
+ // Custom Password Input Form Item
34
+ export const CustomPasswordFormItem = (_a) => {
35
+ var { name, label, rules, placeholder, disabled } = _a, rest = __rest(_a, ["name", "label", "rules", "placeholder", "disabled"]);
36
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(Input.Password, { placeholder: placeholder, disabled: disabled, size: "large" }) }), `field-${name}`));
37
+ };
38
+ // Custom Number Input Form Item
39
+ export const CustomNumberFormItem = (_a) => {
40
+ var { name, label, rules, disabled, placeholder, min } = _a, rest = __rest(_a, ["name", "label", "rules", "disabled", "placeholder", "min"]);
41
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(InputNumber, { placeholder: placeholder, disabled: disabled, style: { width: "100%" }, min: min, size: "large" }) }), `field-${name}`));
42
+ };
43
+ // Custom Radio Group Form Item
44
+ export const CustomRadioGroupFormItem = (_a) => {
45
+ var { name, label, rules, options, disabled } = _a, rest = __rest(_a, ["name", "label", "rules", "options", "disabled"]);
46
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(Radio.Group, { disabled: disabled, children: options.map((option) => (_jsx(Radio, { value: option.value, children: option.label }, option.value))) }) }), `field-${name}`));
47
+ };
48
+ // Custom Checkbox group Form Item
49
+ export const CustomCheckBoxGroupFormItem = (_a) => {
50
+ var { name, label, rules, options, disabled } = _a, rest = __rest(_a, ["name", "label", "rules", "options", "disabled"]);
51
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(Checkbox.Group, { disabled: disabled, children: options.map((option) => (_jsx(Checkbox, { value: option.value, children: option.label }, option.value))) }) }), `field-${name}`));
52
+ };
53
+ // Custom Checkbox Form Item
54
+ export const CustomCheckboxFormItem = (_a) => {
55
+ var { name, label, rules, showLabel = false, disabled, options } = _a, rest = __rest(_a, ["name", "label", "rules", "showLabel", "disabled", "options"]);
56
+ return (_jsx(Form.Item, Object.assign({ name: name, label: showLabel ? label : "", rules: rules }, rest, { children: (options === null || options === void 0 ? void 0 : options.length) > 0 ? (_jsx(Checkbox.Group, { disabled: disabled, children: options.map((option, index) => {
57
+ return (_jsx(Checkbox, { value: option.value, children: option.label }, index));
58
+ }) })) : (_jsx(Checkbox, { children: label })) }), `field-${name}`));
59
+ };
60
+ // Custom Date Picker Form Item
61
+ export const CustomDatePickerFormItem = (_a) => {
62
+ var { name, label, rules, placeholder, disabled, showTime = false } = _a, rest = __rest(_a, ["name", "label", "rules", "placeholder", "disabled", "showTime"]);
63
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { getValueFromEvent: (val) => {
64
+ // Ensure dayjs object is correctly formatted and returned
65
+ return val ? dayjs(val).format("YYYY-MM-DD") : undefined;
66
+ }, getValueProps: (val) => {
67
+ return {
68
+ value: dayjs(val),
69
+ };
70
+ }, children: _jsx(DatePicker, { disabled: disabled, placeholder: placeholder, showTime: showTime, size: "large" }) }), `field-${name}`));
71
+ };
72
+ // Custom Select Form Item
73
+ export const CustomSelectFormItem = (_a) => {
74
+ var { name, label, rules, options, placeholder, showSearch, filterOption, onChange, disabled, size, loading } = _a, rest = __rest(_a, ["name", "label", "rules", "options", "placeholder", "showSearch", "filterOption", "onChange", "disabled", "size", "loading"]);
75
+ const [open, setOpen] = useState(false);
76
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx(Select, { placeholder: placeholder, showSearch: showSearch, filterOption: filterOption, open: open, size: size, onChange: (val) => {
77
+ setOpen(false);
78
+ onChange && onChange(val);
79
+ }, disabled: disabled, onBlur: () => {
80
+ setOpen(false);
81
+ }, onClick: () => setOpen(!open), loading: loading, children: map(options, (option) => (_jsx(Select.Option, { value: option.value, children: option.label }, option.value))) }) }), `field-${name}`));
82
+ };
83
+ // Custom Color Picker Form Item
84
+ export const CustomColorPickerFormItem = (_a) => {
85
+ var { name, label, rules, inputClassName, valuePropName = "value", disabled, form } = _a, rest = __rest(_a, ["name", "label", "rules", "inputClassName", "valuePropName", "disabled", "form"]);
86
+ const handleColorChange = (color, hex) => {
87
+ if (Array.isArray(name)) {
88
+ const [parent, child] = name;
89
+ form.setFieldsValue({ [parent]: { [child]: hex } });
90
+ form.validateFields([[parent, child]]);
91
+ }
92
+ else {
93
+ form.setFieldsValue({ [name]: hex });
94
+ form.validateFields([name]);
95
+ }
96
+ };
97
+ return (_jsx(Form.Item, Object.assign({ name: name, label: label, rules: rules }, rest, { children: _jsx("div", { className: inputClassName, children: _jsx(ColorPicker, { onChange: handleColorChange, disabled: disabled, value: rest === null || rest === void 0 ? void 0 : rest.value }) }) }), `field-${name}`));
98
+ };
@@ -0,0 +1,7 @@
1
+ declare function RenderThumbnail({ url, alt, width, height, }: {
2
+ url: string;
3
+ alt: string;
4
+ width?: number;
5
+ height?: number;
6
+ }): JSX.Element;
7
+ export default RenderThumbnail;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { FileImageOutlined } from "@ant-design/icons";
3
+ function RenderThumbnail({ url, alt, width = 20, height = 20, }) {
4
+ return (_jsx(_Fragment, { children: url ? (_jsx("img", { src: url, alt: alt, width: width, height: height, className: "md-lib-rounded md-lib-object-cover" })) : (_jsx(FileImageOutlined, { className: "md-lib-text-primaryColor md-lib-text-lg" })) }));
5
+ }
6
+ export default RenderThumbnail;
@@ -0,0 +1 @@
1
+ export default function DeleteModal({ title, open, setOpen, massage }: any): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button, Modal } from "antd";
3
+ export default function DeleteModal({ title, open, setOpen, massage }) {
4
+ const handleOk = (values) => {
5
+ // console.log(values);
6
+ setOpen(false);
7
+ };
8
+ const handleCancel = () => {
9
+ setOpen(false);
10
+ };
11
+ return (_jsx(_Fragment, { children: _jsxs(Modal, { title: title, open: open, onCancel: handleCancel, footer: null, width: 400, children: [_jsx("p", { className: "md-lib-text-sm md-lib-text-textColor md-lib-pb-7 md-lib-pt-4", children: massage }), _jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-justify-end md-lib-gap-2", children: [_jsx(Button, { size: "large", onClick: handleCancel, className: "md-lib-border-none md-lib-shadow-none", children: "Cancel" }), _jsx(Button, { size: "large", type: "primary", danger: true, onClick: handleOk, children: "Yes, Delete" })] })] }) }));
12
+ }
@@ -0,0 +1,10 @@
1
+ declare function TypeAndDateFilters({ selectedType, onDateMenuClick, onTypeMenuClick, onChangeDates, loading, loadingType, selectedDateKey, }: {
2
+ selectedType: string;
3
+ onDateMenuClick: (params: any) => void;
4
+ onTypeMenuClick: (params: any) => void;
5
+ onChangeDates: (params: any) => void;
6
+ loading?: boolean;
7
+ loadingType?: string;
8
+ selectedDateKey: string;
9
+ }): JSX.Element;
10
+ export default TypeAndDateFilters;
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DatePicker, Dropdown } from "antd";
3
+ import CustomButton from "../Button";
4
+ import { capitalize } from "lodash";
5
+ import { MdClearAll, MdMoreHoriz } from "react-icons/md";
6
+ import { FileTypes } from "../../utilities/constants/interface";
7
+ import { DownOutlined, FileImageOutlined, FileTextOutlined, CustomerServiceOutlined, VideoCameraOutlined, } from "@ant-design/icons";
8
+ import { IoFilter } from "react-icons/io5";
9
+ const { RangePicker } = DatePicker;
10
+ const MdClearAllIcon = MdClearAll;
11
+ const MdMoreHorizIcon = MdMoreHoriz;
12
+ const IoFilterIcon = IoFilter;
13
+ const typeOptions = [
14
+ { key: "", label: "All", icon: _jsx(MdClearAllIcon, {}) },
15
+ { key: FileTypes.IMAGES, label: "Images", icon: _jsx(FileImageOutlined, {}) },
16
+ { key: FileTypes.VIDEOS, label: "Videos", icon: _jsx(VideoCameraOutlined, {}) },
17
+ { key: FileTypes.DOCUMENTS, label: "Documents", icon: _jsx(FileTextOutlined, {}) },
18
+ { key: FileTypes.MUSIC, label: "Music", icon: _jsx(CustomerServiceOutlined, {}) },
19
+ { key: FileTypes.OTHER, label: "Other", icon: _jsx(MdMoreHorizIcon, {}) },
20
+ ];
21
+ function TypeAndDateFilters({ selectedType, onDateMenuClick, onTypeMenuClick, onChangeDates, loading, loadingType, selectedDateKey, }) {
22
+ const dateOptions = [
23
+ { key: "", label: "All" },
24
+ { key: "today", label: "Today" },
25
+ { key: "last7", label: "Last 7 days" },
26
+ { key: "last30", label: "Last 30 days" },
27
+ { key: "thisYear", label: `This year (${new Date().getFullYear()})` },
28
+ { key: "lastYear", label: `Last year (${new Date().getFullYear() - 1})` },
29
+ // {
30
+ // key: "custom",
31
+ // label: "Custom date range",
32
+ // children: [
33
+ // {
34
+ // key: "range",
35
+ // label: (
36
+ // <div
37
+ // onClick={(e) => e.stopPropagation()}
38
+ // onMouseDown={(e) => e.stopPropagation()}
39
+ // onFocus={(e) => e.stopPropagation()}
40
+ // >
41
+ // <RangePicker
42
+ // format={FILTER_DATE_FORMAT}
43
+ // allowClear={false}
44
+ // className="w-full"
45
+ // onChange={onChangeDates}
46
+ // onClick={(e) => e.stopPropagation()}
47
+ // onMouseDown={(e) => e.stopPropagation()}
48
+ // onFocus={(e) => e.stopPropagation()}
49
+ // />
50
+ // </div>
51
+ // ),
52
+ // onClick: (e) => e.domEvent.stopPropagation(),
53
+ // },
54
+ // ],
55
+ // },
56
+ ];
57
+ return (_jsxs("div", { className: "md-lib-flex md-lib-items-center md-lib-gap-4", children: [_jsx(Dropdown, { menu: { items: typeOptions, onClick: onTypeMenuClick }, trigger: ["click"], children: _jsx(CustomButton, { label: _jsxs(_Fragment, { children: [selectedType ? capitalize(selectedType) : "Type", " ", _jsx(DownOutlined, {})] }), loading: loading && loadingType === "type", type: !!selectedType ? "primary" : "default", icon: _jsx(IoFilterIcon, {}) }) }), _jsx(Dropdown, { menu: { items: dateOptions, onClick: onDateMenuClick }, trigger: ["click"], children: _jsx(CustomButton, { type: !!selectedDateKey ? "primary" : "default", label: _jsxs(_Fragment, { children: ["Modified ", _jsx(DownOutlined, {})] }), loading: loading && loadingType === "date", icon: _jsx(IoFilterIcon, {}) }) })] }));
58
+ }
59
+ export default TypeAndDateFilters;
@@ -0,0 +1,2 @@
1
+ import { EntityType } from "../../utilities/constants/interface";
2
+ export declare function getFileOrFolderIcon(type: EntityType, mimeType?: string, size?: number): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FaFolder, FaFileAlt, FaFilePdf, FaFileExcel, FaFileArchive, } from "react-icons/fa";
3
+ import { FileImageOutlined, VideoCameraOutlined, CustomerServiceOutlined, } from "@ant-design/icons";
4
+ import { EntityType } from "../../utilities/constants/interface";
5
+ const FaFolderIcon = FaFolder;
6
+ const FaFileAltIcon = FaFileAlt;
7
+ const FaFilePdfIcon = FaFilePdf;
8
+ const FaFileExcelIcon = FaFileExcel;
9
+ const FaFileArchiveIcon = FaFileArchive;
10
+ export function getFileOrFolderIcon(type, mimeType, size) {
11
+ const textSize = size || 15;
12
+ if (type === EntityType.FOLDER) {
13
+ return _jsx(FaFolderIcon, { className: "md-lib-text-primaryColor md-lib-text-[16px]" });
14
+ }
15
+ let icon = (_jsx(FaFileAltIcon, { className: "md-lib-text-[15px] md-lib-text-primaryColor" }));
16
+ if (!mimeType)
17
+ return icon;
18
+ if (mimeType.startsWith("image/")) {
19
+ icon = (_jsx(FileImageOutlined, { className: textSize ? "md-lib-text-[20px]" : "md-lib-text-imagesColor md-lib-text-[15px]" }));
20
+ }
21
+ else if (mimeType.startsWith("video/")) {
22
+ icon = (_jsx(VideoCameraOutlined, { className: textSize ? "md-lib-text-[20px]" : "md-lib-text-videosColor md-lib-text-[15px]" }));
23
+ }
24
+ else if (mimeType.startsWith("audio/")) {
25
+ icon = (_jsx(CustomerServiceOutlined, { className: textSize ? "md-lib-text-[20px]" : "md-lib-text-musicColor md-lib-text-[15px]" }));
26
+ }
27
+ else if (mimeType === "application/pdf") {
28
+ icon = (_jsx(FaFilePdfIcon, { className: textSize ? "md-lib-text-[20px]" : "md-lib-text-dangerColor md-lib-text-[15px]" }));
29
+ }
30
+ else if (mimeType === "application/vnd.ms-excel" ||
31
+ mimeType ===
32
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
33
+ icon = (_jsx(FaFileExcelIcon, { className: textSize ? "md-lib-text-[20px]" : "md-lib-text-videosColor md-lib-text-[15px]" }));
34
+ }
35
+ else if (mimeType === "application/zip" ||
36
+ mimeType === "application/x-7z-compressed" ||
37
+ mimeType === "application/x-rar-compressed") {
38
+ icon = (_jsx(FaFileArchiveIcon, { className: textSize ? "md-lib-text-[20px]" : "md-lib-text-otherColor md-lib-text-[15px]" }));
39
+ }
40
+ return icon;
41
+ }
@@ -0,0 +1,7 @@
1
+ type SpinSize = "default" | "small" | "large" | undefined;
2
+ interface CustomLoaderProps {
3
+ size?: SpinSize;
4
+ fontSize?: number;
5
+ }
6
+ declare function CustomLoader({ size, fontSize }: CustomLoaderProps): JSX.Element;
7
+ export default CustomLoader;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Spin } from "antd";
3
+ import { LoadingOutlined } from "@ant-design/icons";
4
+ import { SpinSizes } from "../../utilities/constants/interface";
5
+ function CustomLoader({ size, fontSize }) {
6
+ return (_jsx(Spin, { indicator: _jsx(LoadingOutlined, { spin: true, style: { fontSize: fontSize }, className: "color:primaryColor" }), size: size ? size : SpinSizes.LARGE }));
7
+ }
8
+ export default CustomLoader;
@@ -0,0 +1 @@
1
+ export default function Loader(): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import CustomLoader from "./CustomLoader";
3
+ import { SpinSizes } from "../../utilities/constants/interface";
4
+ export default function Loader() {
5
+ return (_jsx("div", { className: "md-lib-flex md-lib-justify-center md-lib-items-center !md-lib-h-screen md-lib-bg-white dark:md-lib-bg-darkPrimary", children: _jsx(CustomLoader, { size: SpinSizes.LARGE }) }));
6
+ }
@@ -0,0 +1,2 @@
1
+ import { NotificationStatus } from "../utilities/constants/interface";
2
+ export declare const showNotification: (message: string, status?: NotificationStatus) => void;
@@ -0,0 +1,30 @@
1
+ import { NotificationStatus } from "../utilities/constants/interface";
2
+ import { toast, Slide } from "react-toastify";
3
+ export const showNotification = (message, status = NotificationStatus.INFO) => {
4
+ const baseOptions = {
5
+ position: "top-right",
6
+ autoClose: 3000,
7
+ hideProgressBar: false,
8
+ closeOnClick: false,
9
+ pauseOnHover: true,
10
+ draggable: true,
11
+ progress: undefined,
12
+ theme: "light",
13
+ transition: Slide,
14
+ };
15
+ switch (status) {
16
+ case NotificationStatus.SUCCESS:
17
+ toast.success(message, baseOptions);
18
+ break;
19
+ case NotificationStatus.ERROR:
20
+ toast.error(message, baseOptions);
21
+ break;
22
+ case NotificationStatus.WARN:
23
+ toast.warn(message, baseOptions);
24
+ break;
25
+ case NotificationStatus.INFO:
26
+ default:
27
+ toast.info(message, baseOptions);
28
+ break;
29
+ }
30
+ };
@@ -0,0 +1,4 @@
1
+ export default function Steps({ noOfSteps, activeStep, }: {
2
+ noOfSteps: number;
3
+ activeStep: number;
4
+ }): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Space } from "antd";
3
+ export default function Steps({ noOfSteps, activeStep, }) {
4
+ return (_jsx(Space, { className: "steps-container", size: 2, children: Array.from({ length: noOfSteps }, (_, step) => {
5
+ return (_jsx("div", { className: `step-item ${activeStep == step + 1 ? "active" : ""}` }, step));
6
+ }) }));
7
+ }
@@ -0,0 +1,3 @@
1
+ export default function AppProvider({ children, }: {
2
+ children: React.ReactNode;
3
+ }): JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { QueryClient, QueryClientProvider } from "react-query";
4
+ export default function AppProvider({ children, }) {
5
+ const [query] = useState(() => new QueryClient({
6
+ defaultOptions: {
7
+ queries: { retry: false },
8
+ },
9
+ }));
10
+ return _jsx(QueryClientProvider, { client: query, children: children });
11
+ }
@@ -0,0 +1,2 @@
1
+ export declare const DamConfigProvider: ({ children, config }: any) => JSX.Element;
2
+ export declare const useDamConfig: () => null;
@@ -0,0 +1,108 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
11
+ // contexts/DamAuthContext.js
12
+ import { createContext, useContext, useState, useEffect } from "react";
13
+ import { FETCH_BRAND_USING_SUBDOMAIN, USER_LOGIN, } from "../utilities/constants/apiUrls";
14
+ import axios from "axios";
15
+ import { getBaseUrl } from "./helpers";
16
+ import { get } from "lodash";
17
+ import Loader from "../common/loader/loader";
18
+ import { SUBSCRIPTION_EXPIRED_ERROR_MESSAGE } from "./appConstants";
19
+ const DamConfigContext = createContext(null);
20
+ export const DamConfigProvider = ({ children, config }) => {
21
+ // console.log(config);
22
+ const { damAccessKey, secretKey, subdomain, teamIds, appType } = config;
23
+ const [accessToken, setAccessToken] = useState(null);
24
+ const [user, setDamUser] = useState(null);
25
+ const [brand, setBrand] = useState(null);
26
+ const [loading, setLoading] = useState(false);
27
+ const [rootFolderId, setRootFolderId] = useState(null);
28
+ const [teams, setTeams] = useState([]);
29
+ const [isAdmin, setIsAdmin] = useState(false);
30
+ const [showPaymentErr, setShowPaymentErr] = useState(false);
31
+ const getToken = () => __awaiter(void 0, void 0, void 0, function* () {
32
+ var _a, _b, _c, _d, _e, _f, _g;
33
+ setLoading(true);
34
+ console.log("getToken", getBaseUrl(appType), appType);
35
+ try {
36
+ const response = yield axios.post(getBaseUrl(appType) + USER_LOGIN, {
37
+ accessKey: damAccessKey,
38
+ secretKey: secretKey,
39
+ subdomain,
40
+ teams: teamIds,
41
+ });
42
+ const token = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.access_token;
43
+ const userData = (_d = (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.user;
44
+ const brandData = (_f = (_e = response === null || response === void 0 ? void 0 : response.data) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.brand;
45
+ setAccessToken(token);
46
+ setDamUser(userData);
47
+ setLoading(false);
48
+ setBrand(brandData);
49
+ setRootFolderId(get(response, "data.data.rootFolderId"));
50
+ const adminTeamIds = get(response, "data.data.brand.adminTeams", []);
51
+ // console.log(adminTeamIds);
52
+ setIsAdmin(teamIds.reduce((acc, curr) => {
53
+ return acc || adminTeamIds.includes(curr.toString());
54
+ }, false));
55
+ }
56
+ catch (error) {
57
+ console.error("Error fetching token:", error);
58
+ if (((_g = error === null || error === void 0 ? void 0 : error.response) === null || _g === void 0 ? void 0 : _g.status) === 402) {
59
+ setShowPaymentErr(true);
60
+ }
61
+ setLoading(false);
62
+ }
63
+ });
64
+ const getTeams = (subdomain) => __awaiter(void 0, void 0, void 0, function* () {
65
+ var _a, _b, _c;
66
+ try {
67
+ const response = yield axios.get(getBaseUrl(appType) + FETCH_BRAND_USING_SUBDOMAIN, {
68
+ params: {
69
+ subdomain,
70
+ },
71
+ });
72
+ setTeams(((_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.teamsAuthResponse) === null || _c === void 0 ? void 0 : _c.data) || []);
73
+ }
74
+ catch (err) {
75
+ console.log("Error fetching teams:", err);
76
+ }
77
+ });
78
+ useEffect(() => {
79
+ if (damAccessKey && secretKey && subdomain) {
80
+ try {
81
+ getToken();
82
+ getTeams(subdomain);
83
+ }
84
+ catch (err) {
85
+ setLoading(false);
86
+ }
87
+ }
88
+ }, [damAccessKey, secretKey, subdomain]);
89
+ return (_jsx(DamConfigContext.Provider, { value: {
90
+ damAccessKey,
91
+ secretKey,
92
+ subdomain,
93
+ teamIds,
94
+ accessToken,
95
+ user,
96
+ brand,
97
+ refreshToken: getToken,
98
+ loading,
99
+ setAccessToken,
100
+ setDamUser,
101
+ appType,
102
+ setRootFolderId,
103
+ rootFolderId,
104
+ teams,
105
+ isAdmin,
106
+ }, children: loading ? (_jsx(Loader, {})) : (_jsx(_Fragment, { children: showPaymentErr ? (_jsx("div", { className: "flex items-center justify-center h-[calc(100vh-200px)]", children: _jsx("p", { className: "text-sm font-medium text-textColor dark:text-darkTextColor", children: SUBSCRIPTION_EXPIRED_ERROR_MESSAGE }) })) : (children) })) }));
107
+ };
108
+ export const useDamConfig = () => useContext(DamConfigContext);