ikoncomponents 1.5.7 → 1.5.8
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.
- package/README.md +36 -36
- package/bin.js +2 -0
- package/dist/commands/init.js +63 -0
- package/dist/index.js +14 -116
- package/dist/utlis/copyDir.js +7 -0
- package/package.json +17 -91
- package/templates/default/hooks/use-mobile.ts +19 -0
- package/templates/default/ikonS/accordion.tsx +66 -0
- package/templates/default/ikonS/alert-dialog.tsx +179 -0
- package/templates/default/ikonS/alert.tsx +66 -0
- package/templates/default/ikonS/aspect-ratio.tsx +11 -0
- package/templates/default/ikonS/avatar.tsx +53 -0
- package/templates/default/ikonS/badge.tsx +49 -0
- package/templates/default/ikonS/breadcrumb.tsx +109 -0
- package/templates/default/ikonS/button.tsx +64 -0
- package/templates/default/ikonS/calendar.tsx +227 -0
- package/templates/default/ikonS/card.tsx +92 -0
- package/templates/default/ikonS/checkbox.tsx +33 -0
- package/templates/default/ikonS/collapsible.tsx +33 -0
- package/templates/default/ikonS/command.tsx +184 -0
- package/templates/default/ikonS/date-input.tsx +259 -0
- package/templates/default/ikonS/date-range-picker.tsx +103 -0
- package/templates/default/ikonS/dialog.tsx +143 -0
- package/templates/default/ikonS/drawer.tsx +134 -0
- package/templates/default/ikonS/dropdown-menu.tsx +259 -0
- package/templates/default/ikonS/form.tsx +166 -0
- package/templates/default/ikonS/hover-card.tsx +44 -0
- package/templates/default/ikonS/input-otp.tsx +71 -0
- package/templates/default/ikonS/input.tsx +22 -0
- package/templates/default/ikonS/label.tsx +24 -0
- package/templates/default/ikonS/navigation-menu.tsx +195 -0
- package/templates/default/ikonS/popover.tsx +48 -0
- package/templates/default/ikonS/progress.tsx +40 -0
- package/templates/default/ikonS/radio-group.tsx +45 -0
- package/templates/default/ikonS/scroll-area.tsx +58 -0
- package/templates/default/ikonS/select.tsx +184 -0
- package/templates/default/ikonS/separator.tsx +28 -0
- package/templates/default/ikonS/sheet.tsx +139 -0
- package/templates/default/ikonS/sidebar.tsx +726 -0
- package/templates/default/ikonS/skeleton.tsx +15 -0
- package/templates/default/ikonS/slider.tsx +64 -0
- package/templates/default/ikonS/sonner.tsx +25 -0
- package/templates/default/ikonS/switch.tsx +31 -0
- package/templates/default/ikonS/table.tsx +116 -0
- package/templates/default/ikonS/tabs.tsx +67 -0
- package/templates/default/ikonS/textarea.tsx +18 -0
- package/templates/default/ikonS/toggle-group.tsx +83 -0
- package/templates/default/ikonS/toggle.tsx +47 -0
- package/templates/default/ikonS/tooltip.tsx +65 -0
- package/templates/default/ikonS/workflow.tsx +119 -0
- package/templates/default/ikoncomponents/action-menu/index.tsx +108 -0
- package/templates/default/ikoncomponents/action-menu/type.ts +18 -0
- package/templates/default/ikoncomponents/activity-sheet/index.tsx +63 -0
- package/templates/default/ikoncomponents/alert-dialog/dialog-context.tsx +65 -0
- package/templates/default/ikoncomponents/alert-dialog/index.tsx +80 -0
- package/templates/default/ikoncomponents/app-breadcrumb/BreadcrumbProvider.tsx +68 -0
- package/templates/default/ikoncomponents/app-breadcrumb/index.tsx +222 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-event/index.tsx +38 -0
- package/templates/default/ikoncomponents/big-calendar/big-calender-toolbar/index.tsx +81 -0
- package/templates/default/ikoncomponents/big-calendar/index.css +879 -0
- package/templates/default/ikoncomponents/big-calendar/index.tsx +59 -0
- package/templates/default/ikoncomponents/big-calendar/type.ts +37 -0
- package/templates/default/ikoncomponents/buttons/index.tsx +127 -0
- package/templates/default/ikoncomponents/combobox-input/index.tsx +75 -0
- package/templates/default/ikoncomponents/combobox-input/type.ts +14 -0
- package/templates/default/ikoncomponents/custom-combo-dropdown/index.tsx +242 -0
- package/templates/default/ikoncomponents/data-table/datatable-column-filter/index.tsx +80 -0
- package/templates/default/ikoncomponents/data-table/datatable-faceted-filter/index.tsx +149 -0
- package/templates/default/ikoncomponents/data-table/datatable-filter-menu/index.tsx +98 -0
- package/templates/default/ikoncomponents/data-table/datatable-pagination/index.tsx +119 -0
- package/templates/default/ikoncomponents/data-table/datatable-toolbar/index.tsx +45 -0
- package/templates/default/ikoncomponents/data-table/function.ts +7 -0
- package/templates/default/ikoncomponents/data-table/index.tsx +549 -0
- package/templates/default/ikoncomponents/data-table/type.ts +75 -0
- package/templates/default/ikoncomponents/e-chart/index.tsx +183 -0
- package/templates/default/ikoncomponents/file-input/index.tsx +27 -0
- package/templates/default/ikoncomponents/fileUpload/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input/index.tsx +111 -0
- package/templates/default/ikoncomponents/form-fields/combobox-input-value/index.tsx +121 -0
- package/templates/default/ikoncomponents/form-fields/date-input/index.tsx +80 -0
- package/templates/default/ikoncomponents/form-fields/file-input/index.tsx +9 -0
- package/templates/default/ikoncomponents/form-fields/input/index.tsx +27 -0
- package/{dist/ikoncomponents/form-fields/multi-combobox-input/index.js → templates/default/ikoncomponents/form-fields/multi-combobox-input/index.tsx} +574 -381
- package/templates/default/ikoncomponents/form-fields/otp-input/index.tsx +39 -0
- package/templates/default/ikoncomponents/form-fields/password-input/index.tsx +52 -0
- package/templates/default/ikoncomponents/form-fields/phone-input/index.tsx +7 -0
- package/templates/default/ikoncomponents/form-fields/textarea/index.tsx +28 -0
- package/templates/default/ikoncomponents/form-fields/types/index.ts +46 -0
- package/templates/default/ikoncomponents/glowing-effect/index.tsx +171 -0
- package/templates/default/ikoncomponents/icon/index.tsx +22 -0
- package/templates/default/ikoncomponents/image-cropper-upload/components/cropperImg.css +19 -0
- package/{dist/ikoncomponents/image-cropper-upload/components/newCropper.js → templates/default/ikoncomponents/image-cropper-upload/components/newCropper.tsx} +117 -85
- package/templates/default/ikoncomponents/image-cropper-upload/components/newImageUploadForm.tsx +352 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form/index.tsx +250 -0
- package/templates/default/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.tsx +32 -0
- package/{dist/ikoncomponents/image-cropper-upload/image-cropper/index.js → templates/default/ikoncomponents/image-cropper-upload/image-cropper/index.tsx} +119 -87
- package/templates/default/ikoncomponents/image-cropper-upload/index.tsx +95 -0
- package/templates/default/ikoncomponents/image-cropper-upload/utils/index.ts +117 -0
- package/templates/default/ikoncomponents/loading-spinner/index.tsx +43 -0
- package/templates/default/ikoncomponents/main-layout/RefreshContext.tsx +30 -0
- package/templates/default/ikoncomponents/main-layout/SidebarNavContext.tsx +103 -0
- package/templates/default/ikoncomponents/main-layout/app-sidebar.tsx +36 -0
- package/templates/default/ikoncomponents/main-layout/footer.tsx +21 -0
- package/templates/default/ikoncomponents/main-layout/header.tsx +53 -0
- package/templates/default/ikoncomponents/main-layout/index.tsx +38 -0
- package/templates/default/ikoncomponents/main-layout/main-sidebar.tsx +389 -0
- package/templates/default/ikoncomponents/main-layout/nav-main.tsx +103 -0
- package/templates/default/ikoncomponents/multi-combobox/index.tsx +345 -0
- package/templates/default/ikoncomponents/no-data/index.tsx +11 -0
- package/templates/default/ikoncomponents/page-wrapper/index.tsx +30 -0
- package/templates/default/ikoncomponents/password-strength-meter/index.tsx +49 -0
- package/templates/default/ikoncomponents/phone-input/index.tsx +72 -0
- package/templates/default/ikoncomponents/provider-wrapper/index.tsx +32 -0
- package/templates/default/ikoncomponents/search-input/index.tsx +18 -0
- package/templates/default/ikoncomponents/sheet/index.tsx +34 -0
- package/templates/default/ikoncomponents/simple-widget/index.tsx +54 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-table.tsx +34 -0
- package/templates/default/ikoncomponents/skeleton-loader/skeleton-widget.tsx +13 -0
- package/templates/default/ikoncomponents/tabs/index.tsx +139 -0
- package/{dist/ikoncomponents/tabs/type.d.ts → templates/default/ikoncomponents/tabs/type.ts} +20 -19
- package/{dist/ikoncomponents/theme-toggle-btn/index.js → templates/default/ikoncomponents/theme-toggle-btn/index.tsx} +189 -118
- package/templates/default/ikoncomponents/title-progress/index.tsx +41 -0
- package/templates/default/ikoncomponents/tooltip/index.tsx +17 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/convertToDropdownNodes.tsx +33 -0
- package/templates/default/ikoncomponents/twolevel-dropdown/index.tsx +279 -0
- package/templates/default/ikoncomponents/upload-tab/index.tsx +237 -0
- package/templates/default/ikoncomponents/widgets/index.tsx +81 -0
- package/templates/default/ikoncomponents/widgets/type.ts +11 -0
- package/templates/default/ikoncomponents/work-in-progress/index.tsx +16 -0
- package/templates/default/styles.css +1159 -0
- package/templates/default/utils/actions/account/index.ts +33 -0
- package/templates/default/utils/actions/account/type.ts +4 -0
- package/{dist/utils/actions/auth/index.js → templates/default/utils/actions/auth/index.ts} +69 -58
- package/templates/default/utils/actions/common/revalidate.ts +18 -0
- package/templates/default/utils/actions/common/type.ts +4 -0
- package/{dist/utils/actions/common/utils.js → templates/default/utils/actions/common/utils.ts} +28 -25
- package/templates/default/utils/actions/software/index.ts +106 -0
- package/templates/default/utils/api/accountService/index.ts +103 -0
- package/templates/default/utils/api/accountService/type.ts +4 -0
- package/templates/default/utils/api/file-upload/index.ts +103 -0
- package/templates/default/utils/api/file-upload/type.ts +8 -0
- package/{dist/utils/api/ikonBaseApi.js → templates/default/utils/api/ikonBaseApi.ts} +132 -104
- package/templates/default/utils/api/loginService/index.ts +106 -0
- package/{dist/utils/api/loginService/type.d.ts → templates/default/utils/api/loginService/type.ts} +35 -31
- package/templates/default/utils/api/softwareService/index.ts +356 -0
- package/templates/default/utils/api/softwareService/type.ts +62 -0
- package/{dist/utils/border-radius-provider.js → templates/default/utils/border-radius-provider.tsx} +59 -35
- package/templates/default/utils/cn.ts +6 -0
- package/{dist/utils/font-provider.js → templates/default/utils/font-provider.tsx} +61 -37
- package/templates/default/utils/session/cookieSession.ts +49 -0
- package/templates/default/utils/theme-provider/index.tsx +11 -0
- package/templates/default/utils/token-management/index.ts +115 -0
- package/templates/default/utils/token-management/types.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +0 -1
- package/dist/hooks/use-mobile.js +0 -15
- package/dist/ikoncomponents/action-menu/index.d.ts +0 -5
- package/dist/ikoncomponents/action-menu/index.js +0 -42
- package/dist/ikoncomponents/action-menu/type.d.ts +0 -14
- package/dist/ikoncomponents/action-menu/type.js +0 -1
- package/dist/ikoncomponents/activity-sheet/index.d.ts +0 -11
- package/dist/ikoncomponents/activity-sheet/index.js +0 -23
- package/dist/ikoncomponents/alert-dialog/dialog-context.d.ts +0 -21
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +0 -30
- package/dist/ikoncomponents/alert-dialog/index.d.ts +0 -14
- package/dist/ikoncomponents/alert-dialog/index.js +0 -20
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +0 -18
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +0 -43
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +0 -5
- package/dist/ikoncomponents/app-breadcrumb/index.js +0 -57
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +0 -5
- package/dist/ikoncomponents/big-calendar/big-calender-event/index.js +0 -16
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +0 -2
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +0 -39
- package/dist/ikoncomponents/big-calendar/index.d.ts +0 -3
- package/dist/ikoncomponents/big-calendar/index.js +0 -35
- package/dist/ikoncomponents/big-calendar/type.d.ts +0 -31
- package/dist/ikoncomponents/big-calendar/type.js +0 -1
- package/dist/ikoncomponents/buttons/index.d.ts +0 -18
- package/dist/ikoncomponents/buttons/index.js +0 -38
- package/dist/ikoncomponents/combobox-input/index.d.ts +0 -2
- package/dist/ikoncomponents/combobox-input/index.js +0 -18
- package/dist/ikoncomponents/combobox-input/type.d.ts +0 -13
- package/dist/ikoncomponents/combobox-input/type.js +0 -1
- package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +0 -21
- package/dist/ikoncomponents/custom-combo-dropdown/index.js +0 -85
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +0 -22
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +0 -35
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +0 -38
- package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +0 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +0 -18
- package/dist/ikoncomponents/data-table/function.d.ts +0 -1
- package/dist/ikoncomponents/data-table/function.js +0 -6
- package/dist/ikoncomponents/data-table/index.d.ts +0 -2
- package/dist/ikoncomponents/data-table/index.js +0 -223
- package/dist/ikoncomponents/data-table/type.d.ts +0 -60
- package/dist/ikoncomponents/data-table/type.js +0 -1
- package/dist/ikoncomponents/e-chart/index.d.ts +0 -15
- package/dist/ikoncomponents/e-chart/index.js +0 -115
- package/dist/ikoncomponents/file-input/index.d.ts +0 -1
- package/dist/ikoncomponents/file-input/index.js +0 -21
- package/dist/ikoncomponents/fileUpload/index.d.ts +0 -15
- package/dist/ikoncomponents/fileUpload/index.js +0 -69
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +0 -21
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +0 -18
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +0 -26
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/date-input/index.js +0 -15
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +0 -1
- package/dist/ikoncomponents/form-fields/file-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +0 -6
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/otp-input/index.js +0 -18
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +0 -1
- package/dist/ikoncomponents/form-fields/phone-input/index.js +0 -4
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +0 -2
- package/dist/ikoncomponents/form-fields/textarea/index.js +0 -18
- package/dist/ikoncomponents/form-fields/types/index.d.ts +0 -36
- package/dist/ikoncomponents/form-fields/types/index.js +0 -1
- package/dist/ikoncomponents/glowing-effect/index.d.ts +0 -14
- package/dist/ikoncomponents/glowing-effect/index.js +0 -84
- package/dist/ikoncomponents/icon/index.d.ts +0 -8
- package/dist/ikoncomponents/icon/index.js +0 -23
- package/dist/ikoncomponents/image-cropper-upload/components/newCropper.d.ts +0 -15
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.d.ts +0 -7
- package/dist/ikoncomponents/image-cropper-upload/components/newImageUploadForm.js +0 -145
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +0 -6
- package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.js +0 -92
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +0 -6
- package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.js +0 -14
- package/dist/ikoncomponents/image-cropper-upload/image-cropper/index.d.ts +0 -14
- package/dist/ikoncomponents/image-cropper-upload/index.d.ts +0 -27
- package/dist/ikoncomponents/image-cropper-upload/index.js +0 -49
- package/dist/ikoncomponents/image-cropper-upload/utils/index.d.ts +0 -16
- package/dist/ikoncomponents/image-cropper-upload/utils/index.js +0 -73
- package/dist/ikoncomponents/loading-spinner/index.d.ts +0 -9
- package/dist/ikoncomponents/loading-spinner/index.js +0 -19
- package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +0 -10
- package/dist/ikoncomponents/main-layout/RefreshContext.js +0 -17
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +0 -33
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +0 -52
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +0 -3
- package/dist/ikoncomponents/main-layout/app-sidebar.js +0 -24
- package/dist/ikoncomponents/main-layout/footer.d.ts +0 -1
- package/dist/ikoncomponents/main-layout/footer.js +0 -5
- package/dist/ikoncomponents/main-layout/header.d.ts +0 -3
- package/dist/ikoncomponents/main-layout/header.js +0 -15
- package/dist/ikoncomponents/main-layout/index.d.ts +0 -6
- package/dist/ikoncomponents/main-layout/index.js +0 -11
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +0 -60
- package/dist/ikoncomponents/main-layout/main-sidebar.js +0 -119
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +0 -11
- package/dist/ikoncomponents/main-layout/nav-main.js +0 -33
- package/dist/ikoncomponents/multi-combobox/index.d.ts +0 -13
- package/dist/ikoncomponents/multi-combobox/index.js +0 -202
- package/dist/ikoncomponents/no-data/index.d.ts +0 -3
- package/dist/ikoncomponents/no-data/index.js +0 -5
- package/dist/ikoncomponents/page-wrapper/index.d.ts +0 -9
- package/dist/ikoncomponents/page-wrapper/index.js +0 -7
- package/dist/ikoncomponents/password-strength-meter/index.d.ts +0 -3
- package/dist/ikoncomponents/password-strength-meter/index.js +0 -40
- package/dist/ikoncomponents/phone-input/index.d.ts +0 -1
- package/dist/ikoncomponents/phone-input/index.js +0 -41
- package/dist/ikoncomponents/provider-wrapper/index.d.ts +0 -6
- package/dist/ikoncomponents/provider-wrapper/index.js +0 -11
- package/dist/ikoncomponents/search-input/index.d.ts +0 -1
- package/dist/ikoncomponents/search-input/index.js +0 -19
- package/dist/ikoncomponents/sheet/index.d.ts +0 -10
- package/dist/ikoncomponents/sheet/index.js +0 -6
- package/dist/ikoncomponents/simple-widget/index.d.ts +0 -14
- package/dist/ikoncomponents/simple-widget/index.js +0 -14
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +0 -5
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +0 -6
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +0 -3
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +0 -5
- package/dist/ikoncomponents/tabs/index.d.ts +0 -2
- package/dist/ikoncomponents/tabs/index.js +0 -50
- package/dist/ikoncomponents/tabs/type.js +0 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +0 -1
- package/dist/ikoncomponents/title-progress/index.d.ts +0 -12
- package/dist/ikoncomponents/title-progress/index.js +0 -10
- package/dist/ikoncomponents/tooltip/index.d.ts +0 -5
- package/dist/ikoncomponents/tooltip/index.js +0 -5
- package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +0 -31
- package/dist/ikoncomponents/twolevel-dropdown/index.js +0 -143
- package/dist/ikoncomponents/upload-tab/index.d.ts +0 -1
- package/dist/ikoncomponents/upload-tab/index.js +0 -92
- package/dist/ikoncomponents/widgets/index.d.ts +0 -2
- package/dist/ikoncomponents/widgets/index.js +0 -14
- package/dist/ikoncomponents/widgets/type.d.ts +0 -10
- package/dist/ikoncomponents/widgets/type.js +0 -2
- package/dist/ikoncomponents/work-in-progress/index.d.ts +0 -1
- package/dist/ikoncomponents/work-in-progress/index.js +0 -4
- package/dist/index.d.ts +0 -138
- package/dist/shadcn/accordion.d.ts +0 -7
- package/dist/shadcn/accordion.js +0 -33
- package/dist/shadcn/alert-dialog.d.ts +0 -20
- package/dist/shadcn/alert-dialog.js +0 -83
- package/dist/shadcn/alert.d.ts +0 -9
- package/dist/shadcn/alert.js +0 -38
- package/dist/shadcn/aspect-ratio.d.ts +0 -3
- package/dist/shadcn/aspect-ratio.js +0 -19
- package/dist/shadcn/avatar.d.ts +0 -6
- package/dist/shadcn/avatar.js +0 -28
- package/dist/shadcn/badge.d.ts +0 -9
- package/dist/shadcn/badge.js +0 -35
- package/dist/shadcn/breadcrumb.d.ts +0 -11
- package/dist/shadcn/breadcrumb.js +0 -45
- package/dist/shadcn/button.d.ts +0 -10
- package/dist/shadcn/button.js +0 -47
- package/dist/shadcn/calendar.d.ts +0 -8
- package/dist/shadcn/calendar.js +0 -61
- package/dist/shadcn/card.d.ts +0 -9
- package/dist/shadcn/card.js +0 -42
- package/dist/shadcn/checkbox.d.ts +0 -4
- package/dist/shadcn/checkbox.js +0 -21
- package/dist/shadcn/collapsible.d.ts +0 -5
- package/dist/shadcn/collapsible.js +0 -27
- package/dist/shadcn/command.d.ts +0 -18
- package/dist/shadcn/command.js +0 -54
- package/dist/shadcn/date-input.d.ts +0 -7
- package/dist/shadcn/date-input.js +0 -179
- package/dist/shadcn/date-range-picker.d.ts +0 -24
- package/dist/shadcn/date-range-picker.js +0 -45
- package/dist/shadcn/dialog.d.ts +0 -15
- package/dist/shadcn/dialog.js +0 -57
- package/dist/shadcn/drawer.d.ts +0 -13
- package/dist/shadcn/drawer.js +0 -56
- package/dist/shadcn/dropdown-menu.d.ts +0 -25
- package/dist/shadcn/dropdown-menu.js +0 -77
- package/dist/shadcn/form.d.ts +0 -24
- package/dist/shadcn/form.js +0 -70
- package/dist/shadcn/hover-card.d.ts +0 -6
- package/dist/shadcn/hover-card.js +0 -28
- package/dist/shadcn/input-otp.d.ts +0 -34
- package/dist/shadcn/input-otp.js +0 -40
- package/dist/shadcn/input.d.ts +0 -3
- package/dist/shadcn/input.js +0 -18
- package/dist/shadcn/label.d.ts +0 -4
- package/dist/shadcn/label.js +0 -20
- package/dist/shadcn/navigation-menu.d.ts +0 -16
- package/dist/shadcn/navigation-menu.js +0 -74
- package/dist/shadcn/popover.d.ts +0 -7
- package/dist/shadcn/popover.js +0 -32
- package/dist/shadcn/progress.d.ts +0 -8
- package/dist/shadcn/progress.js +0 -23
- package/dist/shadcn/radio-group.d.ts +0 -5
- package/dist/shadcn/radio-group.js +0 -25
- package/dist/shadcn/scroll-area.d.ts +0 -5
- package/dist/shadcn/scroll-area.js +0 -26
- package/dist/shadcn/select.d.ts +0 -15
- package/dist/shadcn/select.js +0 -59
- package/dist/shadcn/separator.d.ts +0 -4
- package/dist/shadcn/separator.js +0 -20
- package/dist/shadcn/sheet.d.ts +0 -13
- package/dist/shadcn/sheet.js +0 -61
- package/dist/shadcn/sidebar.d.ts +0 -69
- package/dist/shadcn/sidebar.js +0 -242
- package/dist/shadcn/skeleton.d.ts +0 -3
- package/dist/shadcn/skeleton.js +0 -18
- package/dist/shadcn/slider.d.ts +0 -4
- package/dist/shadcn/slider.js +0 -26
- package/dist/shadcn/sonner.d.ts +0 -3
- package/dist/shadcn/sonner.js +0 -25
- package/dist/shadcn/switch.d.ts +0 -4
- package/dist/shadcn/switch.js +0 -20
- package/dist/shadcn/table.d.ts +0 -10
- package/dist/shadcn/table.js +0 -47
- package/dist/shadcn/tabs.d.ts +0 -7
- package/dist/shadcn/tabs.js +0 -32
- package/dist/shadcn/textarea.d.ts +0 -3
- package/dist/shadcn/textarea.js +0 -18
- package/dist/shadcn/toggle-group.d.ts +0 -9
- package/dist/shadcn/toggle-group.js +0 -35
- package/dist/shadcn/toggle.d.ts +0 -9
- package/dist/shadcn/toggle.js +0 -38
- package/dist/shadcn/tooltip.d.ts +0 -7
- package/dist/shadcn/tooltip.js +0 -32
- package/dist/shadcn/workflow.d.ts +0 -20
- package/dist/shadcn/workflow.js +0 -20
- package/dist/styles.css +0 -6163
- package/dist/utils/actions/account/index.d.ts +0 -5
- package/dist/utils/actions/account/index.js +0 -28
- package/dist/utils/actions/account/type.d.ts +0 -4
- package/dist/utils/actions/account/type.js +0 -1
- package/dist/utils/actions/auth/index.d.ts +0 -7
- package/dist/utils/actions/common/utils.d.ts +0 -5
- package/dist/utils/actions/software/index.d.ts +0 -11
- package/dist/utils/actions/software/index.js +0 -75
- package/dist/utils/api/accountService/index.d.ts +0 -23
- package/dist/utils/api/accountService/index.js +0 -64
- package/dist/utils/api/accountService/type.d.ts +0 -4
- package/dist/utils/api/accountService/type.js +0 -1
- package/dist/utils/api/file-upload/index.d.ts +0 -5
- package/dist/utils/api/file-upload/index.js +0 -80
- package/dist/utils/api/file-upload/type.d.ts +0 -6
- package/dist/utils/api/file-upload/type.js +0 -1
- package/dist/utils/api/ikonBaseApi.d.ts +0 -12
- package/dist/utils/api/loginService/index.d.ts +0 -12
- package/dist/utils/api/loginService/index.js +0 -72
- package/dist/utils/api/loginService/type.js +0 -1
- package/dist/utils/api/softwareService/index.d.ts +0 -64
- package/dist/utils/api/softwareService/index.js +0 -212
- package/dist/utils/api/softwareService/type.d.ts +0 -54
- package/dist/utils/api/softwareService/type.js +0 -1
- package/dist/utils/border-radius-provider.d.ts +0 -11
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/cn.js +0 -5
- package/dist/utils/font-provider.d.ts +0 -11
- package/dist/utils/session/cookieSession.d.ts +0 -8
- package/dist/utils/session/cookieSession.js +0 -33
- package/dist/utils/theme-provider/index.d.ts +0 -3
- package/dist/utils/theme-provider/index.js +0 -18
- package/dist/utils/token-management/index.d.ts +0 -10
- package/dist/utils/token-management/index.js +0 -69
- package/dist/utils/token-management/types.d.ts +0 -6
- package/dist/utils/token-management/types.js +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
4
|
-
import { animate } from "motion/react";
|
|
5
|
-
import { cn } from "../../utils/cn";
|
|
6
|
-
export const GlowingEffect = (({ blur = 0, inactiveZone = 0.7, proximity = 0, spread = 20, variant = "default", glow = false, className, movementDuration = 2, borderWidth = 1, disabled = true, }) => {
|
|
7
|
-
const containerRef = useRef(null);
|
|
8
|
-
const lastPosition = useRef({ x: 0, y: 0 });
|
|
9
|
-
const animationFrameRef = useRef(0);
|
|
10
|
-
const handleMove = useCallback((e) => {
|
|
11
|
-
if (!containerRef.current)
|
|
12
|
-
return;
|
|
13
|
-
if (animationFrameRef.current) {
|
|
14
|
-
cancelAnimationFrame(animationFrameRef.current);
|
|
15
|
-
}
|
|
16
|
-
animationFrameRef.current = requestAnimationFrame(() => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
const element = containerRef.current;
|
|
19
|
-
if (!element)
|
|
20
|
-
return;
|
|
21
|
-
const { left, top, width, height } = element.getBoundingClientRect();
|
|
22
|
-
const mouseX = (_a = e === null || e === void 0 ? void 0 : e.x) !== null && _a !== void 0 ? _a : lastPosition.current.x;
|
|
23
|
-
const mouseY = (_b = e === null || e === void 0 ? void 0 : e.y) !== null && _b !== void 0 ? _b : lastPosition.current.y;
|
|
24
|
-
if (e) {
|
|
25
|
-
lastPosition.current = { x: mouseX, y: mouseY };
|
|
26
|
-
}
|
|
27
|
-
const center = [left + width * 0.5, top + height * 0.5];
|
|
28
|
-
const distanceFromCenter = Math.hypot(mouseX - center[0], mouseY - center[1]);
|
|
29
|
-
const inactiveRadius = 0.5 * Math.min(width, height) * inactiveZone;
|
|
30
|
-
if (distanceFromCenter < inactiveRadius) {
|
|
31
|
-
element.style.setProperty("--active", "0");
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const isActive = mouseX > left - proximity &&
|
|
35
|
-
mouseX < left + width + proximity &&
|
|
36
|
-
mouseY > top - proximity &&
|
|
37
|
-
mouseY < top + height + proximity;
|
|
38
|
-
element.style.setProperty("--active", isActive ? "1" : "0");
|
|
39
|
-
if (!isActive)
|
|
40
|
-
return;
|
|
41
|
-
const currentAngle = parseFloat(element.style.getPropertyValue("--start")) || 0;
|
|
42
|
-
const targetAngle = (180 * Math.atan2(mouseY - center[1], mouseX - center[0])) /
|
|
43
|
-
Math.PI +
|
|
44
|
-
90;
|
|
45
|
-
const angleDiff = ((targetAngle - currentAngle + 180) % 360) - 180;
|
|
46
|
-
const newAngle = currentAngle + angleDiff;
|
|
47
|
-
animate(currentAngle, newAngle, {
|
|
48
|
-
duration: movementDuration,
|
|
49
|
-
ease: [0.16, 1, 0.3, 1],
|
|
50
|
-
onUpdate: (value) => {
|
|
51
|
-
element.style.setProperty("--start", String(value));
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}, [inactiveZone, proximity, movementDuration]);
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (disabled)
|
|
58
|
-
return;
|
|
59
|
-
const handleScroll = () => handleMove();
|
|
60
|
-
const handlePointerMove = (e) => handleMove(e);
|
|
61
|
-
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
62
|
-
document.body.addEventListener("pointermove", handlePointerMove, {
|
|
63
|
-
passive: true,
|
|
64
|
-
});
|
|
65
|
-
return () => {
|
|
66
|
-
if (animationFrameRef.current) {
|
|
67
|
-
cancelAnimationFrame(animationFrameRef.current);
|
|
68
|
-
}
|
|
69
|
-
window.removeEventListener("scroll", handleScroll);
|
|
70
|
-
document.body.removeEventListener("pointermove", handlePointerMove);
|
|
71
|
-
};
|
|
72
|
-
}, [handleMove, disabled]);
|
|
73
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: cn("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity", glow && "opacity-100", variant === "white" && "border-white", disabled && "!block") }), _jsx("div", { ref: containerRef, style: {
|
|
74
|
-
"--blur": `${blur}px`,
|
|
75
|
-
"--spread": spread,
|
|
76
|
-
"--start": "0",
|
|
77
|
-
"--active": "0",
|
|
78
|
-
"--glowingeffect-border-width": `${borderWidth}px`,
|
|
79
|
-
"--repeating-conic-gradient-times": "5",
|
|
80
|
-
"--gradient": variant === "white"
|
|
81
|
-
? `repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))`
|
|
82
|
-
: `linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)`,
|
|
83
|
-
}, className: cn("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity", glow && "opacity-100", blur > 0 && "blur-[var(--blur)] ", className, disabled && "!hidden"), children: _jsx("div", { className: cn("glow", "rounded-[inherit]", 'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]', "after:[border:var(--glowingeffect-border-width)_solid_transparent]", "after:[background:var(--gradient)] after:[background-attachment:fixed]", "after:opacity-[var(--active)] after:transition-opacity after:duration-300", "after:[mask-clip:padding-box,border-box]", "after:[mask-composite:intersect]", "after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]") }) })] }));
|
|
84
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import * as LucideIcons from 'lucide-react';
|
|
15
|
-
export function Icon(_a) {
|
|
16
|
-
var { name } = _a, props = __rest(_a, ["name"]);
|
|
17
|
-
const IconComponent = LucideIcons[name];
|
|
18
|
-
if (!IconComponent) {
|
|
19
|
-
console.warn(`Icon "${name}" not found in lucide-react`);
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
return _jsx(IconComponent, Object.assign({}, props));
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "cropperjs/dist/cropper.css";
|
|
3
|
-
export interface CropperImgProps {
|
|
4
|
-
imageSrc: string | undefined;
|
|
5
|
-
onCroppedImage: (imageUrl: string) => void;
|
|
6
|
-
aspectRatio: number;
|
|
7
|
-
rotationAngle: number;
|
|
8
|
-
zoomLevel: number;
|
|
9
|
-
moveDirection: {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
};
|
|
13
|
-
currentState: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const NewCropperImg: React.FC<CropperImgProps>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface ImageFormProps {
|
|
3
|
-
open: boolean;
|
|
4
|
-
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
-
onImageSubmit: (data: string | null) => void;
|
|
6
|
-
}
|
|
7
|
-
export declare const NewImageForm: React.NamedExoticComponent<ImageFormProps>;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, memo } from "react";
|
|
3
|
-
import { ZoomIn, ZoomOut, RotateCw, RotateCcw, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, ImageIcon, FileImage, Square, Upload, } from "lucide-react";
|
|
4
|
-
import { Label } from "../../../shadcn/label";
|
|
5
|
-
import { Input } from "../../../shadcn/input";
|
|
6
|
-
import { Button } from "../../../shadcn/button";
|
|
7
|
-
import { NewCropperImg } from "./newCropper";
|
|
8
|
-
import Image from "next/image";
|
|
9
|
-
const NewImageFormComponent = ({ open, setOpen, onImageSubmit, }) => {
|
|
10
|
-
const [imageSrc, setImageSrc] = useState(null);
|
|
11
|
-
const [croppedImage, setCroppedImage] = useState(null);
|
|
12
|
-
const [prevImages, setPrevImages] = useState({
|
|
13
|
-
first: null,
|
|
14
|
-
second: null,
|
|
15
|
-
third: null,
|
|
16
|
-
});
|
|
17
|
-
const [aspectRatio, setAspectRatio] = useState(4 / 3);
|
|
18
|
-
const [activeState, setActiveState] = useState("first");
|
|
19
|
-
const [rotationAngle, setRotationAngle] = useState(0);
|
|
20
|
-
const [scale, setScale] = useState(1);
|
|
21
|
-
const [moveDirection, setMoveDirection] = useState({
|
|
22
|
-
x: 0,
|
|
23
|
-
y: 0,
|
|
24
|
-
});
|
|
25
|
-
const [fileName, setFileName] = useState("");
|
|
26
|
-
const handleImageSubmit = () => {
|
|
27
|
-
console.log("Image Submit Button is pressed");
|
|
28
|
-
console.log(prevImages);
|
|
29
|
-
onImageSubmit(prevImages.third);
|
|
30
|
-
setOpen(false);
|
|
31
|
-
};
|
|
32
|
-
const rotateImage = (angle) => {
|
|
33
|
-
setRotationAngle((prevAngle) => prevAngle + angle);
|
|
34
|
-
};
|
|
35
|
-
const handleMoveUp = () => {
|
|
36
|
-
setMoveDirection({ x: 0, y: -5 });
|
|
37
|
-
};
|
|
38
|
-
const handleMoveDown = () => {
|
|
39
|
-
setMoveDirection({ x: 0, y: 5 });
|
|
40
|
-
};
|
|
41
|
-
const handleMoveLeft = () => {
|
|
42
|
-
setMoveDirection({ x: -5, y: 0 });
|
|
43
|
-
};
|
|
44
|
-
const handleMoveRight = () => {
|
|
45
|
-
setMoveDirection({ x: 5, y: 0 });
|
|
46
|
-
};
|
|
47
|
-
// Handle zoom in
|
|
48
|
-
const zoomIn = () => {
|
|
49
|
-
setScale((prevScale) => {
|
|
50
|
-
const newScale = prevScale + 0.2;
|
|
51
|
-
if (newScale <= 2) {
|
|
52
|
-
// Ensure scale does not exceed the max value
|
|
53
|
-
return newScale;
|
|
54
|
-
}
|
|
55
|
-
return prevScale;
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
// Handle zoom out
|
|
59
|
-
const zoomOut = () => {
|
|
60
|
-
setScale((prevScale) => {
|
|
61
|
-
const newScale = prevScale - 0.2;
|
|
62
|
-
if (newScale >= 0.2) {
|
|
63
|
-
// Ensure scale does not go below the min value
|
|
64
|
-
return newScale;
|
|
65
|
-
}
|
|
66
|
-
return prevScale;
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const handleAspectRatioChange = (ratio, stateName) => {
|
|
70
|
-
setAspectRatio(ratio);
|
|
71
|
-
setActiveState(stateName);
|
|
72
|
-
};
|
|
73
|
-
const handleFileChange = (file) => {
|
|
74
|
-
if (file.type.startsWith("image/")) {
|
|
75
|
-
const reader = new FileReader();
|
|
76
|
-
reader.onloadend = () => {
|
|
77
|
-
setImageSrc(reader.result);
|
|
78
|
-
setFileName((prev) => prev || file.name);
|
|
79
|
-
};
|
|
80
|
-
reader.readAsDataURL(file);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
alert("Please drop a valid image file.");
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const handleDrop = (event) => {
|
|
87
|
-
event.preventDefault();
|
|
88
|
-
handleFileChange(event.dataTransfer.files[0]);
|
|
89
|
-
};
|
|
90
|
-
const getImagePreview = (state) => {
|
|
91
|
-
const imgSource = croppedImage && activeState === state ? croppedImage : prevImages[state];
|
|
92
|
-
// const imgSource = prevImages[state];
|
|
93
|
-
return imgSource ? (_jsx("div", { className: `
|
|
94
|
-
${state === "first"
|
|
95
|
-
? "relative w-3/5 h-[200px] bg-slate-400"
|
|
96
|
-
: state === "second"
|
|
97
|
-
? "relative w-1/2 h-[220px] bg-slate-400"
|
|
98
|
-
: "relative w-1/3 h-[120px] bg-slate-400"}`, children: _jsx(Image, { src: imgSource || "", alt: `Preview ${state}`, layout: "fill", objectFit: "70vh" }) })) : (_jsx("div", { className: `
|
|
99
|
-
${state === "first"
|
|
100
|
-
? "relative w-3/5 h-[200px] bg-slate-400"
|
|
101
|
-
: state === "second"
|
|
102
|
-
? "relative w-1/2 h-[220px] bg-slate-400"
|
|
103
|
-
: "relative w-1/3 h-[120px] bg-slate-400"}` }));
|
|
104
|
-
};
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
if (croppedImage) {
|
|
107
|
-
if (prevImages.first === null ||
|
|
108
|
-
prevImages.second === null ||
|
|
109
|
-
prevImages.third === null) {
|
|
110
|
-
setPrevImages({
|
|
111
|
-
first: croppedImage,
|
|
112
|
-
second: croppedImage,
|
|
113
|
-
third: croppedImage,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
setPrevImages((prev) => (Object.assign(Object.assign({}, prev), { [activeState]: croppedImage })));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}, [croppedImage]);
|
|
121
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-row gap-2", children: [_jsxs("div", { className: "flex-1", children: [_jsx(Label, { htmlFor: "imageName", children: "Image Name" }), _jsx(Input, { id: "imageName", placeholder: "Enter image name", value: fileName, onChange: (e) => setFileName(e.target.value) })] }), _jsxs("div", { className: "self-end", children: [_jsx(Button, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage1")) === null || _a === void 0 ? void 0 : _a.click(); }, children: _jsx(Upload, {}) }), _jsx(Input, { id: "inputImage1", type: "file", accept: "image/png, image/jpeg", className: "hidden", onChange: (e) => {
|
|
122
|
-
var _a;
|
|
123
|
-
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
124
|
-
if (file && file.type.startsWith("image/")) {
|
|
125
|
-
const reader = new FileReader();
|
|
126
|
-
reader.onloadend = () => {
|
|
127
|
-
setImageSrc(reader.result);
|
|
128
|
-
setFileName((prevFileName) => prevFileName || file.name);
|
|
129
|
-
};
|
|
130
|
-
reader.readAsDataURL(file);
|
|
131
|
-
setPrevImages({
|
|
132
|
-
first: null,
|
|
133
|
-
second: null,
|
|
134
|
-
third: null,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
} })] }), _jsxs("div", { className: "flex-1", children: [_jsx(Label, { htmlFor: "imageDesc", children: "Image Description" }), _jsx(Input, { id: "imageDesc", placeholder: "Describe your image" })] })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx("div", { className: "w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100", style: { height: "70vh" }, onDrop: handleDrop, onDragOver: (e) => e.preventDefault(), children: imageSrc ? (_jsx(NewCropperImg, { imageSrc: imageSrc, onCroppedImage: setCroppedImage, aspectRatio: aspectRatio, rotationAngle: rotationAngle, zoomLevel: scale, moveDirection: moveDirection, currentState: activeState })) : (_jsxs("div", { className: "text-center", children: [_jsx(Label, { htmlFor: "inputImage", children: "Drag and drop an image here" }), _jsxs("div", { className: "mt-4", children: [_jsx(Button, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage")) === null || _a === void 0 ? void 0 : _a.click(); }, children: "Upload Image" }), _jsx(Input, { id: "inputImage", type: "file", accept: "image/png, image/jpeg", className: "hidden", onChange: (e) => {
|
|
138
|
-
var _a;
|
|
139
|
-
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
140
|
-
if (file) {
|
|
141
|
-
handleFileChange(file);
|
|
142
|
-
}
|
|
143
|
-
} })] })] })) }), _jsxs("div", { className: "w-2/5 flex flex-col gap-2", children: [_jsx("h3", { children: "Landscape" }), getImagePreview("first"), _jsx("h3", { children: "Potrait" }), getImagePreview("second"), _jsx("h3", { children: "Icon" }), getImagePreview("third")] })] }), _jsxs("div", { className: "flex flex-row gap-1", children: [_jsxs("div", { className: "w-3/5 flex flex-row justify-between", children: [_jsxs("div", { children: [_jsx(Button, { variant: "outline", onClick: () => handleAspectRatioChange(4 / 3, "first"), children: _jsx(ImageIcon, {}) }), _jsx(Button, { variant: "outline", onClick: () => handleAspectRatioChange(3 / 4, "second"), children: _jsx(FileImage, {}) }), _jsx(Button, { variant: "outline", onClick: () => handleAspectRatioChange(1 / 1, "third"), children: _jsx(Square, {}) })] }), _jsxs("div", { children: [_jsx(Button, { onClick: () => rotateImage(90), variant: "outline", children: _jsx(RotateCw, {}) }), _jsx(Button, { onClick: () => rotateImage(-90), variant: "outline", children: _jsx(RotateCcw, {}) })] }), _jsxs("div", { children: [_jsx(Button, { onClick: () => zoomIn(), variant: "outline", children: _jsx(ZoomIn, {}) }), _jsx(Button, { onClick: () => zoomOut(), variant: "outline", children: _jsx(ZoomOut, {}) })] }), _jsxs("div", { children: [_jsx(Button, { onClick: handleMoveUp, variant: "outline", children: _jsx(ArrowUp, {}) }), _jsx(Button, { onClick: handleMoveDown, variant: "outline", children: _jsx(ArrowDown, {}) }), _jsx(Button, { onClick: handleMoveLeft, variant: "outline", children: _jsx(ArrowLeft, {}) }), _jsx(Button, { onClick: handleMoveRight, variant: "outline", children: _jsx(ArrowRight, {}) })] })] }), _jsx("div", { className: "w-2/5 flex flex-row-reverse", children: _jsx(Button, { onClick: handleImageSubmit, children: "Save" }) })] })] }));
|
|
144
|
-
};
|
|
145
|
-
export const NewImageForm = memo(NewImageFormComponent);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
onNewFileUpload?: (...args: any) => void;
|
|
3
|
-
}
|
|
4
|
-
declare function CropperFormComponent({ onNewFileUpload }: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare const CropperForm: import("react").MemoExoticComponent<typeof CropperFormComponent>;
|
|
6
|
-
export {};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Input } from '../../../shadcn/input';
|
|
3
|
-
import { Label } from '../../../shadcn/label';
|
|
4
|
-
import { ToggleGroup, ToggleGroupItem } from '../../../shadcn/toggle-group';
|
|
5
|
-
import { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, FileImage, ImageIcon, RotateCcw, RotateCw, Square, ZoomIn, ZoomOut } from 'lucide-react';
|
|
6
|
-
import { memo, useEffect, useState } from 'react';
|
|
7
|
-
import { ImageCropper } from '../image-cropper';
|
|
8
|
-
import Image from 'next/image';
|
|
9
|
-
import { AspectRatio } from '../../../shadcn/aspect-ratio';
|
|
10
|
-
import { TextButton } from '../../buttons';
|
|
11
|
-
import { toast } from 'sonner';
|
|
12
|
-
import { FileInput } from '../../file-input';
|
|
13
|
-
import { useImageCropper } from '..';
|
|
14
|
-
const stateWiseAspectRatio = {
|
|
15
|
-
landscape: 4 / 3,
|
|
16
|
-
potrait: 3 / 4,
|
|
17
|
-
icon: 1 / 1
|
|
18
|
-
};
|
|
19
|
-
function CropperFormComponent({ onNewFileUpload }) {
|
|
20
|
-
const { originalImage, setOriginalImage, aspectRatioWiseImages, setAspectRatioWiseImages } = useImageCropper();
|
|
21
|
-
const [croppedImage, setCroppedImage] = useState(null);
|
|
22
|
-
const [activeState, setActiveState] = useState();
|
|
23
|
-
const [rotationAngle, setRotationAngle] = useState(0);
|
|
24
|
-
const [scale, setScale] = useState(1);
|
|
25
|
-
const [moveDirection, setMoveDirection] = useState({
|
|
26
|
-
x: 0,
|
|
27
|
-
y: 0,
|
|
28
|
-
});
|
|
29
|
-
const [imageSrc, setImageSrc] = useState(null);
|
|
30
|
-
const handleDrop = (event) => {
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
handleFileChange(event.dataTransfer.files[0]);
|
|
33
|
-
};
|
|
34
|
-
const handleFileChange = (file) => {
|
|
35
|
-
var _a;
|
|
36
|
-
if (typeof file === "string") {
|
|
37
|
-
setImageSrc(file);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
if ((_a = file === null || file === void 0 ? void 0 : file.type) === null || _a === void 0 ? void 0 : _a.startsWith("image/")) {
|
|
41
|
-
onNewFileUpload === null || onNewFileUpload === void 0 ? void 0 : onNewFileUpload();
|
|
42
|
-
const reader = new FileReader();
|
|
43
|
-
reader.onloadend = () => {
|
|
44
|
-
setImageSrc(reader.result);
|
|
45
|
-
setActiveState(undefined);
|
|
46
|
-
};
|
|
47
|
-
reader.readAsDataURL(file);
|
|
48
|
-
setOriginalImage(Object.assign(Object.assign({}, originalImage), { image: file, name: file.name }));
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
toast.error("Please select a valid image file.");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (originalImage.image) {
|
|
57
|
-
handleFileChange(originalImage.image);
|
|
58
|
-
}
|
|
59
|
-
}, [originalImage.image]);
|
|
60
|
-
const getImagePreview = (state) => {
|
|
61
|
-
const imgSource = croppedImage && activeState === state ? croppedImage : aspectRatioWiseImages[state];
|
|
62
|
-
return (_jsxs(_Fragment, { children: [_jsx("h3", { className: 'mb-3', children: state }), _jsx(AspectRatio, { ratio: stateWiseAspectRatio[state], className: 'bg-muted', children: imgSource &&
|
|
63
|
-
_jsx(Image, { src: imgSource || "", alt: `Preview ${state}`, fill: true }) })] }));
|
|
64
|
-
};
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (croppedImage) {
|
|
67
|
-
if (activeState) {
|
|
68
|
-
setAspectRatioWiseImages(Object.assign(Object.assign({}, aspectRatioWiseImages), { [activeState]: croppedImage }));
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
setAspectRatioWiseImages({
|
|
72
|
-
landscape: croppedImage,
|
|
73
|
-
potrait: croppedImage,
|
|
74
|
-
icon: croppedImage
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, [croppedImage]);
|
|
79
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: 'flex flex-col gap-3 h-full overflow-auto', children: [_jsxs("div", { className: 'flex flex-col lg:flex-row gap-3 justify-between', children: [_jsxs("div", { className: 'w-full flex flex-col gap-4', children: [_jsx(Label, { htmlFor: "imageName", children: "Image Name" }), _jsx(FileInput, { id: "inputImage", accept: "image/*", fileNamePlaceholder: "Enter image name", fileName: (originalImage === null || originalImage === void 0 ? void 0 : originalImage.name) || "", onChange: (e) => {
|
|
80
|
-
var _a;
|
|
81
|
-
const file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
82
|
-
if (file) {
|
|
83
|
-
handleFileChange(file);
|
|
84
|
-
}
|
|
85
|
-
}, onFileNameChange: (e) => {
|
|
86
|
-
setOriginalImage(Object.assign(Object.assign({}, originalImage), { name: e.target.value }));
|
|
87
|
-
} })] }), _jsxs("div", { className: 'w-full flex flex-col gap-4', children: [_jsx(Label, { htmlFor: "imageDescription", children: "Image Description" }), _jsx(Input, { id: "imageDescription", placeholder: "Enter image Description", value: (originalImage === null || originalImage === void 0 ? void 0 : originalImage.description) || "", onChange: (e) => setOriginalImage(Object.assign(Object.assign({}, originalImage), { description: e.target.value })) })] })] }), _jsxs("div", { className: 'flex flex-col lg:flex-row gap-3', children: [_jsxs("div", { className: 'flex-grow flex flex-col gap-3', children: [_jsxs("div", { children: [_jsx("h3", { className: 'mb-3', children: "Original Image" }), _jsx(AspectRatio, { ratio: 4 / 3, className: 'flex justify-center items-center bg-muted text-muted-foreground', onDrop: handleDrop, onDragOver: (e) => e.preventDefault(), children: imageSrc ?
|
|
88
|
-
_jsx(ImageCropper, { src: imageSrc, onCroppedImage: setCroppedImage, aspectRatio: stateWiseAspectRatio[activeState || "icon"], rotationAngle: rotationAngle, zoomLevel: scale, moveDirection: moveDirection })
|
|
89
|
-
:
|
|
90
|
-
_jsxs("div", { className: "text-center", children: [_jsx(Label, { htmlFor: "inputImage", children: "Drag and drop an image here" }), _jsx("div", { className: "mt-3", children: _jsx(TextButton, { variant: "outline", onClick: () => { var _a; return (_a = document.getElementById("inputImage")) === null || _a === void 0 ? void 0 : _a.click(); }, children: "Browse Image" }) })] }) })] }), _jsxs("div", { className: "flex flex-col lg:flex-row gap-3 justify-between", children: [_jsx("div", { children: _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: activeState, onValueChange: (value) => setActiveState(value), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "landscape", children: _jsx(ImageIcon, {}) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x-0", value: "potrait", children: _jsx(FileImage, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none', value: "icon", children: _jsx(Square, {}) })] }) }), _jsxs("div", { className: 'flex flex-col lg:flex-row gap-3 justify-between', children: [_jsxs(ToggleGroup, { type: "single", variant: 'outline', value: "", onValueChange: (value) => setRotationAngle(parseInt(value)), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "90", children: _jsx(RotateCw, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none border-s-0', value: "-90", children: _jsx(RotateCcw, {}) })] }), _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: '', children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "up", onClick: () => setMoveDirection({ x: 0, y: -5 }), children: _jsx(ArrowUp, {}) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x-0", value: "down", onClick: () => setMoveDirection({ x: 0, y: 5 }), children: _jsx(ArrowDown, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-none border-e-0', value: "left", onClick: () => setMoveDirection({ x: -5, y: 0 }), children: _jsx(ArrowLeft, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none', value: "right", onClick: () => setMoveDirection({ x: 5, y: 0 }), children: _jsx(ArrowRight, {}) })] }), _jsxs(ToggleGroup, { type: "single", variant: 'outline', value: "", onValueChange: (value) => setScale(pre => pre + parseFloat(value)), children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "0.1", children: _jsx(ZoomIn, {}) }), _jsx(ToggleGroupItem, { className: 'rounded-s-none border-s-0', value: "-0.1", children: _jsx(ZoomOut, {}) })] })] })] })] }), _jsxs("div", { className: "flex flex-row lg:flex-col gap-3 w-full lg:w-48", children: [_jsx("div", { className: 'w-5/5', children: getImagePreview("landscape") }), _jsx("div", { className: 'w-4/5', children: getImagePreview("potrait") }), _jsx("div", { className: 'w-3/5', children: getImagePreview("icon") })] })] })] }) }));
|
|
91
|
-
}
|
|
92
|
-
export const CropperForm = memo(CropperFormComponent);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AspectRatioWiseImagesProps, OriginalImageProps } from '..';
|
|
2
|
-
export declare function CropperFormWithModal({ open, onOpenChange, onCropperChange }: Readonly<{
|
|
3
|
-
open: boolean;
|
|
4
|
-
onOpenChange: (open: boolean) => void;
|
|
5
|
-
onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
6
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '../../../shadcn/dialog';
|
|
3
|
-
import { CropperForm } from '../cropper-form';
|
|
4
|
-
import { TextButton } from '../../buttons';
|
|
5
|
-
import { useImageCropper } from '..';
|
|
6
|
-
export function CropperFormWithModal({ open, onOpenChange, onCropperChange }) {
|
|
7
|
-
const { originalImage, aspectRatioWiseImages } = useImageCropper();
|
|
8
|
-
return (_jsx(Dialog, { modal: true, open: open, onOpenChange: (isOpen) => {
|
|
9
|
-
onOpenChange(isOpen);
|
|
10
|
-
}, children: _jsxs(DialogContent, { className: "max-w-full lg:max-w-5xl max-h-full overflow-auto", children: [_jsx(DialogHeader, { children: _jsx(DialogTitle, { children: "Image to upload" }) }), _jsx(CropperForm, {}), _jsx(DialogFooter, { children: _jsx(TextButton, { onClick: () => {
|
|
11
|
-
onCropperChange(originalImage, aspectRatioWiseImages);
|
|
12
|
-
onOpenChange(false);
|
|
13
|
-
}, children: "Save Changes" }) })] }) }));
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "cropperjs/dist/cropper.css";
|
|
3
|
-
export interface CropperImgProps {
|
|
4
|
-
src: string | undefined;
|
|
5
|
-
onCroppedImage: (imageUrl: string) => void;
|
|
6
|
-
aspectRatio: number;
|
|
7
|
-
rotationAngle: number;
|
|
8
|
-
zoomLevel: number;
|
|
9
|
-
moveDirection: {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export declare const ImageCropper: React.NamedExoticComponent<CropperImgProps>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { CropperUploadImagesInfoProps } from './utils';
|
|
3
|
-
export interface ImageCropperContextProps {
|
|
4
|
-
originalImage: OriginalImageProps;
|
|
5
|
-
setOriginalImage: (originalImage: OriginalImageProps) => void;
|
|
6
|
-
aspectRatioWiseImages: AspectRatioWiseImagesProps;
|
|
7
|
-
setAspectRatioWiseImages: (aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface AspectRatioWiseImagesProps {
|
|
10
|
-
landscape: string | null;
|
|
11
|
-
potrait: string | null;
|
|
12
|
-
icon: string | null;
|
|
13
|
-
}
|
|
14
|
-
export interface OriginalImageProps {
|
|
15
|
-
image: string | File | null;
|
|
16
|
-
name?: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ImageCropperProps {
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
uploadedImages: CropperUploadImagesInfoProps | null;
|
|
22
|
-
onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
|
|
23
|
-
modalOpen?: boolean;
|
|
24
|
-
onModalOpenChange?: (open: boolean) => void;
|
|
25
|
-
}
|
|
26
|
-
export declare function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }: ImageCropperProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const useImageCropper: () => ImageCropperContextProps;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useEffect, useState } from 'react';
|
|
4
|
-
import { CropperFormWithModal } from './cropper-form-with-modal';
|
|
5
|
-
import { uploadedImagesToCropperImgObj } from './utils';
|
|
6
|
-
const ImageCropperContext = createContext(undefined);
|
|
7
|
-
export function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }) {
|
|
8
|
-
const [aspectRatioWiseImages, setAspectRatioWiseImages] = useState({
|
|
9
|
-
landscape: null,
|
|
10
|
-
potrait: null,
|
|
11
|
-
icon: null
|
|
12
|
-
});
|
|
13
|
-
const [originalImage, setOriginalImage] = useState({
|
|
14
|
-
image: null,
|
|
15
|
-
name: "",
|
|
16
|
-
description: "",
|
|
17
|
-
});
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
async function updateCropperImages() {
|
|
20
|
-
if (!uploadedImages)
|
|
21
|
-
return; // Prevent unnecessary processing
|
|
22
|
-
try {
|
|
23
|
-
const res = await uploadedImagesToCropperImgObj(uploadedImages);
|
|
24
|
-
if (res) {
|
|
25
|
-
// Check if state is different before updating
|
|
26
|
-
setOriginalImage((prev) => JSON.stringify(prev) === JSON.stringify(res.originalImage) ? prev : res.originalImage);
|
|
27
|
-
setAspectRatioWiseImages((prev) => JSON.stringify(prev) === JSON.stringify(res.aspectRatioWiseImages) ? prev : res.aspectRatioWiseImages);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
console.error("Error processing uploaded images:", error);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
updateCropperImages();
|
|
35
|
-
}, [uploadedImages]); // Runs only when `uploadedImages` changes
|
|
36
|
-
return (_jsxs(ImageCropperContext.Provider, { value: {
|
|
37
|
-
originalImage,
|
|
38
|
-
setOriginalImage,
|
|
39
|
-
aspectRatioWiseImages,
|
|
40
|
-
setAspectRatioWiseImages
|
|
41
|
-
}, children: [children, modalOpen && onModalOpenChange && _jsx(CropperFormWithModal, { open: modalOpen, onOpenChange: onModalOpenChange, onCropperChange: onCropperChange })] }));
|
|
42
|
-
}
|
|
43
|
-
export const useImageCropper = () => {
|
|
44
|
-
const context = useContext(ImageCropperContext);
|
|
45
|
-
if (!context) {
|
|
46
|
-
throw new Error("useImageCropper must be used within a ImageCropperProvider");
|
|
47
|
-
}
|
|
48
|
-
return context;
|
|
49
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AspectRatioWiseImagesProps, OriginalImageProps } from "..";
|
|
2
|
-
import { FileinfoProps } from "../../../utils/api/file-upload/type";
|
|
3
|
-
export interface CropperUploadImagesInfoProps {
|
|
4
|
-
originalImageInfo?: FileinfoProps | null;
|
|
5
|
-
imageName?: string;
|
|
6
|
-
imageDescription?: string;
|
|
7
|
-
landscapeImageInfo?: FileinfoProps | null;
|
|
8
|
-
portaitImageInfo?: FileinfoProps | null;
|
|
9
|
-
iconImageInfo?: FileinfoProps | null;
|
|
10
|
-
}
|
|
11
|
-
export interface UploadedImagesToCropperImgObjProps {
|
|
12
|
-
originalImage: OriginalImageProps;
|
|
13
|
-
aspectRatioWiseImages: AspectRatioWiseImagesProps;
|
|
14
|
-
}
|
|
15
|
-
export declare function imageCropperFilesUpload(originalImage: OriginalImageProps, aspectRatioWiseImages?: AspectRatioWiseImagesProps, resourceId?: string): Promise<CropperUploadImagesInfoProps | null>;
|
|
16
|
-
export declare function uploadedImagesToCropperImgObj(uploadedImages: CropperUploadImagesInfoProps | null): Promise<UploadedImagesToCropperImgObjProps | null>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { base64FileUpload, singleFileUpload, } from "../../../utils/api/file-upload";
|
|
2
|
-
import { getResourceUrl } from "../../../utils/actions/common/utils";
|
|
3
|
-
export async function imageCropperFilesUpload(originalImage, aspectRatioWiseImages, resourceId) {
|
|
4
|
-
if (!originalImage.image) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
const originalImageInfo = await singleFileUpload(originalImage.image, resourceId);
|
|
8
|
-
const cropperUploadImagesInfo = {
|
|
9
|
-
originalImageInfo: originalImageInfo,
|
|
10
|
-
imageName: originalImage.name,
|
|
11
|
-
imageDescription: originalImage.description,
|
|
12
|
-
landscapeImageInfo: null,
|
|
13
|
-
portaitImageInfo: null,
|
|
14
|
-
iconImageInfo: null,
|
|
15
|
-
};
|
|
16
|
-
if (aspectRatioWiseImages) {
|
|
17
|
-
if (aspectRatioWiseImages.landscape) {
|
|
18
|
-
try {
|
|
19
|
-
cropperUploadImagesInfo["landscapeImageInfo"] = await base64FileUpload(aspectRatioWiseImages.landscape, originalImage.name + "_L.webp", "image/webp");
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
console.error(error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (aspectRatioWiseImages.potrait) {
|
|
26
|
-
try {
|
|
27
|
-
cropperUploadImagesInfo["portaitImageInfo"] = await base64FileUpload(aspectRatioWiseImages.potrait, originalImage.name + "_P.webp", "image/webp");
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
console.error(error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (aspectRatioWiseImages.icon) {
|
|
34
|
-
try {
|
|
35
|
-
cropperUploadImagesInfo["iconImageInfo"] = await base64FileUpload(aspectRatioWiseImages.icon, originalImage.name + "_I.webp", "image/webp");
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
console.error(error);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return cropperUploadImagesInfo;
|
|
43
|
-
}
|
|
44
|
-
export async function uploadedImagesToCropperImgObj(uploadedImages) {
|
|
45
|
-
if (!uploadedImages) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
const originalImageUrl = uploadedImages.originalImageInfo
|
|
49
|
-
? await getResourceUrl(uploadedImages.originalImageInfo)
|
|
50
|
-
: null;
|
|
51
|
-
const landscapeImageUrl = uploadedImages.landscapeImageInfo
|
|
52
|
-
? await getResourceUrl(uploadedImages.landscapeImageInfo)
|
|
53
|
-
: null;
|
|
54
|
-
const portaitImageUrl = uploadedImages.portaitImageInfo
|
|
55
|
-
? await getResourceUrl(uploadedImages.portaitImageInfo)
|
|
56
|
-
: null;
|
|
57
|
-
const iconImageUrl = uploadedImages.iconImageInfo
|
|
58
|
-
? await getResourceUrl(uploadedImages.iconImageInfo)
|
|
59
|
-
: null;
|
|
60
|
-
const obj = {
|
|
61
|
-
originalImage: {
|
|
62
|
-
image: originalImageUrl,
|
|
63
|
-
name: uploadedImages.imageName,
|
|
64
|
-
description: uploadedImages.imageDescription,
|
|
65
|
-
},
|
|
66
|
-
aspectRatioWiseImages: {
|
|
67
|
-
landscape: landscapeImageUrl,
|
|
68
|
-
potrait: portaitImageUrl,
|
|
69
|
-
icon: iconImageUrl,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
return obj;
|
|
73
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number;
|
|
4
|
-
className?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface LoadingSpinnerProps extends ISVGProps {
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const LoadingSpinner: ({ size, className, visible, ...props }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { cn } from "../../utils/cn";
|
|
14
|
-
export const LoadingSpinner = (_a) => {
|
|
15
|
-
var { size = 48, className, visible = true } = _a, props = __rest(_a, ["size", "className", "visible"]);
|
|
16
|
-
if (!visible)
|
|
17
|
-
return null;
|
|
18
|
-
return (_jsx("div", { className: "h-full w-full", children: _jsx("div", { className: "absolute inset-0 flex justify-center items-center z-50", children: _jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: size, height: size }, props, { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: cn("animate-spin", className), children: _jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) })) }) }));
|
|
19
|
-
};
|