@dragonmastery/dragoncore-vue 0.0.1
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/LICENSE +75 -0
- package/dist/AppLink-CHMMrSFI.js +54 -0
- package/dist/AppLink-CHMMrSFI.js.map +1 -0
- package/dist/Appearance-BfPdKMXw.js +70 -0
- package/dist/Appearance-BfPdKMXw.js.map +1 -0
- package/dist/Appearance-C3WguxT-.js +3 -0
- package/dist/ChangePasswordPage-Btu5lf-r.js +86 -0
- package/dist/ChangePasswordPage-Btu5lf-r.js.map +1 -0
- package/dist/ChangePasswordPage-mBBuQMkT.js +6 -0
- package/dist/CreateTeamForm-n2ut93vM.js +43 -0
- package/dist/CreateTeamMemberForm-CcH3AxNL.js +43 -0
- package/dist/CreateUserPage-CDrGuW9B.js +6 -0
- package/dist/CreateUserPage-Cmx8xjjv.js +76 -0
- package/dist/CreateUserPage-Cmx8xjjv.js.map +1 -0
- package/dist/CreditBalanceDashboard-DLz0ioP3.js +43 -0
- package/dist/CreditManagement-D3q5S-qc.js +43 -0
- package/dist/CustomerCreateSupportTicketForm-Ci7QYkG-.js +43 -0
- package/dist/CustomerEditSupportTicketForm-Dd5ZB74k.js +159 -0
- package/dist/CustomerEditSupportTicketForm-Dd5ZB74k.js.map +1 -0
- package/dist/CustomerEditSupportTicketForm-lLchVjnw.js +9 -0
- package/dist/CustomerSupportTicketAttachmentsTab-gBrVO97t.js +43 -0
- package/dist/CustomerSupportTicketCustomerNotesTab-D0jhzbOY.js +8 -0
- package/dist/CustomerSupportTicketCustomerNotesTab-D1aa9It7.js +23 -0
- package/dist/CustomerSupportTicketCustomerNotesTab-D1aa9It7.js.map +1 -0
- package/dist/CustomerSupportTicketHistoryTab-BNTf8EZq.js +6 -0
- package/dist/CustomerSupportTicketHistoryTab-CFYN_Sa4.js +17 -0
- package/dist/CustomerSupportTicketHistoryTab-CFYN_Sa4.js.map +1 -0
- package/dist/CustomerSupportTicketList-BkOzFxMP.js +6 -0
- package/dist/CustomerSupportTicketList-C2nUPawb.js +166 -0
- package/dist/CustomerSupportTicketList-C2nUPawb.js.map +1 -0
- package/dist/CustomerSupportTicketParent-2mONd9kL.js +66 -0
- package/dist/CustomerSupportTicketParent-2mONd9kL.js.map +1 -0
- package/dist/CustomerSupportTicketParent-N8ko1yFE.js +7 -0
- package/dist/CustomerSupportTicketSuccess-w_-9NXT4.js +43 -0
- package/dist/CustomerViewSupportTicket-CVwNH0lS.js +11 -0
- package/dist/CustomerViewSupportTicket-tZkxragu.js +363 -0
- package/dist/CustomerViewSupportTicket-tZkxragu.js.map +1 -0
- package/dist/EditTeamForm-BioqiTWE.js +43 -0
- package/dist/EditTeamMemberForm-DCq0Gsn_.js +7 -0
- package/dist/EditTeamMemberForm-ru4WgLz-.js +169 -0
- package/dist/EditTeamMemberForm-ru4WgLz-.js.map +1 -0
- package/dist/EditUserPage-BxJ5QvIM.js +112 -0
- package/dist/EditUserPage-BxJ5QvIM.js.map +1 -0
- package/dist/EditUserPage-XOBuxUxd.js +7 -0
- package/dist/FieldsetSection-CsHN38_o.js +27 -0
- package/dist/FieldsetSection-CsHN38_o.js.map +1 -0
- package/dist/ForgotPassword-CpqvcSFg.js +7 -0
- package/dist/ForgotPassword-CqhenzUG.js +73 -0
- package/dist/ForgotPassword-CqhenzUG.js.map +1 -0
- package/dist/InlineAttachments-I39rOvip.js +1351 -0
- package/dist/InlineAttachments-I39rOvip.js.map +1 -0
- package/dist/LoginForm-AM0qkfbU.js +7 -0
- package/dist/LoginForm-_PZ51Uwe.js +116 -0
- package/dist/LoginForm-_PZ51Uwe.js.map +1 -0
- package/dist/Logout-BMjiqHnS.js +38 -0
- package/dist/Logout-BMjiqHnS.js.map +1 -0
- package/dist/Logout-BfiBjlaH.js +6 -0
- package/dist/NoteList-C0hRPNMO.js +497 -0
- package/dist/NoteList-C0hRPNMO.js.map +1 -0
- package/dist/NotificationEmailsPage-BjRqtW95.js +141 -0
- package/dist/NotificationEmailsPage-BjRqtW95.js.map +1 -0
- package/dist/NotificationEmailsPage-bx-9rg3x.js +7 -0
- package/dist/ResetPassword-BQLkR9TZ.js +43 -0
- package/dist/Signup-CnCcQlB8.js +7 -0
- package/dist/Signup-c2-_yMOM.js +106 -0
- package/dist/Signup-c2-_yMOM.js.map +1 -0
- package/dist/StaffCreateSupportTicketForm-ChVFDJdA.js +43 -0
- package/dist/StaffEditSupportTicketForm-DY1Zkf5k.js +9 -0
- package/dist/StaffEditSupportTicketForm-DuUKuIGg.js +263 -0
- package/dist/StaffEditSupportTicketForm-DuUKuIGg.js.map +1 -0
- package/dist/StaffSupportTicketAttachmentsTab-DpDXsHXP.js +43 -0
- package/dist/StaffSupportTicketCustomerNotesTab-CusqQV2-.js +23 -0
- package/dist/StaffSupportTicketCustomerNotesTab-CusqQV2-.js.map +1 -0
- package/dist/StaffSupportTicketCustomerNotesTab-rbJHJ0_V.js +8 -0
- package/dist/StaffSupportTicketHistoryTab-D24myEm3.js +17 -0
- package/dist/StaffSupportTicketHistoryTab-D24myEm3.js.map +1 -0
- package/dist/StaffSupportTicketHistoryTab-nmVma5vp.js +6 -0
- package/dist/StaffSupportTicketInternalNotesTab-D8HM--dp.js +23 -0
- package/dist/StaffSupportTicketInternalNotesTab-D8HM--dp.js.map +1 -0
- package/dist/StaffSupportTicketInternalNotesTab-DihYd5XI.js +8 -0
- package/dist/StaffSupportTicketList-DelptSmK.js +43 -0
- package/dist/StaffSupportTicketParent-BCrj3ckV.js +7 -0
- package/dist/StaffSupportTicketParent-Cx1buQZw.js +66 -0
- package/dist/StaffSupportTicketParent-Cx1buQZw.js.map +1 -0
- package/dist/StaffSupportTicketSuccess-BYxtY5wZ.js +43 -0
- package/dist/StaffSupportTicketWorkflowTab-BrDDBeK9.js +9 -0
- package/dist/StaffSupportTicketWorkflowTab-DmVTPzxS.js +1234 -0
- package/dist/StaffSupportTicketWorkflowTab-DmVTPzxS.js.map +1 -0
- package/dist/SupportTicketHistoryTab-CLMopA7a.js +220 -0
- package/dist/SupportTicketHistoryTab-CLMopA7a.js.map +1 -0
- package/dist/SupportTicketStatusBadge-YdZzjvkh.js +163 -0
- package/dist/SupportTicketStatusBadge-YdZzjvkh.js.map +1 -0
- package/dist/TeamAttachmentsTab-BxUpTWYh.js +43 -0
- package/dist/TeamHistoryTab-CUCT9MRG.js +5 -0
- package/dist/TeamHistoryTab-gB3H2KZv.js +219 -0
- package/dist/TeamHistoryTab-gB3H2KZv.js.map +1 -0
- package/dist/TeamList-By6pzWm5.js +43 -0
- package/dist/TeamMemberList-CYV9fWEb.js +43 -0
- package/dist/TeamMemberParent-CVvGqpxD.js +43 -0
- package/dist/TeamMembersTab-4gmnP9sD.js +21 -0
- package/dist/TeamMembersTab-4gmnP9sD.js.map +1 -0
- package/dist/TeamMembersTab-CpE9BaCi.js +3 -0
- package/dist/TeamNotesTab-pfXTDhg6.js +23 -0
- package/dist/TeamNotesTab-pfXTDhg6.js.map +1 -0
- package/dist/TeamNotesTab-u4cDC67X.js +8 -0
- package/dist/TeamParent-BxT1KubK.js +43 -0
- package/dist/UserListPage-DsQdH2Sm.js +4 -0
- package/dist/UserListPage-WU56KiWj.js +153 -0
- package/dist/UserListPage-WU56KiWj.js.map +1 -0
- package/dist/UserProfilePage-B73JhjUu.js +7 -0
- package/dist/UserProfilePage-BtLUY1kt.js +125 -0
- package/dist/UserProfilePage-BtLUY1kt.js.map +1 -0
- package/dist/ViewTeam-DzX-obEl.js +43 -0
- package/dist/ViewTeamMember-PF6S_4Pb.js +43 -0
- package/dist/ZiniaContainer-C7c7Vwkh.js +18 -0
- package/dist/ZiniaContainer-C7c7Vwkh.js.map +1 -0
- package/dist/convertToLocalDateTime-D4IoNvRj.js +111 -0
- package/dist/convertToLocalDateTime-D4IoNvRj.js.map +1 -0
- package/dist/creditValueFormatter-DftEzu8d.js +128 -0
- package/dist/creditValueFormatter-DftEzu8d.js.map +1 -0
- package/dist/displayIdFormatter-Dz900Awr.js +13 -0
- package/dist/displayIdFormatter-Dz900Awr.js.map +1 -0
- package/dist/index.d.ts +6068 -0
- package/dist/index.js +45 -0
- package/dist/src-o5fMIo5_.js +6649 -0
- package/dist/src-o5fMIo5_.js.map +1 -0
- package/dist/useBreadcrumbs-DmgSucoe.js +41 -0
- package/dist/useBreadcrumbs-DmgSucoe.js.map +1 -0
- package/dist/useMutation-CFwe7H9j.js +50 -0
- package/dist/useMutation-CFwe7H9j.js.map +1 -0
- package/dist/useQuery-p7oJO7OD.js +107 -0
- package/dist/useQuery-p7oJO7OD.js.map +1 -0
- package/dist/useQueryCache-ByayvZgZ.js +254 -0
- package/dist/useQueryCache-ByayvZgZ.js.map +1 -0
- package/dist/useRpcAuth-BLlRSHy8.js +722 -0
- package/dist/useRpcAuth-BLlRSHy8.js.map +1 -0
- package/package.json +62 -0
- package/src/daisyui.css +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineAttachments-I39rOvip.js","names":["files: Attachment[]","queueItem: QueueItem"],"sources":["../src/components/ConfirmDialog.vue","../src/components/ImageModal.vue","../src/slices/support_ticket/shared/InlineAttachments.vue"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n :class=\"['modal', { 'modal-open': isOpen }]\"\n @click=\"handleBackdropClick\"\n >\n <div class=\"modal-box\" @click.stop>\n <h3 class=\"font-bold text-lg mb-4\">{{ title }}</h3>\n <div class=\"py-4\">\n <slot name=\"message\">\n <p>{{ message }}</p>\n </slot>\n </div>\n <div class=\"modal-action\">\n <button\n class=\"btn btn-outline\"\n @click.prevent=\"handleCancel\"\n :disabled=\"isProcessing\"\n type=\"button\"\n >\n {{ cancelText }}\n </button>\n <button\n class=\"btn\"\n :class=\"confirmButtonClass\"\n @click.prevent=\"handleConfirm\"\n :disabled=\"isProcessing\"\n type=\"button\"\n >\n {{ isProcessing ? processingText : confirmText }}\n </button>\n </div>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\n\ninterface Props {\n modelValue: boolean;\n title?: string;\n message?: string;\n confirmText?: string;\n cancelText?: string;\n processingText?: string;\n confirmButtonClass?: string;\n isProcessing?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n title: 'Confirm',\n message: 'Are you sure?',\n confirmText: 'Confirm',\n cancelText: 'Cancel',\n processingText: 'Processing...',\n confirmButtonClass: 'btn-primary',\n isProcessing: false,\n});\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: boolean];\n confirm: [];\n cancel: [];\n}>();\n\nconst dialogRef = ref<HTMLDialogElement | null>(null);\nconst isOpen = ref(props.modelValue);\n\nwatch(\n () => props.modelValue,\n (newValue) => {\n isOpen.value = newValue;\n if (newValue && dialogRef.value) {\n dialogRef.value.showModal();\n } else if (dialogRef.value) {\n dialogRef.value.close();\n }\n },\n { immediate: true },\n);\n\nwatch(isOpen, (newValue) => {\n if (newValue && dialogRef.value) {\n dialogRef.value.showModal();\n } else if (dialogRef.value) {\n dialogRef.value.close();\n }\n});\n\nconst handleConfirm = () => {\n emit('confirm');\n};\n\nconst handleCancel = () => {\n isOpen.value = false;\n emit('update:modelValue', false);\n emit('cancel');\n};\n\nconst handleBackdropClick = (event: MouseEvent) => {\n // Close when clicking the backdrop (modal itself)\n if (event.target === dialogRef.value) {\n handleCancel();\n }\n};\n</script>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"modal\"\n :class=\"{ 'modal-open': isOpen }\"\n @click=\"handleBackdropClick\"\n @keydown=\"handleKeydown\"\n >\n <div class=\"modal-box w-full max-w-full h-full max-h-full p-0 flex flex-col bg-base-100\">\n <!-- Header -->\n <div\n class=\"flex items-center justify-between p-3 sm:p-4 border-b border-base-300 flex-shrink-0 bg-base-100/95 backdrop-blur\"\n >\n <div class=\"flex-1 min-w-0 mr-2\">\n <h3 class=\"font-semibold text-sm sm:text-base truncate\">\n {{ imageName }}\n </h3>\n <p\n v-if=\"imageIndex !== null && totalImages !== null\"\n class=\"text-xs text-base-content/60 mt-0.5\"\n >\n {{ imageIndex + 1 }} / {{ totalImages }}\n </p>\n </div>\n <div class=\"flex items-center gap-1 sm:gap-2 flex-shrink-0\">\n <!-- Navigation buttons (if multiple images) -->\n <button\n v-if=\"showNavigation && imageIndex !== null && imageIndex > 0\"\n @click.prevent=\"goToPrevious\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n title=\"Previous image\"\n aria-label=\"Previous image\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-5 w-5\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M15 19l-7-7 7-7\"\n />\n </svg>\n </button>\n <button\n v-if=\"showNavigation && imageIndex !== null && imageIndex < (totalImages || 0) - 1\"\n @click.prevent=\"goToNext\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n title=\"Next image\"\n aria-label=\"Next image\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-5 w-5\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M9 5l7 7-7 7\"\n />\n </svg>\n </button>\n <!-- Download button -->\n <button\n v-if=\"props.onDownload\"\n @click.prevent=\"handleDownload\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n title=\"Download\"\n aria-label=\"Download image\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-5 w-5\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4\"\n />\n </svg>\n </button>\n <!-- Close button -->\n <button\n @click.prevent=\"handleClose\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n title=\"Close\"\n aria-label=\"Close modal\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-5 w-5\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n </div>\n </div>\n\n <!-- Image container -->\n <div\n ref=\"imageContainerRef\"\n class=\"flex-1 flex items-center justify-center overflow-hidden bg-base-200 relative\"\n >\n <!-- Loading state -->\n <div v-if=\"isLoading\" class=\"absolute inset-0 flex items-center justify-center\">\n <span class=\"loading loading-spinner loading-lg\"></span>\n </div>\n\n <!-- Error state -->\n <div\n v-if=\"hasError\"\n class=\"absolute inset-0 flex flex-col items-center justify-center p-4 text-center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-12 w-12 text-error mb-2\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n <p class=\"text-sm text-base-content/70\">Failed to load image</p>\n </div>\n\n <!-- Image -->\n <img\n v-if=\"imageSrc && !hasError\"\n ref=\"imageRef\"\n :src=\"imageSrc\"\n :alt=\"imageName\"\n class=\"max-w-full max-h-full object-contain\"\n :class=\"{\n 'transition-transform duration-300 ease-out':\n !isDragging && !isPinching && !isResetting,\n }\"\n :style=\"imageStyle\"\n @load=\"handleImageLoad\"\n @error=\"handleImageError\"\n @dblclick=\"resetZoom\"\n @touchstart.stop=\"handleImageTouchStart\"\n @touchmove.stop=\"handleImageTouchMove\"\n @touchend.stop=\"handleImageTouchEnd\"\n />\n\n <!-- Zoom controls -->\n <div\n v-if=\"imageSrc && !hasError\"\n class=\"zoom-controls absolute bottom-4 left-1/2 transform -translate-x-1/2 flex gap-1 sm:gap-2 bg-base-100/90 backdrop-blur rounded-lg p-1.5 sm:p-2 shadow-lg z-10\"\n @touchstart.stop\n @touchmove.stop\n @touchend.stop\n @click.stop\n >\n <button\n @click.prevent=\"zoomOut\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n :disabled=\"scale <= minScale\"\n title=\"Zoom out\"\n aria-label=\"Zoom out\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7\"\n />\n </svg>\n </button>\n <button\n @click.prevent=\"resetZoom\"\n class=\"text-xs flex items-center px-2 text-base-content/70 hover:text-base-content hover:bg-base-200 rounded transition-colors cursor-pointer\"\n type=\"button\"\n title=\"Reset zoom to 100%\"\n aria-label=\"Reset zoom to 100%\"\n >\n {{ Math.round(scale * 100) }}%\n </button>\n <button\n @click.prevent=\"zoomIn\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n :disabled=\"scale >= maxScale\"\n title=\"Zoom in\"\n aria-label=\"Zoom in\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v6m3-3H7\"\n />\n </svg>\n </button>\n <button\n @click.prevent=\"rotateImage\"\n class=\"btn btn-sm btn-circle btn-ghost\"\n type=\"button\"\n title=\"Rotate image\"\n aria-label=\"Rotate image\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n fill=\"none\"\n class=\"size-6\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M18.363 5.634A8.997 9.002 29.494 0 0 7.5 4.206 8.997 9.002 29.494 0 0 3.306 14.33 8.997 9.002 29.494 0 0 11.996 21a8.997 9.002 29.494 0 0 8.694-6.673m-2.327-8.693L20.87 8.14m.017-4.994v5.015m0 0h-5.013\"\n ></path>\n </svg>\n </button>\n </div>\n </div>\n </div>\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button type=\"button\" @click.prevent=\"handleClose\">close</button>\n </form>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue';\n\ninterface Props {\n isOpen: boolean;\n imageSrc?: string;\n imageName?: string;\n imageIndex?: number | null;\n totalImages?: number | null;\n onDownload?: () => void;\n onPrevious?: () => void;\n onNext?: () => void;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n imageSrc: '',\n imageName: '',\n imageIndex: null,\n totalImages: null,\n onDownload: undefined,\n onPrevious: undefined,\n onNext: undefined,\n});\n\nconst emit = defineEmits<{\n close: [];\n}>();\n\nconst dialogRef = ref<HTMLDialogElement | null>(null);\nconst imageRef = ref<HTMLImageElement | null>(null);\nconst imageContainerRef = ref<HTMLDivElement | null>(null);\nconst isOpen = ref(props.isOpen);\nconst isLoading = ref(false);\nconst hasError = ref(false);\n\n// Zoom and pan state\nconst scale = ref(1);\nconst translateX = ref(0);\nconst translateY = ref(0);\nconst rotation = ref(0); // Rotation in degrees (can go beyond 360 for smooth transitions)\nconst minScale = 0.5;\nconst maxScale = 5;\nconst zoomStep = 0.05; // Flat 5% increments (0.05 = 5%)\n\n// Animation state\nconst isDragging = ref(false);\nconst isPinching = ref(false);\nconst isResetting = ref(false); // Track when resetting to disable transition\n\n// Touch state for pinch zoom and pan\nconst touchState = ref<{\n type: 'pinch' | 'pan';\n initialDistance?: number;\n initialScale?: number;\n initialTranslateX?: number;\n initialTranslateY?: number;\n initialTouches?: Touch[];\n lastPanX?: number;\n lastPanY?: number;\n} | null>(null);\n\n// Mouse drag state for panning\nconst mouseDragState = ref<{\n isDragging: boolean;\n startX: number;\n startY: number;\n startTranslateX: number;\n startTranslateY: number;\n} | null>(null);\n\n// Mobile detection\nconst isMobile = ref(false);\n\nconst imageStyle = computed(() => ({\n transform: `scale(${scale.value}) translate(${translateX.value}px, ${translateY.value}px) rotate(${rotation.value}deg)`,\n cursor: mouseDragState.value?.isDragging ? 'grabbing' : scale.value > 1 ? 'grab' : 'default',\n touchAction: 'none' as const, // Prevent default touch behaviors\n userSelect: 'none' as const, // Prevent text selection during drag\n willChange: isDragging.value || isPinching.value ? 'transform' : 'auto', // Optimize for animations\n}));\n\nconst showNavigation = computed(() => {\n return (\n props.totalImages !== null && props.totalImages > 1 && (props.onPrevious || props.onNext)\n );\n});\n\n// Watch for modal open/close\nwatch(\n () => props.isOpen,\n (newValue) => {\n isOpen.value = newValue;\n if (newValue && dialogRef.value) {\n dialogRef.value.showModal();\n // Reset zoom and rotation when opening\n isResetting.value = true;\n scale.value = 1;\n translateX.value = 0;\n translateY.value = 0;\n rotation.value = 0;\n touchState.value = null;\n mouseDragState.value = null;\n isDragging.value = false;\n isPinching.value = false;\n isLoading.value = true;\n hasError.value = false;\n // Re-enable transitions after modal opens\n nextTick(() => {\n setTimeout(() => {\n isResetting.value = false;\n }, 50);\n });\n\n // Add event listeners with passive: false only when modal is open\n nextTick(() => {\n if (imageContainerRef.value) {\n imageContainerRef.value.addEventListener('wheel', handleWheel, {\n passive: false,\n });\n imageContainerRef.value.addEventListener('mousedown', handleMouseDown);\n // Container-level touch handlers (for areas outside the image)\n imageContainerRef.value.addEventListener('touchstart', handleTouchStart, {\n passive: false,\n });\n imageContainerRef.value.addEventListener('touchmove', handleTouchMove, {\n passive: false,\n });\n imageContainerRef.value.addEventListener('touchend', handleTouchEnd, {\n passive: true,\n });\n imageContainerRef.value.addEventListener('touchcancel', handleTouchEnd, {\n passive: true,\n });\n }\n // Add global mouse listeners for drag\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n });\n } else if (dialogRef.value) {\n dialogRef.value.close();\n\n // Remove event listeners when modal closes\n if (imageContainerRef.value) {\n imageContainerRef.value.removeEventListener('wheel', handleWheel);\n imageContainerRef.value.removeEventListener('mousedown', handleMouseDown);\n imageContainerRef.value.removeEventListener('touchstart', handleTouchStart);\n imageContainerRef.value.removeEventListener('touchmove', handleTouchMove);\n imageContainerRef.value.removeEventListener('touchend', handleTouchEnd);\n imageContainerRef.value.removeEventListener('touchcancel', handleTouchEnd);\n }\n // Remove global mouse listeners\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n // Clear states when modal closes\n touchState.value = null;\n mouseDragState.value = null;\n }\n },\n { immediate: true },\n);\n\n// Watch for image source changes\nwatch(\n () => props.imageSrc,\n () => {\n if (props.isOpen && props.imageSrc) {\n isLoading.value = true;\n hasError.value = false;\n // Reset zoom and rotation when image changes\n scale.value = 1;\n translateX.value = 0;\n translateY.value = 0;\n rotation.value = 0;\n }\n },\n);\n\n// Watch for image index changes (navigation)\nwatch(\n () => props.imageIndex,\n () => {\n if (props.isOpen) {\n resetZoom();\n isLoading.value = true;\n hasError.value = false;\n }\n },\n);\n\n// Mobile detection\nonMounted(() => {\n isMobile.value = window.innerWidth < 768;\n window.addEventListener('resize', () => {\n isMobile.value = window.innerWidth < 768;\n });\n});\n\n// Keyboard navigation\nconst handleKeydown = (event: KeyboardEvent) => {\n if (!props.isOpen) return;\n\n switch (event.key) {\n case 'Escape':\n handleClose();\n break;\n case 'ArrowLeft':\n if (showNavigation.value && props.imageIndex !== null && props.imageIndex > 0) {\n event.preventDefault();\n goToPrevious();\n }\n break;\n case 'ArrowRight':\n if (\n showNavigation.value &&\n props.imageIndex !== null &&\n props.imageIndex < (props.totalImages || 0) - 1\n ) {\n event.preventDefault();\n goToNext();\n }\n break;\n case '+':\n case '=':\n event.preventDefault();\n zoomIn();\n break;\n case '-':\n event.preventDefault();\n zoomOut();\n break;\n case '0':\n event.preventDefault();\n resetZoom();\n break;\n }\n};\n\n// Zoom functions - using flat 5% increments\nconst zoomIn = () => {\n if (scale.value < maxScale) {\n const newScale = scale.value + zoomStep;\n scale.value = Math.min(maxScale, newScale);\n }\n};\n\nconst zoomOut = () => {\n if (scale.value > minScale) {\n const newScale = scale.value - zoomStep;\n scale.value = Math.max(minScale, newScale);\n // Reset pan if zoomed out to fit\n if (scale.value <= 1) {\n translateX.value = 0;\n translateY.value = 0;\n }\n }\n};\n\nconst resetZoom = () => {\n // Disable transitions to prevent counter-clockwise animation\n isResetting.value = true;\n\n scale.value = 1;\n translateX.value = 0;\n translateY.value = 0;\n rotation.value = 0;\n\n touchState.value = null;\n mouseDragState.value = null;\n isDragging.value = false;\n isPinching.value = false;\n\n // Re-enable transitions after reset\n nextTick(() => {\n setTimeout(() => {\n isResetting.value = false;\n }, 50);\n });\n};\n\nconst rotateImage = () => {\n // Rotate 90 degrees clockwise\n // Don't use modulo - let it accumulate so we can control reset direction\n rotation.value = rotation.value + 90;\n};\n\n// Mouse wheel zoom - fixed to zoom towards cursor with smooth updates\nconst handleWheel = (event: WheelEvent) => {\n if (!imageRef.value || !props.isOpen) return;\n\n // Always prevent default to avoid page scrolling\n event.preventDefault();\n\n // Calculate zoom delta based on wheel direction\n // Use deltaY for vertical scroll, deltaX for horizontal (trackpad support)\n // Reverse sign: scroll down (positive delta) should zoom out, scroll up (negative delta) should zoom in\n const delta = event.deltaY !== 0 ? event.deltaY : event.deltaX;\n const scrollDirection = delta > 0 ? -1 : 1; // Negative for scroll down (zoom out), positive for scroll up (zoom in)\n\n const oldScale = scale.value;\n // Apply flat 5% increment based on scroll direction\n const newScale =\n scrollDirection > 0\n ? oldScale + zoomStep // Zoom in: add 0.05\n : oldScale - zoomStep; // Zoom out: subtract 0.05\n\n const clampedScale = Math.max(minScale, Math.min(maxScale, newScale));\n\n if (Math.abs(clampedScale - oldScale) > 0.001) {\n // Get the image container bounds\n const containerRect = imageContainerRef.value?.getBoundingClientRect();\n if (!containerRect) return;\n\n // Get mouse position relative to container center\n const mouseX = event.clientX - containerRect.left - containerRect.width / 2;\n const mouseY = event.clientY - containerRect.top - containerRect.height / 2;\n\n // Calculate the point on the image (in image coordinates) that the mouse is over\n // This accounts for current translation and scale\n const imagePointX = (mouseX - translateX.value) / oldScale;\n const imagePointY = (mouseY - translateY.value) / oldScale;\n\n // Apply new scale\n scale.value = clampedScale;\n\n // Adjust translation so the same image point stays under the mouse\n // After zoom, we want: mouseX = imagePointX * clampedScale + translateX\n translateX.value = mouseX - imagePointX * clampedScale;\n translateY.value = mouseY - imagePointY * clampedScale;\n\n // Reset pan if zoomed out to fit\n if (scale.value <= 1) {\n translateX.value = 0;\n translateY.value = 0;\n }\n }\n};\n\n// Mouse drag for panning\nconst handleMouseDown = (event: MouseEvent) => {\n if (!imageRef.value || !props.isOpen || scale.value <= 1) return;\n\n // Only start drag on left mouse button\n if (event.button !== 0) return;\n\n event.preventDefault();\n\n isDragging.value = true;\n mouseDragState.value = {\n isDragging: true,\n startX: event.clientX,\n startY: event.clientY,\n startTranslateX: translateX.value,\n startTranslateY: translateY.value,\n };\n\n // Change cursor to grabbing\n if (imageRef.value) {\n imageRef.value.style.cursor = 'grabbing';\n }\n};\n\nconst handleMouseMove = (event: MouseEvent) => {\n if (!mouseDragState.value || !mouseDragState.value.isDragging || !props.isOpen) return;\n\n event.preventDefault();\n\n // Use requestAnimationFrame for smoother updates\n requestAnimationFrame(() => {\n if (!mouseDragState.value) return;\n\n const deltaX = event.clientX - mouseDragState.value.startX;\n const deltaY = event.clientY - mouseDragState.value.startY;\n\n // Pan relative to current scale\n translateX.value = mouseDragState.value.startTranslateX + deltaX / scale.value;\n translateY.value = mouseDragState.value.startTranslateY + deltaY / scale.value;\n\n // Clamp translation to reasonable bounds\n const maxTranslate = 300;\n translateX.value = Math.max(-maxTranslate, Math.min(maxTranslate, translateX.value));\n translateY.value = Math.max(-maxTranslate, Math.min(maxTranslate, translateY.value));\n });\n};\n\nconst handleMouseUp = () => {\n if (mouseDragState.value) {\n mouseDragState.value.isDragging = false;\n }\n mouseDragState.value = null;\n isDragging.value = false;\n\n // Reset cursor\n if (imageRef.value) {\n imageRef.value.style.cursor = scale.value > 1 ? 'grab' : 'default';\n }\n};\n\n// Touch gestures - improved implementation\nconst getTouchDistance = (touches: Touch[]): number => {\n if (touches.length < 2) return 0;\n const touch1 = touches[0];\n const touch2 = touches[1];\n if (!touch1 || !touch2) return 0;\n const dx = touch1.clientX - touch2.clientX;\n const dy = touch1.clientY - touch2.clientY;\n return Math.sqrt(dx * dx + dy * dy);\n};\n\nconst getTouchCenter = (touches: Touch[]): { x: number; y: number } | null => {\n if (touches.length === 0) return null;\n if (touches.length === 1) {\n const touch = touches[0];\n if (!touch) return null;\n return { x: touch.clientX, y: touch.clientY };\n }\n // For 2 touches, return the center point\n const touch1 = touches[0];\n const touch2 = touches[1];\n if (!touch1 || !touch2) return null;\n return {\n x: (touch1.clientX + touch2.clientX) / 2,\n y: (touch1.clientY + touch2.clientY) / 2,\n };\n};\n\n// Handle touch events on the image directly\nconst handleImageTouchStart = (event: TouchEvent) => {\n if (!imageRef.value || !props.isOpen) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n const touches = Array.from(event.touches);\n\n if (touches.length === 2) {\n // Pinch zoom gesture\n isPinching.value = true;\n const distance = getTouchDistance(touches);\n const center = getTouchCenter(touches);\n\n if (center) {\n touchState.value = {\n type: 'pinch',\n initialDistance: distance,\n initialScale: scale.value,\n initialTranslateX: translateX.value,\n initialTranslateY: translateY.value,\n initialTouches: touches,\n };\n }\n } else if (touches.length === 1 && scale.value > 1) {\n // Single touch pan (only when zoomed in)\n isDragging.value = true;\n const touch = touches[0];\n if (touch) {\n touchState.value = {\n type: 'pan',\n lastPanX: touch.clientX,\n lastPanY: touch.clientY,\n };\n }\n } else {\n // Clear any existing touch state\n touchState.value = null;\n isDragging.value = false;\n isPinching.value = false;\n }\n};\n\nconst handleImageTouchMove = (event: TouchEvent) => {\n if (!imageRef.value || !props.isOpen || !touchState.value) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n handleTouchMove(event);\n};\n\nconst handleImageTouchEnd = (event: TouchEvent) => {\n if (!imageRef.value || !props.isOpen) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n handleTouchEnd();\n};\n\n// Handle touch events on the container (for areas outside the image)\nconst handleTouchStart = (event: TouchEvent) => {\n if (!imageRef.value || !props.isOpen) return;\n\n // Don't handle touch if it's on the zoom controls\n const target = event.target as HTMLElement;\n if (target.closest('.zoom-controls')) {\n return;\n }\n\n // If touch is on the image, let handleImageTouchStart handle it\n if (target === imageRef.value || imageRef.value.contains(target)) {\n return;\n }\n\n event.preventDefault(); // Prevent scrolling\n\n const touches = Array.from(event.touches);\n\n if (touches.length === 2) {\n // Pinch zoom gesture\n isPinching.value = true;\n const distance = getTouchDistance(touches);\n const center = getTouchCenter(touches);\n\n if (center) {\n touchState.value = {\n type: 'pinch',\n initialDistance: distance,\n initialScale: scale.value,\n initialTranslateX: translateX.value,\n initialTranslateY: translateY.value,\n initialTouches: touches,\n };\n }\n } else if (touches.length === 1 && scale.value > 1) {\n // Single touch pan (only when zoomed in)\n isDragging.value = true;\n const touch = touches[0];\n if (touch) {\n touchState.value = {\n type: 'pan',\n lastPanX: touch.clientX,\n lastPanY: touch.clientY,\n };\n }\n } else {\n // Clear any existing touch state\n touchState.value = null;\n isDragging.value = false;\n isPinching.value = false;\n }\n};\n\nconst handleTouchMove = (event: TouchEvent) => {\n if (!imageRef.value || !props.isOpen || !touchState.value) return;\n\n const touches = Array.from(event.touches);\n\n // Use requestAnimationFrame for smoother updates\n requestAnimationFrame(() => {\n if (!touchState.value) return;\n\n if (touchState.value.type === 'pinch' && touches.length === 2) {\n // Handle pinch zoom\n event.preventDefault();\n\n const distance = getTouchDistance(touches);\n if (touchState.value.initialDistance && touchState.value.initialScale !== undefined) {\n const scaleChange = distance / touchState.value.initialDistance;\n const newScale = Math.max(\n minScale,\n Math.min(maxScale, touchState.value.initialScale * scaleChange),\n );\n scale.value = newScale;\n\n // Optionally adjust translation based on pinch center\n // This keeps the pinch center point stable during zoom\n }\n } else if (touchState.value.type === 'pan' && touches.length === 1 && scale.value > 1) {\n // Handle single touch pan (only when zoomed in)\n event.preventDefault();\n\n const touch = touches[0];\n if (\n touch &&\n touchState.value.lastPanX !== undefined &&\n touchState.value.lastPanY !== undefined\n ) {\n const deltaX = touch.clientX - touchState.value.lastPanX;\n const deltaY = touch.clientY - touchState.value.lastPanY;\n\n // Pan relative to current scale\n translateX.value += deltaX / scale.value;\n translateY.value += deltaY / scale.value;\n\n // Clamp translation\n const maxTranslate = 200;\n translateX.value = Math.max(-maxTranslate, Math.min(maxTranslate, translateX.value));\n translateY.value = Math.max(-maxTranslate, Math.min(maxTranslate, translateY.value));\n\n touchState.value.lastPanX = touch.clientX;\n touchState.value.lastPanY = touch.clientY;\n }\n } else {\n // Touch count changed or invalid state - reset\n touchState.value = null;\n isDragging.value = false;\n isPinching.value = false;\n }\n });\n};\n\nconst handleTouchEnd = () => {\n touchState.value = null;\n isDragging.value = false;\n isPinching.value = false;\n};\n\n// Image load handlers\nconst handleImageLoad = () => {\n isLoading.value = false;\n hasError.value = false;\n};\n\nconst handleImageError = () => {\n isLoading.value = false;\n hasError.value = true;\n};\n\n// Navigation\nconst goToPrevious = () => {\n if (props.onPrevious) {\n props.onPrevious();\n }\n};\n\nconst goToNext = () => {\n if (props.onNext) {\n props.onNext();\n }\n};\n\n// Actions\nconst handleDownload = () => {\n if (props.onDownload) {\n props.onDownload();\n }\n};\n\nconst handleClose = () => {\n isOpen.value = false;\n emit('close');\n};\n\nconst handleBackdropClick = (event: MouseEvent) => {\n if (event.target === dialogRef.value) {\n handleClose();\n }\n};\n\n// Cleanup\nonUnmounted(() => {\n window.removeEventListener('resize', () => {});\n // Clean up event listeners\n if (imageContainerRef.value) {\n imageContainerRef.value.removeEventListener('wheel', handleWheel);\n imageContainerRef.value.removeEventListener('mousedown', handleMouseDown);\n imageContainerRef.value.removeEventListener('touchstart', handleTouchStart);\n imageContainerRef.value.removeEventListener('touchmove', handleTouchMove);\n imageContainerRef.value.removeEventListener('touchend', handleTouchEnd);\n imageContainerRef.value.removeEventListener('touchcancel', handleTouchEnd);\n }\n // Remove global mouse listeners\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n});\n</script>\n","<template>\n <div class=\"mt-4 sm:mt-6\">\n <div\n class=\"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0 mb-3\"\n >\n <h3 class=\"text-base sm:text-lg font-semibold\">Attachments</h3>\n <button\n v-if=\"canUpload\"\n @click.prevent=\"openFileSelector\"\n class=\"btn btn-sm btn-primary w-full sm:w-auto\"\n :disabled=\"isUploading\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4 mr-1\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n Add Files\n </button>\n </div>\n\n <input ref=\"fileInput\" type=\"file\" multiple class=\"hidden\" @change=\"handleFileSelect\" />\n\n <!-- Drag & Drop Zone (hidden on mobile, shown on desktop) -->\n <div\n v-if=\"canUpload\"\n class=\"hidden sm:block border-2 border-dashed rounded-lg p-4 sm:p-6 text-center mb-4 transition-colors cursor-pointer\"\n :class=\"{\n 'border-primary bg-primary/5': isDragging,\n 'border-base-300 hover:border-primary/50': !isDragging,\n }\"\n @dragover.prevent=\"isDragging = true\"\n @dragleave.prevent=\"isDragging = false\"\n @drop.prevent=\"handleFileDrop\"\n @click.prevent.stop=\"openFileSelector\"\n >\n <div class=\"flex flex-col items-center justify-center py-2 sm:py-4\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-8 w-8 sm:h-12 sm:w-12 mb-2 text-primary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12\"\n />\n </svg>\n <p class=\"text-sm sm:text-lg font-medium\">Drag and drop files here</p>\n <p class=\"text-xs sm:text-sm text-base-content/70 mt-1\">or click to browse files</p>\n <p v-if=\"!recordId\" class=\"text-xs text-base-content/50 mt-2 sm:mt-3\">\n Files will be queued until ticket is created\n </p>\n </div>\n </div>\n\n <!-- Upload Queue -->\n <div v-if=\"uploadQueue.length > 0\" class=\"mb-4 space-y-2\">\n <div\n v-for=\"item in uploadQueue\"\n :key=\"item.id\"\n class=\"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 p-2 sm:p-3 bg-base-200 rounded-lg\"\n >\n <div class=\"flex-1 min-w-0\">\n <div class=\"text-xs sm:text-sm font-medium truncate\">\n {{ item.file.name }}\n </div>\n <div\n v-if=\"item.status === 'uploading'\"\n class=\"w-full bg-base-300 rounded-full h-1.5 mt-1\"\n >\n <div\n class=\"bg-primary h-1.5 rounded-full transition-all\"\n :style=\"{ width: `${item.progress}%` }\"\n ></div>\n </div>\n <div v-if=\"item.status === 'error'\" class=\"text-xs text-error mt-1 break-words\">\n {{ item.errorMessage }}\n </div>\n </div>\n <div class=\"flex gap-2 sm:gap-1\">\n <button\n v-if=\"item.status === 'error'\"\n @click.prevent=\"retryUpload(item)\"\n class=\"btn btn-xs btn-ghost flex-1 sm:flex-none\"\n type=\"button\"\n >\n Retry\n </button>\n <button\n v-if=\"item.status !== 'uploading'\"\n @click.prevent=\"removeFromQueue(item.id)\"\n class=\"btn btn-xs btn-ghost text-error flex-1 sm:flex-none\"\n type=\"button\"\n >\n Remove\n </button>\n </div>\n </div>\n </div>\n\n <!-- Attachments List -->\n <div v-if=\"(attachments.length > 0 || attachmentsLoading) && recordId\" class=\"space-y-2\">\n <div v-if=\"attachmentsLoading\" class=\"flex justify-center py-4\">\n <span class=\"loading loading-spinner loading-sm\"></span>\n </div>\n <div\n v-for=\"file in attachments\"\n :key=\"file.id\"\n class=\"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 p-2 sm:p-3 bg-base-100 border border-base-300 rounded-lg hover:bg-base-200 transition-colors\"\n :class=\"{ 'cursor-pointer': isImage(file.type) }\"\n @click.prevent=\"isImage(file.type) && viewImage(file)\"\n >\n <div class=\"flex items-center gap-2 sm:gap-3 flex-1 min-w-0 w-full sm:w-auto\">\n <div class=\"flex-shrink-0\">\n <!-- Image thumbnail preview -->\n <div\n v-if=\"isImage(file.type)\"\n class=\"w-10 h-10 sm:w-12 sm:h-12 rounded overflow-hidden bg-base-200 flex items-center justify-center\"\n >\n <img\n v-if=\"getImageUrlSync(file.id)\"\n :src=\"getImageUrlSync(file.id)\"\n :alt=\"file.name\"\n class=\"w-full h-full object-cover\"\n @error=\"handleImageError\"\n />\n <div v-else class=\"w-full h-full flex items-center justify-center\">\n <span class=\"loading loading-spinner loading-xs\"></span>\n </div>\n </div>\n <!-- File type badge for non-images -->\n <div v-else class=\"badge badge-sm\" :class=\"getFileTypeBadgeClass(file.type)\">\n {{ getFileTypeLabel(file.type) }}\n </div>\n </div>\n <div class=\"flex-1 min-w-0\">\n <div class=\"text-sm sm:text-base font-medium truncate\">\n {{ file.name }}\n </div>\n <div class=\"text-xs text-base-content/60\">\n {{ formatFileSize(file.size) }} •\n {{ formatDate(file.uploadedAt) }}\n </div>\n </div>\n </div>\n <div class=\"flex gap-1 justify-end sm:justify-start\" @click.stop>\n <button\n v-if=\"isImage(file.type)\"\n @click.prevent=\"viewImage(file)\"\n class=\"btn btn-sm btn-ghost btn-circle\"\n title=\"View Image\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\"\n />\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\"\n />\n </svg>\n </button>\n <button\n @click.prevent=\"downloadFile(file, $event)\"\n class=\"btn btn-sm btn-ghost btn-circle\"\n title=\"Download\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4\"\n />\n </svg>\n </button>\n <button\n v-if=\"canDelete\"\n @click.prevent=\"confirmDelete(file)\"\n class=\"btn btn-sm btn-ghost btn-circle text-error\"\n title=\"Delete\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-4 w-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n\n <div\n v-else-if=\"!attachmentsLoading && recordId\"\n class=\"text-center py-8 text-base-content/50\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-12 w-12 mx-auto mb-2 opacity-50\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13\"\n />\n </svg>\n <p>No attachments</p>\n </div>\n\n <!-- Image View Modal -->\n <ImageModal\n :is-open=\"!!viewingImage\"\n :image-src=\"viewingImage ? getImageUrlSync(viewingImage.id) : ''\"\n :image-name=\"viewingImage?.name || ''\"\n :image-index=\"viewingImageIndex\"\n :total-images=\"imageAttachments.length\"\n :on-download=\"\n viewingImage\n ? () => {\n if (viewingImage) downloadFile(viewingImage, undefined);\n }\n : undefined\n \"\n :on-previous=\"canGoToPrevious ? goToPreviousImage : undefined\"\n :on-next=\"canGoToNext ? goToNextImage : undefined\"\n @close=\"closeImageModal\"\n />\n\n <!-- Delete Confirmation Modal -->\n <ConfirmDialog\n v-model=\"showDeleteModal\"\n title=\"Delete Attachment\"\n :message=\"deleteMessage\"\n confirm-text=\"Delete\"\n cancel-text=\"Cancel\"\n confirm-button-class=\"btn-error\"\n @confirm=\"deleteFile\"\n @cancel=\"closeDeleteModal\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport ConfirmDialog from '../../../components/ConfirmDialog.vue';\nimport ImageModal from '../../../components/ImageModal.vue';\nimport { useMutation } from '../../../composables/useMutation';\nimport { useQuery } from '../../../composables/useQuery';\nimport { useEnv } from '../../../composables/useEnv';\nimport { useUserSessionStore } from '../../../composables/useUserSessionStore';\nimport { computed, onUnmounted, ref, watch } from 'vue';\n\ninterface Attachment {\n id: string;\n name: string;\n size: number;\n type: string;\n uploadedAt: Date;\n}\n\ninterface QueueItem {\n id: string;\n file: File;\n status: 'pending' | 'uploading' | 'success' | 'error';\n progress: number;\n errorMessage?: string;\n}\n\ninterface Props {\n recordId?: string; // Optional for create forms\n canUpload?: boolean;\n canDelete?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n canUpload: true,\n canDelete: true,\n});\n\nconst emit = defineEmits<{\n uploaded: [];\n deleted: [];\n filesQueued: [files: File[]];\n}>();\n\n// Expose methods for parent components (e.g., to get queued files after creation)\nconst uploadQueuedFiles = async (ticketId: string) => {\n // Upload all pending files with the new ticket ID\n const pendingItems = uploadQueue.value.filter((item) => item.status === 'pending');\n for (const item of pendingItems) {\n item.status = 'uploading';\n await uploadFile(item, ticketId);\n }\n};\n\ndefineExpose({\n getQueuedFiles: () =>\n uploadQueue.value.filter((item) => item.status === 'pending').map((item) => item.file),\n uploadQueuedFiles,\n});\n\nconst fileInput = ref<HTMLInputElement | null>(null);\nconst isDragging = ref(false);\nconst isUploading = ref(false);\nconst uploadQueue = ref<QueueItem[]>([]);\nconst fileToDelete = ref<Attachment | null>(null);\nconst showDeleteModal = ref(false);\nconst viewingImage = ref<Attachment | null>(null);\nconst imageUrls = ref<Map<string, string>>(new Map()); // Cache of image object URLs\n\nconst env = useEnv();\nconst userStore = useUserSessionStore();\n\n// Query attachments (only if recordId exists)\nconst {\n data: attachmentsData,\n loading: attachmentsLoading,\n refetch: refreshAttachments,\n} = useQuery(\n async (api) => {\n if (!props.recordId) return { files: [], folders: [] };\n return await api.attachments.listAttachments({\n record_id: props.recordId,\n record_type: 'support_ticket',\n filters: {\n limit: 100,\n include_folders: false,\n folder_id: null, // Only root level attachments for Jira-style\n },\n });\n },\n {\n enabled: computed(() => !!props.recordId),\n staleTime: 2 * 60 * 1000,\n },\n);\n\nconst attachments = computed<Attachment[]>(() => {\n if (!attachmentsData.value) return [];\n const files: Attachment[] = [];\n const fileItems = attachmentsData.value.files || [];\n for (const item of fileItems) {\n files.push({\n id: item.id,\n name: item.original_name,\n size: parseInt(item.file_size || '0'),\n type: item.content_type || '',\n uploadedAt: new Date(item.created_at),\n });\n }\n return files;\n});\n\nconst deleteMessage = computed(() => {\n if (!fileToDelete.value)\n return 'Are you sure you want to delete this attachment? This action cannot be undone.';\n return `Are you sure you want to delete \"${fileToDelete.value.name}\"? This action cannot be undone.`;\n});\n\n// Filter to only image attachments for navigation\nconst imageAttachments = computed(() => {\n return attachments.value.filter((file) => isImage(file.type));\n});\n\n// Current viewing image index\nconst viewingImageIndex = computed(() => {\n if (!viewingImage.value) return null;\n const index = imageAttachments.value.findIndex((img) => img.id === viewingImage.value?.id);\n return index >= 0 ? index : null;\n});\n\nconst canGoToPrevious = computed(() => {\n return viewingImageIndex.value !== null && viewingImageIndex.value > 0;\n});\n\nconst canGoToNext = computed(() => {\n return (\n viewingImageIndex.value !== null &&\n viewingImageIndex.value < imageAttachments.value.length - 1\n );\n});\n\n// Mutations\nconst { mutate: deleteAttachment } = useMutation(\n (api, input: { id: string }) => api.attachments.deleteAttachment(input.id),\n { invalidate: /^attachments?:/ },\n);\n\n// File type helpers\nconst getFileTypeLabel = (mimeType: string): string => {\n if (mimeType.startsWith('image/')) return 'IMG';\n if (mimeType.startsWith('video/')) return 'VID';\n if (mimeType.startsWith('audio/')) return 'AUD';\n if (mimeType.includes('pdf')) return 'PDF';\n if (mimeType.includes('word') || mimeType.includes('document')) return 'DOC';\n if (mimeType.includes('excel') || mimeType.includes('spreadsheet')) return 'XLS';\n if (mimeType.includes('zip') || mimeType.includes('archive')) return 'ZIP';\n return 'FILE';\n};\n\nconst getFileTypeBadgeClass = (mimeType: string): string => {\n if (mimeType.startsWith('image/')) return 'badge-primary';\n if (mimeType.startsWith('video/')) return 'badge-secondary';\n if (mimeType.includes('pdf')) return 'badge-error';\n if (mimeType.includes('word') || mimeType.includes('document')) return 'badge-info';\n return 'badge-ghost';\n};\n\nconst formatFileSize = (bytes: number): string => {\n if (bytes === 0) return '0 B';\n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;\n};\n\nconst formatDate = (date: Date): string => {\n return new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n};\n\n// Image helpers\nconst isImage = (mimeType: string): boolean => {\n return mimeType.startsWith('image/');\n};\n\nconst getImageUrl = async (fileId: string): Promise<string> => {\n // Check if we already have a cached URL\n if (imageUrls.value.has(fileId)) {\n return imageUrls.value.get(fileId)!;\n }\n\n // Fetch image with bearer token\n try {\n const res = await fetch(\n `${env.restApiClient.apiUrl}/attachments/support_ticket/${fileId}`,\n {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${userStore.accessToken}`,\n },\n },\n );\n\n if (!res.ok) {\n throw new Error('Failed to load image');\n }\n\n const blob = await res.blob();\n const url = URL.createObjectURL(blob);\n imageUrls.value.set(fileId, url);\n return url;\n } catch (error) {\n console.error('Failed to load image:', error);\n // Return empty string or placeholder\n return '';\n }\n};\n\n// Computed property to get image URLs for thumbnails\nconst getImageUrlSync = (fileId: string): string => {\n // For thumbnails, we'll use a loading state and fetch async\n // Return empty initially, will be updated when loaded\n return imageUrls.value.get(fileId) || '';\n};\n\n// Load image for thumbnail\nconst loadImageThumbnail = async (fileId: string) => {\n if (!imageUrls.value.has(fileId)) {\n await getImageUrl(fileId);\n }\n};\n\nconst handleImageError = (event: Event) => {\n const img = event.target as HTMLImageElement;\n img.style.display = 'none';\n // Could show a placeholder icon here\n};\n\n// Cleanup object URLs when component unmounts\nonUnmounted(() => {\n imageUrls.value.forEach((url) => {\n URL.revokeObjectURL(url);\n });\n imageUrls.value.clear();\n});\n\nconst viewImage = async (file: Attachment) => {\n viewingImage.value = file;\n // Load the image URL if not already loaded\n if (!imageUrls.value.has(file.id)) {\n await getImageUrl(file.id);\n }\n};\n\nconst goToPreviousImage = () => {\n if (!canGoToPrevious.value || viewingImageIndex.value === null) return;\n const previousImage = imageAttachments.value[viewingImageIndex.value - 1];\n if (previousImage) {\n viewImage(previousImage);\n }\n};\n\nconst goToNextImage = () => {\n if (!canGoToNext.value || viewingImageIndex.value === null) return;\n const nextImage = imageAttachments.value[viewingImageIndex.value + 1];\n if (nextImage) {\n viewImage(nextImage);\n }\n};\n\nconst closeImageModal = () => {\n viewingImage.value = null;\n};\n\n// File upload\nconst openFileSelector = (event?: Event) => {\n // Always prevent default and stop propagation\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n // Prevent if already uploading\n if (isUploading.value) {\n return;\n }\n\n // Allow file selection even without recordId (for create forms)\n // Files will be queued and uploaded after ticket creation\n fileInput.value?.click();\n};\n\nconst processFiles = (files: File[]) => {\n const fileArray = Array.from(files);\n fileArray.forEach((file) => {\n const queueItem: QueueItem = {\n id: `${Date.now()}-${Math.random()}`,\n file,\n status: 'pending',\n progress: 0,\n };\n uploadQueue.value.push(queueItem);\n });\n\n emit('filesQueued', fileArray);\n\n // If recordId exists, upload immediately. Otherwise, queue for later\n if (props.recordId) {\n processUploadQueue();\n }\n};\n\nconst handleFileSelect = (event: Event) => {\n const target = event.target as HTMLInputElement;\n const files = target.files;\n if (!files) return;\n\n processFiles(Array.from(files));\n target.value = ''; // Reset input\n};\n\nconst handleFileDrop = (event: DragEvent) => {\n isDragging.value = false;\n\n const files = event.dataTransfer?.files;\n if (!files || files.length === 0) return;\n\n processFiles(Array.from(files));\n};\n\nconst processUploadQueue = async (ticketId?: string) => {\n const nextItem = uploadQueue.value.find((item) => item.status === 'pending');\n if (!nextItem) {\n isUploading.value = false;\n return;\n }\n\n isUploading.value = true;\n nextItem.status = 'uploading';\n\n await uploadFile(nextItem, ticketId);\n\n // Process next item\n if (uploadQueue.value.some((item) => item.status === 'pending')) {\n processUploadQueue(ticketId);\n } else {\n isUploading.value = false;\n }\n};\n\nconst uploadFile = async (item: QueueItem, ticketId?: string) => {\n const recordId = ticketId || props.recordId;\n if (!recordId) {\n item.status = 'error';\n item.errorMessage = 'Ticket ID is required for upload';\n return;\n }\n\n const progressInterval = setInterval(() => {\n item.progress += Math.random() * 10;\n item.progress = Math.min(99, Math.round(item.progress * 100) / 100);\n }, 200);\n\n try {\n const formData = new FormData();\n formData.append('file', item.file);\n formData.append('file_name', item.file.name);\n formData.append('record_id', recordId);\n formData.append('record_type', 'support_ticket');\n\n const response = await fetch(\n `${env.restApiClient.apiUrl}/attachments/support_ticket/${recordId}`,\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${userStore.accessToken}`,\n },\n body: formData,\n },\n );\n\n if (!response.ok) {\n throw new Error(`Upload failed: ${response.statusText}`);\n }\n\n const result = await response.json();\n if (result && result.id) {\n clearInterval(progressInterval);\n item.progress = 100;\n item.status = 'success';\n setTimeout(() => {\n removeFromQueue(item.id);\n refreshAttachments();\n emit('uploaded');\n }, 500);\n } else {\n throw new Error('Invalid response');\n }\n } catch (error) {\n clearInterval(progressInterval);\n item.status = 'error';\n item.errorMessage = error instanceof Error ? error.message : 'Upload failed';\n }\n};\n\nconst removeFromQueue = (id: string) => {\n const index = uploadQueue.value.findIndex((item) => item.id === id);\n if (index !== -1) {\n uploadQueue.value.splice(index, 1);\n }\n};\n\nconst retryUpload = (item: QueueItem) => {\n item.status = 'pending';\n item.progress = 0;\n item.errorMessage = undefined;\n if (props.recordId) {\n processUploadQueue();\n }\n};\n\n// File download\nconst downloadFile = async (file: Attachment, event?: Event) => {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n try {\n const res = await fetch(\n `${env.restApiClient.apiUrl}/attachments/support_ticket/${file.id}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${userStore.accessToken}`,\n },\n },\n );\n if (!res.ok) {\n throw new Error('Failed to download file');\n }\n const blob = await res.blob();\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = file.name;\n document.body.appendChild(a);\n a.click();\n a.remove();\n URL.revokeObjectURL(url);\n } catch (error) {\n console.error('Download failed:', error);\n }\n};\n\n// File delete\nconst confirmDelete = (file: Attachment) => {\n fileToDelete.value = file;\n showDeleteModal.value = true;\n};\n\nconst closeDeleteModal = () => {\n showDeleteModal.value = false;\n fileToDelete.value = null;\n};\n\nconst deleteFile = async () => {\n if (!fileToDelete.value) return;\n\n try {\n await deleteAttachment({ id: fileToDelete.value.id });\n refreshAttachments();\n emit('deleted');\n closeDeleteModal();\n } catch (error) {\n console.error('Delete failed:', error);\n }\n};\n\n// Watch for recordId changes\nwatch(\n () => props.recordId,\n (newRecordId, oldRecordId) => {\n if (newRecordId && newRecordId !== oldRecordId) {\n refreshAttachments();\n // If we have queued files and now have a recordId, upload them\n if (uploadQueue.value.some((item) => item.status === 'pending')) {\n processUploadQueue(newRecordId);\n }\n }\n },\n);\n\n// Load image thumbnails when attachments are loaded\nwatch(\n () => attachments.value,\n (newAttachments) => {\n newAttachments.forEach((file) => {\n if (isImage(file.type) && !imageUrls.value.has(file.id)) {\n loadImageThumbnail(file.id);\n }\n });\n },\n { immediate: true },\n);\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDA,MAAM,QAAQ;EAUd,MAAM,OAAO;EAMb,MAAM,YAAY,IAA8B,KAAK;EACrD,MAAM,SAAS,IAAI,MAAM,WAAW;AAEpC,cACQ,MAAM,aACX,aAAa;AACZ,UAAO,QAAQ;AACf,OAAI,YAAY,UAAU,MACxB,WAAU,MAAM,WAAW;YAClB,UAAU,MACnB,WAAU,MAAM,OAAO;KAG3B,EAAE,WAAW,MAAM,CACpB;AAED,QAAM,SAAS,aAAa;AAC1B,OAAI,YAAY,U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QAAc,gBAAgB;KACvC,SAAO;;;;;;;;;;;IAGV,mBAAA,8BAAkC;IAClC,YASE,uBAAA;iBARS,gBAAA;kEAAA,gBAAe,QAAA;KACxB,OAAM;KACL,SAAS,cAAA;KACV,gBAAa;KACb,eAAY;KACZ,wBAAqB;KACpB,WAAS;KACT,UAAQ"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { l as useUserSessionStore, m as useEnv } from "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import { t as useMutation } from "./useMutation-CFwe7H9j.js";
|
|
3
|
+
import { t as AppLink_default } from "./AppLink-CHMMrSFI.js";
|
|
4
|
+
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, unref, withCtx } from "vue";
|
|
5
|
+
import { useRouter } from "vue-router";
|
|
6
|
+
import { loginSchema } from "@dragonmastery/dragoncore-shared";
|
|
7
|
+
import { useForm, withMetadata } from "@dragonmastery/zinia-forms-core";
|
|
8
|
+
import { toast } from "vue3-toastify";
|
|
9
|
+
|
|
10
|
+
//#region src/slices/auth/features/login/loginSchema.ts
|
|
11
|
+
const loginSchemaWithMetadata = withMetadata(loginSchema, "loginSchema", {
|
|
12
|
+
email: {
|
|
13
|
+
inputType: "email",
|
|
14
|
+
placeholder: "you@example.com",
|
|
15
|
+
helpText: "Enter the email address you used to register",
|
|
16
|
+
autocomplete: "username",
|
|
17
|
+
className: "login-field",
|
|
18
|
+
autofocus: true
|
|
19
|
+
},
|
|
20
|
+
password: {
|
|
21
|
+
inputType: "password",
|
|
22
|
+
placeholder: "••••••••",
|
|
23
|
+
helpText: "Must be at least 8 characters",
|
|
24
|
+
autocomplete: "current-password",
|
|
25
|
+
className: "login-field"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/slices/auth/features/login/LoginForm.vue
|
|
31
|
+
const _hoisted_1 = { class: "max-w-md mx-auto bg-base-200 p-6 rounded-xl shadow-md container" };
|
|
32
|
+
const _hoisted_2 = { class: "mt-2" };
|
|
33
|
+
const _hoisted_3 = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "text-center mt-2"
|
|
36
|
+
};
|
|
37
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
|
+
__name: "LoginForm",
|
|
39
|
+
setup(__props) {
|
|
40
|
+
const { allowUserSignup } = useEnv();
|
|
41
|
+
const { form, zinia, ZiniaForm, ZiniaSubmitButton } = useForm(loginSchemaWithMetadata, {
|
|
42
|
+
storeName: "login-form",
|
|
43
|
+
persistToLocalStorage: false,
|
|
44
|
+
renderStyle: "daisy_ui"
|
|
45
|
+
});
|
|
46
|
+
const sessionStore = useUserSessionStore();
|
|
47
|
+
const router = useRouter();
|
|
48
|
+
const { mutate: loginMutate } = useMutation((api, input) => api.userSessions.login(input), { credentials: "include" });
|
|
49
|
+
const handleSubmit = async (data) => {
|
|
50
|
+
const loginData = await loginMutate(data);
|
|
51
|
+
if (!loginData) throw new Error("Login failed");
|
|
52
|
+
const { access_token, user_details_token } = loginData;
|
|
53
|
+
if (!access_token || !user_details_token) throw new Error("Invalid login response");
|
|
54
|
+
return loginData;
|
|
55
|
+
};
|
|
56
|
+
const handleSuccess = async (data) => {
|
|
57
|
+
sessionStore.setSession(data.user_details_token);
|
|
58
|
+
sessionStore.setAccessToken(data.access_token);
|
|
59
|
+
form.reset();
|
|
60
|
+
const returnUrl = router.currentRoute.value.query.returnUrl;
|
|
61
|
+
let targetPath = "/";
|
|
62
|
+
if (returnUrl) if (returnUrl.startsWith("/") && !returnUrl.startsWith("/auth/")) {
|
|
63
|
+
targetPath = returnUrl;
|
|
64
|
+
console.log(`[Login] Redirecting to original destination: ${returnUrl}`);
|
|
65
|
+
} else console.warn(`[Login] Invalid return URL detected: ${returnUrl}`);
|
|
66
|
+
await router.push(targetPath);
|
|
67
|
+
toast.success("You are now logged in!");
|
|
68
|
+
};
|
|
69
|
+
const handleError = (error) => {
|
|
70
|
+
toast.error(error.message || "Login failed");
|
|
71
|
+
};
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
74
|
+
_cache[3] || (_cache[3] = createElementVNode("h1", { class: "text-2xl font-bold mb-6 text-center" }, "Login", -1)),
|
|
75
|
+
createVNode(unref(ZiniaForm), {
|
|
76
|
+
onHandleSubmit: handleSubmit,
|
|
77
|
+
onSuccess: handleSuccess,
|
|
78
|
+
onError: handleError
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createVNode(unref(zinia).EmailField),
|
|
82
|
+
createVNode(unref(zinia).PasswordField),
|
|
83
|
+
createVNode(unref(ZiniaSubmitButton), {
|
|
84
|
+
submitText: "Login",
|
|
85
|
+
submittingText: "Logging in..."
|
|
86
|
+
}),
|
|
87
|
+
createElementVNode("div", _hoisted_2, [createVNode(AppLink_default, {
|
|
88
|
+
to: "/auth/forgot-password",
|
|
89
|
+
class: "link-accent link"
|
|
90
|
+
}, {
|
|
91
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Forgot your password? ", -1)])]),
|
|
92
|
+
_: 1
|
|
93
|
+
})]),
|
|
94
|
+
unref(allowUserSignup) ? (openBlock(), createElementBlock("div", _hoisted_3, [createElementVNode("p", null, [_cache[2] || (_cache[2] = createTextVNode(" Don't have an account? ", -1)), createVNode(AppLink_default, {
|
|
95
|
+
class: "link-accent link",
|
|
96
|
+
to: "/auth/signup"
|
|
97
|
+
}, {
|
|
98
|
+
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Sign up", -1)])]),
|
|
99
|
+
_: 1
|
|
100
|
+
})])])) : createCommentVNode("v-if", true)
|
|
101
|
+
]),
|
|
102
|
+
_: 1
|
|
103
|
+
}),
|
|
104
|
+
createCommentVNode(" Divider between login form and social buttons "),
|
|
105
|
+
createCommentVNode(" <div class=\"divider my-6\">OR</div> "),
|
|
106
|
+
createCommentVNode(" Social Login Buttons Component "),
|
|
107
|
+
createCommentVNode(" <SocialLoginButtons @login=\"socialLogin\" /> ")
|
|
108
|
+
]);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
var LoginForm_default = _sfc_main;
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
export { loginSchemaWithMetadata as n, LoginForm_default as t };
|
|
116
|
+
//# sourceMappingURL=LoginForm-_PZ51Uwe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginForm-_PZ51Uwe.js","names":[],"sources":["../src/slices/auth/features/login/loginSchema.ts","../src/slices/auth/features/login/LoginForm.vue"],"sourcesContent":["import { withMetadata } from '@dragonmastery/zinia-forms-core';\nimport { loginSchema } from '@dragonmastery/dragoncore-shared';\nimport { z } from 'zod';\n\n// Define the login form type\nexport type LoginForm = z.infer<typeof loginSchema>;\n\n// Enhance the schema with metadata\nexport const loginSchemaWithMetadata = withMetadata(loginSchema, 'loginSchema', {\n email: {\n inputType: 'email',\n placeholder: 'you@example.com',\n helpText: 'Enter the email address you used to register',\n autocomplete: 'username',\n className: 'login-field',\n autofocus: true,\n },\n\n password: {\n inputType: 'password',\n placeholder: '••••••••',\n helpText: 'Must be at least 8 characters',\n autocomplete: 'current-password',\n className: 'login-field',\n },\n});\n","<template>\n <div class=\"max-w-md mx-auto bg-base-200 p-6 rounded-xl shadow-md container\">\n <h1 class=\"text-2xl font-bold mb-6 text-center\">Login</h1>\n\n <ZiniaForm @handle-submit=\"handleSubmit\" @success=\"handleSuccess\" @error=\"handleError\">\n <zinia.EmailField />\n <zinia.PasswordField />\n\n <ZiniaSubmitButton submitText=\"Login\" submittingText=\"Logging in...\" />\n\n <div class=\"mt-2\">\n <AppLink to=\"/auth/forgot-password\" class=\"link-accent link\">\n Forgot your password?\n </AppLink>\n </div>\n <div v-if=\"allowUserSignup\" class=\"text-center mt-2\">\n <p>\n Don't have an account?\n <AppLink class=\"link-accent link\" to=\"/auth/signup\">Sign up</AppLink>\n </p>\n </div>\n </ZiniaForm>\n\n <!-- Divider between login form and social buttons -->\n <!-- <div class=\"divider my-6\">OR</div> -->\n\n <!-- Social Login Buttons Component -->\n <!-- <SocialLoginButtons @login=\"socialLogin\" /> -->\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport AppLink from '../../../../components/AppLink.vue';\nimport { useMutation } from '../../../../composables/useMutation';\nimport { useEnv } from '../../../../composables/useEnv';\nimport { useUserSessionStore } from '../../../../composables/useUserSessionStore';\nimport { useForm } from '@dragonmastery/zinia-forms-core';\nimport { useRouter } from 'vue-router';\nimport { toast } from 'vue3-toastify';\nimport { z } from 'zod';\nimport { loginSchemaWithMetadata } from './loginSchema';\n\nconst { allowUserSignup } = useEnv();\n\n// Create a type-safe form using our schema with metadata\nconst { form, zinia, ZiniaForm, ZiniaSubmitButton } = useForm(loginSchemaWithMetadata, {\n storeName: 'login-form',\n persistToLocalStorage: false,\n renderStyle: 'daisy_ui',\n});\n\nconst sessionStore = useUserSessionStore();\nconst router = useRouter();\nconst { mutate: loginMutate } = useMutation(\n (api, input: z.infer<typeof loginSchemaWithMetadata>) => api.userSessions.login(input),\n { credentials: 'include' }, // Include credentials to allow cookies\n);\n\n// Handle form submission\nconst handleSubmit = async (data: z.infer<typeof loginSchemaWithMetadata>) => {\n const loginData = await loginMutate(data);\n if (!loginData) throw new Error('Login failed');\n const { access_token, user_details_token } = loginData;\n if (!access_token || !user_details_token) throw new Error('Invalid login response');\n\n return loginData;\n};\n\n// Handle success\nconst handleSuccess = async (data: { access_token: string; user_details_token: string }) => {\n sessionStore.setSession(data.user_details_token);\n sessionStore.setAccessToken(data.access_token);\n\n form.reset();\n\n // Check if there's a return URL to redirect to\n const returnUrl = router.currentRoute.value.query.returnUrl as string;\n let targetPath = '/';\n\n if (returnUrl) {\n // Make sure we're not redirecting to an auth page or external URL\n if (returnUrl.startsWith('/') && !returnUrl.startsWith('/auth/')) {\n targetPath = returnUrl;\n console.log(`[Login] Redirecting to original destination: ${returnUrl}`);\n } else {\n console.warn(`[Login] Invalid return URL detected: ${returnUrl}`);\n }\n }\n\n await router.push(targetPath);\n toast.success('You are now logged in!');\n};\n\n// Handle error\nconst handleError = (error: any) => {\n toast.error(error.message || 'Login failed');\n};\n</script>\n"],"mappings":";;;;;;;;;;AAQA,MAAa,0BAA0B,aAAa,aAAa,eAAe;CAC9E,OAAO;EACL,WAAW;EACX,aAAa;EACb,UAAU;EACV,cAAc;EACd,WAAW;EACX,WAAW;EACZ;CAED,UAAU;EACR,WAAW;EACX,aAAa;EACb,UAAU;EACV,cAAc;EACd,WAAW;EACZ;CACF,CAAC;;;;;;;;;;;;;ECiBF,MAAM,EAAE,oBAAoB,QAAQ;EAGpC,MAAM,EAAE,MAAM,OAAO,WAAW,sBAAsB,QAAQ,yBAAyB;GACrF,WAAW;GACX,uBAAuB;GACvB,aAAa;GACd,CAAC;EAEF,MAAM,eAAe,qBAAqB;EAC1C,MAAM,SAAS,WAAW;EAC1B,MAAM,EAAE,QAAQ,gBAAgB,aAC7B,KAAK,UAAmD,IAAI,aAAa,MAAM,MAAM,EACtF,EAAE,aAAa,WAAW,CAC3B;EAGD,MAAM,eAAe,OAAO,SAAkD;GAC5E,MAAM,YAAY,MAAM,YAAY,KAAK;AACzC,OAAI,CAAC,UAAW,OAAM,IAAI,MAAM,eAAe;GAC/C,MAAM,EAAE,cAAc,uBAAuB;AAC7C,OAAI,CAAC,gBAAgB,CAAC,mBAAoB,OAAM,IAAI,MAAM,yBAAyB;AAEnF,UAAO;;EAIT,MAAM,gBAAgB,OAAO,SAA+D;AAC1F,gBAAa,WAAW,KAAK,mBAAmB;AAChD,gBAAa,eAAe,KAAK,aAAa;AAE9C,QAAK,OAAO;GAGZ,MAAM,YAAY,OAAO,aAAa,MAAM,MAAM;GAClD,IAAI,aAAa;AAEjB,OAAI,UAEF,KAAI,UAAU,WAAW,IAAI,IAAI,CAAC,UAAU,WAAW,SAAS,EAAE;AAChE,iBAAa;AACb,YAAQ,IAAI,gDAAgD,YAAY;SAExE,SAAQ,KAAK,wCAAwC,YAAY;AAIrE,SAAM,OAAO,KAAK,WAAW;AAC7B,SAAM,QAAQ,yBAAyB;;EAIzC,MAAM,eAAe,UAAe;AAClC,SAAM,MAAM,MAAM,WAAW,eAAe;;;uBA9F5C,mBA2BM,OA3BN,YA2BM;8BA1BJ,mBAA0D,MAAA,EAAtD,OAAM,uCAAqC,EAAC,SAAK,GAAA;IAErD,YAiBY,MAAA,UAAA,EAAA;KAjBA,gBAAe;KAAe,WAAS;KAAgB,SAAO;;4BACpD;MAApB,YAAoB,MAAA,MAAA,CAAA,WAAA;MACpB,YAAuB,MAAA,MAAA,CAAA,cAAA;MAEvB,YAAuE,MAAA,kBAAA,EAAA;OAApD,YAAW;OAAQ,gBAAe;;MAErD,mBAIM,OAJN,YAIM,CAHJ,YAEU,iBAAA;OAFD,IAAG;OAAwB,OAAM;;8BAE1C,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAF6D,2BAE7D,GAAA,CAAA,EAAA,CAAA;;;MAES,MAAA,gBAAe,IAAA,WAAA,EAA1B,mBAKM,OALN,YAKM,CAJJ,mBAGI,KAAA,MAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAHD,4BAED,GAAA,GAAA,YAAqE,iBAAA;OAA5D,OAAM;OAAmB,IAAG;;8BAAsB,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAP,WAAO,GAAA,CAAA,EAAA,CAAA;;;;;;IAKjE,mBAAA,kDAAsD;IACtD,mBAAA,yCAA2C;IAE3C,mBAAA,mCAAuC;IACvC,mBAAA,kDAAoD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { l as useUserSessionStore } from "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import { t as useMutation } from "./useMutation-CFwe7H9j.js";
|
|
3
|
+
import { createElementBlock, createStaticVNode, defineComponent, onMounted, openBlock } from "vue";
|
|
4
|
+
import { useRouter } from "vue-router";
|
|
5
|
+
import { toast } from "vue3-toastify";
|
|
6
|
+
|
|
7
|
+
//#region src/slices/auth/features/Logout.vue
|
|
8
|
+
const _hoisted_1 = { class: "min-h-screen flex items-center justify-center bg-base-100" };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "Logout",
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const sessionStore = useUserSessionStore();
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const { mutate: logoutMutate } = useMutation((api) => api.userSessions.logout(), { credentials: "include" });
|
|
15
|
+
onMounted(async () => {
|
|
16
|
+
try {
|
|
17
|
+
await logoutMutate(void 0);
|
|
18
|
+
sessionStore.clearSession();
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
router.push("/auth/login");
|
|
21
|
+
}, 1e3);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
toast.error(error.message || "Failed to logout", { autoClose: 2e3 });
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
router.push("/");
|
|
26
|
+
}, 2e3);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [..._cache[0] || (_cache[0] = [createStaticVNode("<div class=\"max-w-md mx-auto bg-base-200 p-8 rounded-xl shadow-md text-center\"><div class=\"flex justify-center mb-4\"><span class=\"loading loading-spinner loading-lg text-primary\"></span></div><h2 class=\"text-2xl font-bold mb-2\">Logging out...</h2><p class=\"text-base-content/70\">Please wait while we securely log you out</p></div>", 1)])]);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var Logout_default = _sfc_main;
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Logout_default as t };
|
|
38
|
+
//# sourceMappingURL=Logout-BMjiqHnS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logout-BMjiqHnS.js","names":["error: any"],"sources":["../src/slices/auth/features/Logout.vue"],"sourcesContent":["<template>\n <div class=\"min-h-screen flex items-center justify-center bg-base-100\">\n <div class=\"max-w-md mx-auto bg-base-200 p-8 rounded-xl shadow-md text-center\">\n <div class=\"flex justify-center mb-4\">\n <span class=\"loading loading-spinner loading-lg text-primary\"></span>\n </div>\n <h2 class=\"text-2xl font-bold mb-2\">Logging out...</h2>\n <p class=\"text-base-content/70\">Please wait while we securely log you out</p>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useMutation } from '../../../composables/useMutation';\nimport { useUserSessionStore } from '../../../composables/useUserSessionStore';\nimport { onMounted } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { toast } from 'vue3-toastify';\n\nconst sessionStore = useUserSessionStore();\nconst router = useRouter();\nconst { mutate: logoutMutate } = useMutation(\n (api) => api.userSessions.logout(),\n { credentials: 'include' }, // Include credentials to allow cookies\n);\n\nonMounted(async () => {\n try {\n await logoutMutate(undefined as any);\n sessionStore.clearSession();\n setTimeout(() => {\n router.push('/auth/login');\n }, 1000);\n } catch (error: any) {\n toast.error(error.message || 'Failed to logout', {\n autoClose: 2000,\n });\n setTimeout(() => {\n router.push('/');\n }, 2000);\n }\n});\n</script>\n"],"mappings":";;;;;;;;;;;EAmBA,MAAM,eAAe,qBAAqB;EAC1C,MAAM,SAAS,WAAW;EAC1B,MAAM,EAAE,QAAQ,iBAAiB,aAC9B,QAAQ,IAAI,aAAa,QAAQ,EAClC,EAAE,aAAa,WAAW,CAC3B;AAED,YAAU,YAAY;AACpB,OAAI;AACF,UAAM,aAAa,OAAiB;AACpC,iBAAa,cAAc;AAC3B,qBAAiB;AACf,YAAO,KAAK,cAAc;OACzB,IAAK;YACDA,OAAY;AACnB,UAAM,MAAM,MAAM,WAAW,oBAAoB,EAC/C,WAAW,KACZ,CAAC;AACF,qBAAiB;AACf,YAAO,KAAK,IAAI;OACf,IAAK;;IAEV;;uBAxCA,mBAQM,OARN,YAQM,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,kBAAA,wVAAA,EAAA,CAAA,EAAA,CAAA"}
|