@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,91 @@
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, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { InputSupportedTypes, } from "../../utilities/constants/interface";
12
+ import { Col, Form, InputNumber, Row, Switch } from "antd";
13
+ import useFormInstance from "antd/es/form/hooks/useFormInstance";
14
+ import { get, isEqual, map } from "lodash";
15
+ import { useEffect, useState } from "react";
16
+ export default function NumberField({ field, supportedTypes, }) {
17
+ const form = useFormInstance();
18
+ const initialRangeEnabled = !!get(field, [
19
+ "inputTypeSettings",
20
+ InputSupportedTypes.VALUE_RANGE,
21
+ "allow",
22
+ ]);
23
+ const [rangeEnabled, setRangeEnabled] = useState(initialRangeEnabled);
24
+ useEffect(() => {
25
+ form.setFieldValue(["inputTypeSettings", InputSupportedTypes.VALUE_RANGE, "allow"], initialRangeEnabled);
26
+ }, [initialRangeEnabled, form]);
27
+ return (_jsx(_Fragment, { children: map(supportedTypes, (type) => {
28
+ const defaultName = get(type, "defaultName");
29
+ const name = get(type, "name");
30
+ const valueType = get(type, "valueType");
31
+ const id = get(type, "_id");
32
+ if (isEqual(defaultName, InputSupportedTypes.VALUE_RANGE)) {
33
+ return (_jsxs("div", { children: [_jsxs(Row, { className: "md-lib-flex md-lib-items-center", children: [_jsx(Col, { span: 12, children: name }), _jsx(Col, { span: 12, push: 8, children: _jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "allow"], className: "md-lib-mb-0", valuePropName: "checked", children: _jsx(Switch, { checked: rangeEnabled, onChange: (val) => setRangeEnabled(val) }) }) })] }), rangeEnabled && (_jsxs(_Fragment, { children: [_jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "minValue"], label: "Minimum Value", rules: [
34
+ {
35
+ validator: (_, value) => __awaiter(this, void 0, void 0, function* () {
36
+ if (!rangeEnabled)
37
+ return Promise.resolve(); // skip validation if toggle is off
38
+ const max = form.getFieldValue([
39
+ "inputTypeSettings",
40
+ defaultName,
41
+ "maxValue",
42
+ ]);
43
+ // Require at least one
44
+ if ((value === undefined || value === null) &&
45
+ (max === undefined || max === null)) {
46
+ return Promise.reject(new Error("Please enter either Minimum or Maximum value"));
47
+ }
48
+ // If both provided → min <= max
49
+ if (value !== undefined &&
50
+ value !== null &&
51
+ max !== undefined &&
52
+ max !== null) {
53
+ if (value > max) {
54
+ return Promise.reject(new Error("Minimum must be less than or equal to Maximum"));
55
+ }
56
+ }
57
+ return Promise.resolve();
58
+ }),
59
+ },
60
+ ], children: _jsx(InputNumber, { placeholder: "Min", style: { width: "100%" } }) }), _jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "maxValue"], label: "Maximum Value", rules: [
61
+ {
62
+ validator: (_, value) => __awaiter(this, void 0, void 0, function* () {
63
+ if (!rangeEnabled)
64
+ return Promise.resolve(); // skip validation if toggle is off
65
+ const min = form.getFieldValue([
66
+ "inputTypeSettings",
67
+ defaultName,
68
+ "minValue",
69
+ ]);
70
+ // Require at least one
71
+ if ((value === undefined || value === null) &&
72
+ (min === undefined || min === null)) {
73
+ return Promise.reject(new Error("Please enter either Minimum or Maximum value"));
74
+ }
75
+ // If both provided → max >= min
76
+ if (value !== undefined &&
77
+ value !== null &&
78
+ min !== undefined &&
79
+ min !== null) {
80
+ if (value < min) {
81
+ return Promise.reject(new Error("Maximum must be greater than or equal to Minimum"));
82
+ }
83
+ }
84
+ return Promise.resolve();
85
+ }),
86
+ },
87
+ ], children: _jsx(InputNumber, { placeholder: "Max", style: { width: "100%" } }) })] }))] }, id));
88
+ }
89
+ return null;
90
+ }) }));
91
+ }
@@ -0,0 +1,6 @@
1
+ import { InputTypeEntity, InputTypeSupportedTypeEntity } from "../../utilities/constants/interface";
2
+ export default function OptionsField({ field, supportedTypes, currentInputType, }: {
3
+ field: InputTypeEntity;
4
+ supportedTypes: InputTypeSupportedTypeEntity[];
5
+ currentInputType: InputTypeEntity;
6
+ }): JSX.Element;
@@ -0,0 +1,55 @@
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, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import { InputTypes, } from "../../utilities/constants/interface";
14
+ import { Button, Col, Form, Input, Row, Switch } from "antd";
15
+ import { useEffect, useState } from "react";
16
+ import { TiDeleteOutline } from "react-icons/ti";
17
+ import { FaPlus } from "react-icons/fa6";
18
+ // import variables from "../../../styles/variables.module.scss";
19
+ import { get, isEqual, map, find, includes } from "lodash";
20
+ import { ICON_SIZE } from "../../hocs/appConstants";
21
+ import { useTheme } from "../../hocs/ThemeContext";
22
+ const TiDeleteOutlineIcon = TiDeleteOutline;
23
+ const FaPlusIcon = FaPlus;
24
+ export default function OptionsField({ field, supportedTypes, currentInputType, }) {
25
+ const [allowMultiSelect, setAllowMultiSelect] = useState(false);
26
+ const theme = useTheme();
27
+ useEffect(() => {
28
+ const multi = find(supportedTypes, (s) => isEqual(get(s, "defaultName"), "ALLOW_MULTIPLE"));
29
+ setAllowMultiSelect(!!multi);
30
+ }, [supportedTypes]);
31
+ return (_jsxs(_Fragment, { children: [map(supportedTypes, (type) => {
32
+ const defaultName = get(type, "defaultName");
33
+ const name = get(type, "name");
34
+ const valueType = get(type, "valueType");
35
+ const id = get(type, "_id");
36
+ if (isEqual(valueType, "boolean")) {
37
+ return (_jsxs(Row, { className: "md-lib-flex md-lib-items-center", children: [_jsx(Col, { span: 16, children: name }), _jsx(Col, { span: 8, push: 4, children: _jsx(Form.Item, { name: ["inputTypeSettings", defaultName], className: "md-lib-mb-0", valuePropName: "checked", children: _jsx(Switch, {}) }) })] }, id));
38
+ }
39
+ return null;
40
+ }), includes([InputTypes.SELECT, InputTypes.CHECKBOX, InputTypes.RADIO], get(currentInputType, "defaultName")) && (_jsxs(_Fragment, { children: [_jsx("h3", { className: "md-lib-text-md md-lib-font-semibold md-lib-mt-4 md-lib-mb-2", children: "List of Options" }), _jsx(Form.Item, { label: "", name: "options", rules: [
41
+ {
42
+ required: true,
43
+ type: "array",
44
+ min: 1,
45
+ message: "At least one option is required",
46
+ },
47
+ ], children: _jsx(Form.List, { name: "options", children: (fields, { add, remove }) => (_jsxs(_Fragment, { children: [fields.map((_a) => {
48
+ var { key, name } = _a, restField = __rest(_a, ["key", "name"]);
49
+ return (_jsxs(Row, { gutter: 8, className: "md-lib-items-center", children: [_jsx(Col, { span: 10, children: _jsx(Form.Item, Object.assign({}, restField, { name: [name, "label"], label: "Label", rules: [
50
+ { required: true, message: "Label is required" },
51
+ ], children: _jsx(Input, { placeholder: "Enter Label", className: "md-lib-h-12" }) })) }), _jsx(Col, { span: 10, children: _jsx(Form.Item, Object.assign({}, restField, { name: [name, "value"], label: "Value", rules: [
52
+ { required: true, message: "Value is required" },
53
+ ], children: _jsx(Input, { placeholder: "Enter Value", className: "md-lib-h-12" }) })) }), _jsx(Col, { span: 4, className: "md-lib-flex md-lib-items-end", children: _jsx(TiDeleteOutlineIcon, { size: ICON_SIZE, className: "md-lib-cursor-pointer", color: theme === null || theme === void 0 ? void 0 : theme.primaryColor, onClick: () => remove(name) }) })] }, key));
54
+ }), _jsx(Form.Item, { children: _jsx(Button, { icon: _jsx(FaPlusIcon, {}), onClick: () => add(), children: "Add Option" }) })] })) }) })] }))] }));
55
+ }
@@ -0,0 +1,5 @@
1
+ import { InputTypeEntity, InputTypeSupportedTypeEntity } from "../../utilities/constants/interface";
2
+ export default function TextField({ field, supportedTypes, }: {
3
+ field: InputTypeEntity;
4
+ supportedTypes: InputTypeSupportedTypeEntity[];
5
+ }): JSX.Element;
@@ -0,0 +1,92 @@
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, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { InputSupportedTypes, } from "../../utilities/constants/interface";
12
+ import { Col, Form, Input, InputNumber, Row, Switch } from "antd";
13
+ import useFormInstance from "antd/es/form/hooks/useFormInstance";
14
+ import { get, map, isEqual } from "lodash";
15
+ import { useState } from "react";
16
+ export default function TextField({ field, supportedTypes, }) {
17
+ const form = useFormInstance();
18
+ const initialSettings = get(field, "inputTypeSettings", {});
19
+ const [charLimitEnabled, setCharLimitEnabled] = useState(!!get(initialSettings, [InputSupportedTypes.CHARACTER_LIMIT, "allow"]));
20
+ const [regexEnabled, setRegexEnabled] = useState(!!get(initialSettings, [InputSupportedTypes.REGEX, "allow"]));
21
+ return (_jsx(_Fragment, { children: map(supportedTypes, (type) => {
22
+ const defaultName = get(type, "defaultName");
23
+ const name = get(type, "name");
24
+ const valueType = get(type, "valueType");
25
+ const id = get(type, "_id");
26
+ // CHARACTER_LIMIT handling
27
+ if (isEqual(defaultName, InputSupportedTypes.CHARACTER_LIMIT)) {
28
+ return (_jsxs("div", { children: [_jsxs(Row, { className: "md-lib-flex md-lib-items-center", children: [_jsx(Col, { span: 12, children: name }), _jsx(Col, { span: 12, push: 8, children: _jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "allow"], className: "md-lib-mb-0", valuePropName: "checked", children: _jsx(Switch, { onChange: (val) => setCharLimitEnabled(val) }) }) })] }), charLimitEnabled && (_jsx(_Fragment, { children: charLimitEnabled && (_jsxs(_Fragment, { children: [_jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "minValue"], label: "Minimum Characters", rules: [
29
+ {
30
+ validator: (_, value) => __awaiter(this, void 0, void 0, function* () {
31
+ if (!charLimitEnabled)
32
+ return Promise.resolve();
33
+ const max = form.getFieldValue([
34
+ "inputTypeSettings",
35
+ defaultName,
36
+ "maxValue",
37
+ ]);
38
+ // ✅ Both empty → error
39
+ if ((value === undefined || value === null) &&
40
+ (max === undefined || max === null)) {
41
+ return Promise.reject(new Error("Either Minimum or Maximum is required"));
42
+ }
43
+ // ✅ If both are filled, enforce min ≤ max
44
+ if (value !== undefined &&
45
+ value !== null &&
46
+ max !== undefined &&
47
+ max !== null &&
48
+ value > max) {
49
+ return Promise.reject(new Error("Minimum should be less than or equal to Maximum"));
50
+ }
51
+ return Promise.resolve();
52
+ }),
53
+ },
54
+ ], children: _jsx(InputNumber, { placeholder: "Min", style: { width: "100%" }, min: 1 }) }), _jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "maxValue"], label: "Maximum Characters", rules: [
55
+ {
56
+ validator: (_, value) => __awaiter(this, void 0, void 0, function* () {
57
+ if (!charLimitEnabled)
58
+ return Promise.resolve();
59
+ const min = form.getFieldValue([
60
+ "inputTypeSettings",
61
+ defaultName,
62
+ "minValue",
63
+ ]);
64
+ // ✅ Both empty → error
65
+ if ((value === undefined || value === null) &&
66
+ (min === undefined || min === null)) {
67
+ return Promise.reject(new Error("Either Minimum or Maximum is required"));
68
+ }
69
+ // ✅ If both are filled, enforce max ≥ min
70
+ if (value !== undefined &&
71
+ value !== null &&
72
+ min !== undefined &&
73
+ min !== null &&
74
+ value < min) {
75
+ return Promise.reject(new Error("Maximum should be greater than or equal to Minimum"));
76
+ }
77
+ return Promise.resolve();
78
+ }),
79
+ },
80
+ ], children: _jsx(InputNumber, { placeholder: "Max", style: { width: "100%" }, min: 1 }) })] })) }))] }, id));
81
+ }
82
+ // REGEX handling
83
+ if (isEqual(defaultName, InputSupportedTypes.REGEX)) {
84
+ return (_jsxs("div", { children: [_jsxs(Row, { className: "md-lib-flex md-lib-items-center", children: [_jsx(Col, { span: 12, children: name }), _jsx(Col, { span: 12, push: 8, children: _jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "allow"], className: "md-lib-mb-0", valuePropName: "checked", children: _jsx(Switch, { onChange: (val) => setRegexEnabled(val) }) }) })] }), regexEnabled && (_jsx(Form.Item, { name: ["inputTypeSettings", defaultName, "value"], label: "Regular Expression", rules: [{ required: true, message: "Regex is required" }], children: _jsx(Input, { placeholder: "Enter Regex" }) }))] }, id));
85
+ }
86
+ // Boolean switches (e.g., SPECIAL_CHARACTERS)
87
+ if (isEqual(valueType, "boolean")) {
88
+ return (_jsxs(Row, { className: "md-lib-flex md-lib-items-center", children: [_jsx(Col, { span: 12, children: name }), _jsx(Col, { span: 12, push: 8, children: _jsx(Form.Item, { name: ["inputTypeSettings", defaultName], className: "md-lib-mb-0", valuePropName: "checked", children: _jsx(Switch, {}) }) })] }, id));
89
+ }
90
+ return null;
91
+ }) }));
92
+ }
@@ -0,0 +1,11 @@
1
+ import "../style.css";
2
+ declare function App(props: {
3
+ accessKey?: string;
4
+ secretKey?: string;
5
+ subdomain?: string;
6
+ teamIds?: string[];
7
+ styles?: Record<string, string>;
8
+ appType?: string;
9
+ routerVersion: 4 | 5 | 6;
10
+ }): JSX.Element;
11
+ export default App;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "../style.css";
3
+ import { DamConfigProvider } from "../hocs/DamConfigContext";
4
+ import { MemoryRouter } from "react-router-dom";
5
+ import { ThemeProvider } from "../hocs/ThemeContext";
6
+ import { ThemeModes } from "../utilities/constants/interface";
7
+ import AppRoutes from "./routes";
8
+ import ToastProvider from "../hocs/ToastProvider";
9
+ import process from "process";
10
+ function App(props) {
11
+ const config = {
12
+ damAccessKey: props === null || props === void 0 ? void 0 : props.accessKey,
13
+ secretKey: props === null || props === void 0 ? void 0 : props.secretKey,
14
+ subdomain: props === null || props === void 0 ? void 0 : props.subdomain,
15
+ teamIds: props === null || props === void 0 ? void 0 : props.teamIds,
16
+ styles: props === null || props === void 0 ? void 0 : props.styles,
17
+ appType: props === null || props === void 0 ? void 0 : props.appType,
18
+ };
19
+ if (typeof window !== "undefined" && !window.process) {
20
+ window.process = process;
21
+ }
22
+ return (_jsx(DamConfigProvider, { config: config, children: _jsxs(ThemeProvider, { styles: props === null || props === void 0 ? void 0 : props.styles, sessionTheme: ThemeModes.LIGHT, children: [_jsx(MemoryRouter, { initialEntries: ["/"], children: _jsx(AppRoutes, { routerVersion: (props === null || props === void 0 ? void 0 : props.routerVersion) || 6 }) }), _jsx(ToastProvider, {})] }) }));
23
+ }
24
+ export default App;
@@ -0,0 +1,3 @@
1
+ export default function AppRoutes({ routerVersion, }: {
2
+ routerVersion: 4 | 5 | 6;
3
+ }): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import AssetTemplatesContainer from "./assetTemplatesContainer";
3
+ import { ASSET_TEMPLATE_SCREEN, ASSETS_SCREEN, } from "../utilities/constants/routes";
4
+ import CreateOrEditAssetTemplate from "./CreateOrEditAssetTemplate";
5
+ import { NavigatorProvider } from "../utilities/NavigatorProvider";
6
+ export default function AppRoutes({ routerVersion, }) {
7
+ if (routerVersion === 6) {
8
+ // ✅ React Router v6
9
+ const { Routes, Route } = require("react-router-dom");
10
+ return (_jsxs(Routes, { children: [_jsx(Route, { path: ASSETS_SCREEN, element: _jsx(AssetTemplatesContainer, {}) }, ASSETS_SCREEN), _jsx(Route, { path: ASSET_TEMPLATE_SCREEN, element: _jsx(CreateOrEditAssetTemplate, {}) }, ASSET_TEMPLATE_SCREEN)] }));
11
+ }
12
+ // ✅ React Router v4/v5
13
+ const { Switch, Route, withRouter } = require("react-router-dom");
14
+ const Wrapper = ({ history }) => (_jsx(NavigatorProvider, { history: history, children: _jsxs(Switch, { children: [_jsx(Route, { path: ASSETS_SCREEN, render: (props) => _jsx(AssetTemplatesContainer, Object.assign({}, props)) }, ASSETS_SCREEN), _jsx(Route, { path: ASSET_TEMPLATE_SCREEN, render: (props) => _jsx(CreateOrEditAssetTemplate, Object.assign({}, props)) }, ASSET_TEMPLATE_SCREEN)] }) }));
15
+ const WithRouterWrapper = withRouter(Wrapper);
16
+ return _jsx(WithRouterWrapper, {});
17
+ }
@@ -0,0 +1,4 @@
1
+ declare const ProductDescription: ({ getValue, }: {
2
+ getValue: (field: string) => any;
3
+ }) => JSX.Element;
4
+ export default ProductDescription;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Tabs } from "antd";
3
+ import Description from "./description";
4
+ import BookInfo from "./bookInfo";
5
+ const ProductDescription = ({ getValue, }) => {
6
+ const items = [
7
+ {
8
+ key: "1",
9
+ label: "Description",
10
+ children: _jsx(Description, { getValue: getValue }),
11
+ },
12
+ {
13
+ key: "2",
14
+ label: "Product Details",
15
+ children: _jsx(BookInfo, { getValue: getValue }),
16
+ },
17
+ ];
18
+ return _jsx(Tabs, { defaultActiveKey: "1", items: items });
19
+ };
20
+ export default ProductDescription;
@@ -0,0 +1,4 @@
1
+ declare const BookDetails: ({ id }: {
2
+ id: string;
3
+ }) => JSX.Element;
4
+ export default BookDetails;
@@ -0,0 +1,106 @@
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, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { Image } from "antd";
12
+ import { FaStar } from "react-icons/fa";
13
+ import { LuBookOpenText } from "react-icons/lu";
14
+ import { TbRulerMeasure } from "react-icons/tb";
15
+ import { IoIosInformationCircleOutline } from "react-icons/io";
16
+ import { CiDeliveryTruck } from "react-icons/ci";
17
+ import { LuPackage } from "react-icons/lu";
18
+ import ProductDescription from "./ProductDescription";
19
+ import { useDamConfig } from "../hocs/DamConfigContext";
20
+ import { createApiClient } from "../hocs/configureAxios";
21
+ import { useEffect, useMemo, useState } from "react";
22
+ import { FETCH_ASSET_URL, FETCH_FILE_URL, } from "../utilities/constants/apiUrls";
23
+ import { get } from "lodash";
24
+ import Loader from "../common/loader/loader";
25
+ import dayjs from "dayjs";
26
+ const Star = FaStar;
27
+ const BookOpen = LuBookOpenText;
28
+ const Ruler = TbRulerMeasure;
29
+ const Info = IoIosInformationCircleOutline;
30
+ const Truck = CiDeliveryTruck;
31
+ const Package = LuPackage;
32
+ const BookDetails = ({ id }) => {
33
+ var _a;
34
+ const damConfig = useDamConfig();
35
+ const api = useMemo(() => createApiClient(damConfig), [damConfig]);
36
+ const [state, setState] = useState({
37
+ file: {},
38
+ loading: false,
39
+ assetTemplate: {},
40
+ isAssetLoading: false,
41
+ });
42
+ useEffect(() => {
43
+ if (id) {
44
+ getFile();
45
+ }
46
+ }, [id]);
47
+ const getAsset = (assetId) => __awaiter(void 0, void 0, void 0, function* () {
48
+ setState((prevState) => {
49
+ return Object.assign(Object.assign({}, prevState), { isAssetLoading: true });
50
+ });
51
+ try {
52
+ const response = yield api.get(FETCH_ASSET_URL.replace(":assetId", assetId));
53
+ // console.log(response);
54
+ setState((prevState) => {
55
+ return Object.assign(Object.assign({}, prevState), { isAssetLoading: false, assetTemplate: get(response, "data", {}) });
56
+ });
57
+ }
58
+ catch (err) {
59
+ console.log("Error while fetching the Asset Template", err);
60
+ setState((prevState) => {
61
+ return Object.assign(Object.assign({}, prevState), { isAssetLoading: false });
62
+ });
63
+ }
64
+ });
65
+ const getFile = () => __awaiter(void 0, void 0, void 0, function* () {
66
+ setState((prevState) => {
67
+ return Object.assign(Object.assign({}, prevState), { loading: true });
68
+ });
69
+ try {
70
+ const response = yield api.get(FETCH_FILE_URL.replace(":fileId", id));
71
+ setState((prevState) => {
72
+ return Object.assign(Object.assign({}, prevState), { loading: false, file: get(response, "data", {}) });
73
+ });
74
+ getAsset(get(response, "data.assetId", ""));
75
+ }
76
+ catch (err) {
77
+ console.log("Error while fetching the file", err);
78
+ setState((prevState) => {
79
+ return Object.assign(Object.assign({}, prevState), { loading: false });
80
+ });
81
+ }
82
+ });
83
+ const { file, loading, isAssetLoading, assetTemplate } = state;
84
+ const metadata = get(file, "metadata", {});
85
+ const metadataFields = get(assetTemplate, "metadataFields", []);
86
+ const getValue = (fieldName) => {
87
+ const field = metadataFields.find((item) => get(item, "name") === fieldName);
88
+ const fieldId = get(field, "_id", "");
89
+ return (metadata === null || metadata === void 0 ? void 0 : metadata[fieldId]) || null;
90
+ };
91
+ const getOptions = (fieldName) => {
92
+ const field = metadataFields.find((item) => get(item, "name") === fieldName);
93
+ return get(field, "options", []);
94
+ };
95
+ console.log(getValue("Stars"));
96
+ return (_jsx(_Fragment, { children: loading || isAssetLoading ? (_jsx(Loader, {})) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-3 gap-4 p-4", children: [_jsx("div", { children: _jsx(Image, { src: get(file, "s3Url", ""), alt: "Dummy Image", className: "border rounded" }) }), _jsxs("div", { className: " mx-auto bg-white rounded-lg shadow-sm border border-borderColor overflow-hidden", children: [_jsx("div", { className: "bg-orange-50 px-6 py-3 border-b border-orange-100", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "text-orange-500", children: "\uD83D\uDD25" }), _jsx("span", { className: "text-orange-600 font-medium text-sm", children: "Trending in BOOKS" })] }) }), _jsxs("div", { className: "p-6", children: [_jsx("h1", { className: "text-3xl font-bold text-textColor mb-3", children: getValue("Name") || "" }), _jsx("p", { className: "text-textColor text-lg mb-4 leading-relaxed", children: getValue("Description") || "" }), _jsxs("p", { className: "mb-4", children: [_jsx("span", { className: "text-secondaryTextColor", children: "By: " }), _jsx("span", { className: "text-themeGreen font-medium", children: getValue("Author") || "" })] }), _jsxs("div", { className: "flex items-center gap-4 mb-4", children: [_jsxs("div", { className: "flex items-center gap-1", children: [[...Array(Number(getValue("Stars") || 0))].map((_, i) => (_jsx(Star, { className: "w-5 h-5 fill-themeYellow text-themeYellow" }, i))), [...Array(5 - (getValue("Stars") || 0))].map((_, i) => (_jsx(Star, { className: "w-5 h-5 text-secondaryTextColor" })))] }), _jsxs("span", { className: "text-secondaryTextColor text-sm", children: [getValue("Reviews") || 0, " review"] })] }), _jsxs("div", { className: "text-gray-600 text-sm mb-6", children: [getValue("Format") || "", " |", " ", getValue("Published Date")
97
+ ? dayjs(getValue("Published Date")).format("DD MMMM YYYY")
98
+ : ""] }), _jsxs("div", { className: "bg-gray-50 rounded-lg p-4", children: [_jsx("h3", { className: "font-semibold text-textColor mb-4", children: "At a Glance" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "p-2 bg-white rounded-lg shadow-sm", children: _jsx(BookOpen, { className: "w-5 h-5 text-secondaryTextColor" }) }), _jsxs("div", { children: [_jsx("div", { className: "text-sm text-secondaryTextColor", children: "Format" }), _jsx("div", { className: "font-medium text-textColor", children: getValue("Format") || "" })] })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "p-2 bg-white rounded-lg shadow-sm", children: _jsx(Ruler, { className: "w-5 h-5 text-secondaryTextColor" }) }), _jsxs("div", { children: [_jsx("div", { className: "text-sm text-secondaryTextColor", children: "Dimensions(cm)" }), _jsx("div", { className: "font-medium text-textColor", children: getValue("Dimensions") || "" })] })] })] })] })] })] }), _jsxs("div", { className: "max-w-md mx-auto bg-white rounded-lg shadow-lg p-6 font-sans", children: [_jsx("div", { className: "text-center mb-6", children: _jsx("h2", { className: "text-lg font-medium text-headingText tracking-wide", children: ((_a = getValue("Format")) === null || _a === void 0 ? void 0 : _a.toUpperCase()) || "" }) }), _jsxs("div", { className: "mb-6", children: [_jsxs("div", { className: "flex items-center justify-between mb-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-secondaryTextColor", children: "RRP" }), _jsxs("span", { className: "text-sm text-secondaryTextColor line-through", children: ["$", getValue("Actual Price") || ""] }), _jsx(Info, { className: "w-4 h-4 text-secondaryTextColor" })] }), _jsx("div", { className: "bg-themeGreen/10 text-themeGreen px-3 py-1 rounded-md", children: _jsxs("span", { className: "font-semibold text-sm", children: [getValue("Discount") || "", "% OFF"] }) })] }), _jsxs("div", { className: "text-4xl font-bold text-headingText mb-4", children: ["$", getValue("Discount Price") || ""] }), _jsxs("div", { className: "flex items-center justify-center gap-1 text-sm text-secondaryTextColor mb-6", children: [_jsx("span", { children: getValue("Payment Description") || "" }), _jsx("span", { className: "font-semibold text-headingText", children: "afterpay" }), _jsx(Info, { className: "w-4 h-4 text-secondaryTextColor ml-1" })] })] }), _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [_jsx("div", { className: "w-5 h-5 rounded-full bg-themeGreen flex items-center justify-center", children: _jsx("svg", { className: "w-3 h-3 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) }), _jsx("span", { className: `${getValue("In Stock") === "Yes"
99
+ ? "text-themeGreen"
100
+ : "text-dangerColor"} font-medium text-sm`, children: getValue("In Stock") ? "In Stock" : "Out of Stock" }), _jsx("span", { className: "text-secondaryTextColor text-sm", children: "and" }), _jsxs("span", { className: "text-imagesColor font-medium text-sm", children: ["Aims to ship in", " ", getValue("Minimum days to ship")
101
+ ? `${getValue("Minimum days to ship")} - `
102
+ : "", " ", getValue("Maximum days to ship"), " business days"] })] }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Truck, { className: "w-5 h-5 text-headingText" }), _jsx("span", { className: "text-headingText font-medium text-sm", children: getValue("Eligible for express delivery") == "Yes"
103
+ ? "Eligible for Express Delivery"
104
+ : "" }), _jsx(Info, { className: "w-4 h-4 text-secondaryTextColor" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Package, { className: "w-5 h-5 text-headingText" }), _jsx("span", { className: "text-headingText font-medium text-sm", children: "When will this arrive by?" })] })] })] })] }), _jsx(ProductDescription, { getValue: getValue })] })) }));
105
+ };
106
+ export default BookDetails;
@@ -0,0 +1,4 @@
1
+ declare const BookInfo: ({ getValue }: {
2
+ getValue: (field: string) => any;
3
+ }) => JSX.Element;
4
+ export default BookInfo;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import dayjs from "dayjs";
3
+ const BookInfo = ({ getValue }) => {
4
+ const ISBN = getValue("ISBN") || "";
5
+ const ISBN10 = getValue("ISBN-10") || "";
6
+ const format = getValue("Format") || "";
7
+ const language = getValue("Language") || "";
8
+ const audience = getValue("Audience") || "";
9
+ const publisher = getValue("Publisher") || "";
10
+ const countryOfPublication = getValue("Country of Publication") || "";
11
+ const weight = getValue("Weight (kg)") || "";
12
+ const dimensions = getValue("Dimensions") || "";
13
+ return (_jsx("div", { className: " p-6", children: _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "ISBN:" }), " ", _jsx("span", { className: "text-textColor", children: ISBN })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "ISBN-10:" }), " ", _jsx("span", { className: "text-textColor", children: ISBN10 })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Published:" }), " ", _jsx("span", { className: "text-textColor", children: getValue("Published Date")
14
+ ? dayjs(getValue("Published Date")).format("DD MMMM YYYY")
15
+ : "" })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Format:" }), " ", _jsx("span", { className: "text-textColor", children: format })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Language:" }), " ", _jsx("span", { className: "text-textColor", children: language })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Audience:" }), " ", _jsx("span", { className: "text-textColor", children: audience })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Publisher:" }), " ", _jsx("span", { className: "text-textColor", children: publisher })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Country of Publication:" }), " ", _jsx("span", { className: "text-textColor", children: countryOfPublication })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Dimensions (cm):" }), " ", _jsx("span", { className: "text-textColor", children: dimensions })] }), _jsxs("div", { children: [_jsx("span", { className: "font-semibold text-textColor", children: "Weight (kg):" }), " ", _jsx("span", { className: "text-textColor", children: weight })] })] }) }));
16
+ };
17
+ export default BookInfo;
@@ -0,0 +1,4 @@
1
+ declare const Description: ({ getValue }: {
2
+ getValue: (field: string) => any;
3
+ }) => JSX.Element;
4
+ export default Description;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ const Description = ({ getValue }) => {
3
+ return (_jsx("p", { className: "text-base text-textColor", children: getValue("Product Description") || "" }));
4
+ };
5
+ export default Description;
@@ -0,0 +1,10 @@
1
+ declare function App(props: {
2
+ accessKey: string;
3
+ secretKey: string;
4
+ subdomain: string;
5
+ teamIds: string[] | number[];
6
+ styles: Record<string, any>;
7
+ appType: string;
8
+ id: string;
9
+ }): JSX.Element;
10
+ export default App;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DamConfigProvider } from "../hocs/DamConfigContext";
3
+ import { ThemeProvider } from "../hocs/ThemeContext";
4
+ import { ThemeModes } from "../utilities/constants/interface";
5
+ import AppProvider from "../hocs/AppProvider";
6
+ import ToastProvider from "../hocs/ToastProvider";
7
+ import process from "process";
8
+ import BookDetails from "./bookDetail";
9
+ function App(props) {
10
+ if (typeof window !== "undefined" && !window.process) {
11
+ window.process = process;
12
+ }
13
+ const config = {
14
+ damAccessKey: props === null || props === void 0 ? void 0 : props.accessKey,
15
+ secretKey: props === null || props === void 0 ? void 0 : props.secretKey,
16
+ subdomain: props === null || props === void 0 ? void 0 : props.subdomain,
17
+ teamIds: props === null || props === void 0 ? void 0 : props.teamIds,
18
+ styles: props === null || props === void 0 ? void 0 : props.styles,
19
+ appType: props === null || props === void 0 ? void 0 : props.appType,
20
+ };
21
+ return (_jsx(DamConfigProvider, { config: config, children: _jsx(ThemeProvider, { styles: props === null || props === void 0 ? void 0 : props.styles, sessionTheme: ThemeModes.LIGHT, children: _jsxs(AppProvider, { children: [_jsx(BookDetails, { id: props === null || props === void 0 ? void 0 : props.id }), _jsx(ToastProvider, {})] }) }) }));
22
+ }
23
+ export default App;
@@ -0,0 +1,8 @@
1
+ declare const CreateClient: ({ onSuccess, clientSubdomain, teamsApi, username, password, }: {
2
+ onSuccess: (data: any) => void;
3
+ clientSubdomain: string;
4
+ teamsApi: string;
5
+ username: string;
6
+ password: string;
7
+ }) => JSX.Element;
8
+ export default CreateClient;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "antd";
3
+ import { useState } from "react";
4
+ import CreateClientForm from "./CreateClientForm";
5
+ const CreateClient = ({ onSuccess, clientSubdomain, teamsApi, username, password, }) => {
6
+ const [showForm, setShowForm] = useState(false);
7
+ const toggleShow = () => {
8
+ setShowForm(!showForm);
9
+ };
10
+ return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "primary", onClick: toggleShow, children: "Create Client" }), showForm && (_jsx(CreateClientForm, { toggleShow: toggleShow, onSuccess: onSuccess, clientSubdomain: clientSubdomain, teamsApi: teamsApi, username: username, password: password }))] }));
11
+ };
12
+ export default CreateClient;
@@ -0,0 +1,9 @@
1
+ declare const CreateClientForm: ({ teamsApi, username, password, toggleShow, onSuccess, clientSubdomain, }: {
2
+ teamsApi: string;
3
+ username: string;
4
+ password: string;
5
+ toggleShow: () => void;
6
+ onSuccess: (data: any) => void;
7
+ clientSubdomain: string;
8
+ }) => JSX.Element;
9
+ export default CreateClientForm;