@yogiswara/honcho-editor-ui 2.8.10 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/color.d.ts +9 -0
  2. package/dist/color.js +9 -0
  3. package/dist/components/editor/GalleryAlbum/AlbumImageGallery.d.ts +8 -0
  4. package/dist/components/editor/GalleryAlbum/AlbumImageGallery.js +28 -0
  5. package/dist/components/editor/GalleryAlbum/ImageItem.d.ts +10 -0
  6. package/dist/components/editor/GalleryAlbum/ImageItem.js +81 -0
  7. package/dist/components/editor/HAccordionAspectRatio.d.ts +14 -0
  8. package/dist/components/editor/HAccordionAspectRatio.js +102 -0
  9. package/dist/components/editor/HAccordionColor.d.ts +16 -0
  10. package/dist/components/editor/HAccordionColor.js +282 -0
  11. package/dist/components/editor/HAccordionColorAdjustment.d.ts +35 -0
  12. package/dist/components/editor/HAccordionColorAdjustment.js +31 -0
  13. package/dist/components/editor/HAccordionDetails.d.ts +12 -0
  14. package/dist/components/editor/HAccordionDetails.js +183 -0
  15. package/dist/components/editor/HAccordionLight.d.ts +20 -0
  16. package/dist/components/editor/HAccordionLight.js +414 -0
  17. package/dist/components/editor/HAccordionPreset.d.ts +23 -0
  18. package/dist/components/editor/HAccordionPreset.js +52 -0
  19. package/dist/components/editor/HAlertBox.d.ts +8 -0
  20. package/dist/components/editor/HAlertBox.js +55 -0
  21. package/dist/components/editor/HAspectRatioMobile.d.ts +0 -0
  22. package/dist/components/editor/HAspectRatioMobile.js +1 -0
  23. package/dist/components/editor/HBulkAccordionColorAdjustment.d.ts +55 -0
  24. package/dist/components/editor/HBulkAccordionColorAdjustment.js +31 -0
  25. package/dist/components/editor/HBulkAccordionColorAdjustmentColors.d.ts +20 -0
  26. package/dist/components/editor/HBulkAccordionColorAdjustmentColors.js +121 -0
  27. package/dist/components/editor/HBulkAccordionColorAdjustmentDetails.d.ts +12 -0
  28. package/dist/components/editor/HBulkAccordionColorAdjustmentDetails.js +65 -0
  29. package/dist/components/editor/HBulkAccordionColorAdjustmentLight.d.ts +28 -0
  30. package/dist/components/editor/HBulkAccordionColorAdjustmentLight.js +177 -0
  31. package/dist/components/editor/HBulkColorAdjustmentMobile.d.ts +53 -0
  32. package/dist/components/editor/HBulkColorAdjustmentMobile.js +16 -0
  33. package/dist/components/editor/HBulkColorMobile.d.ts +20 -0
  34. package/dist/components/editor/HBulkColorMobile.js +121 -0
  35. package/dist/components/editor/HBulkDetailsMobile.d.ts +12 -0
  36. package/dist/components/editor/HBulkDetailsMobile.js +65 -0
  37. package/dist/components/editor/HBulkLightMobile.d.ts +28 -0
  38. package/dist/components/editor/HBulkLightMobile.js +192 -0
  39. package/dist/components/editor/HBulkPreset.d.ts +24 -0
  40. package/dist/components/editor/HBulkPreset.js +43 -0
  41. package/dist/components/editor/HBulkPresetMobile.d.ts +15 -0
  42. package/dist/components/editor/HBulkPresetMobile.js +26 -0
  43. package/dist/components/editor/HDialogBox.d.ts +18 -0
  44. package/dist/components/editor/HDialogBox.js +51 -0
  45. package/dist/components/editor/HDialogCopy.d.ts +41 -0
  46. package/dist/components/editor/HDialogCopy.js +80 -0
  47. package/dist/components/editor/HFooter.d.ts +12 -0
  48. package/dist/components/editor/HFooter.js +24 -0
  49. package/dist/components/editor/HHeaderEditor.d.ts +19 -0
  50. package/dist/components/editor/HHeaderEditor.js +36 -0
  51. package/dist/components/editor/HImageEditorBulkDekstop.d.ts +15 -0
  52. package/dist/components/editor/HImageEditorBulkDekstop.js +29 -0
  53. package/dist/components/editor/HImageEditorBulkMobile.d.ts +72 -0
  54. package/dist/components/editor/HImageEditorBulkMobile.js +81 -0
  55. package/dist/components/editor/HImageEditorDekstop.d.ts +15 -0
  56. package/dist/components/editor/HImageEditorDekstop.js +29 -0
  57. package/dist/components/editor/HImageEditorMobile.d.ts +53 -0
  58. package/dist/components/editor/HImageEditorMobile.js +92 -0
  59. package/dist/components/editor/HImageEditorMobileLayout.d.ts +14 -0
  60. package/dist/components/editor/HImageEditorMobileLayout.js +58 -0
  61. package/dist/components/editor/HModalEditorDekstop.d.ts +13 -0
  62. package/dist/components/editor/HModalEditorDekstop.js +22 -0
  63. package/dist/components/editor/HModalMobile.d.ts +13 -0
  64. package/dist/components/editor/HModalMobile.js +9 -0
  65. package/dist/components/editor/HPresetDelete.d.ts +7 -0
  66. package/dist/components/editor/HPresetDelete.js +7 -0
  67. package/dist/components/editor/HPresetOptionMenu.d.ts +9 -0
  68. package/dist/components/editor/HPresetOptionMenu.js +20 -0
  69. package/dist/components/editor/HSliderColorMobile.d.ts +16 -0
  70. package/dist/components/editor/HSliderColorMobile.js +270 -0
  71. package/dist/components/editor/HSliderDetailsMobile.d.ts +12 -0
  72. package/dist/components/editor/HSliderDetailsMobile.js +154 -0
  73. package/dist/components/editor/HSliderLightMobile.d.ts +20 -0
  74. package/dist/components/editor/HSliderLightMobile.js +420 -0
  75. package/dist/components/editor/HTabAspectRatioMobile.d.ts +0 -0
  76. package/dist/components/editor/HTabAspectRatioMobile.js +1 -0
  77. package/dist/components/editor/HTabColorAdjustmentMobile.d.ts +35 -0
  78. package/dist/components/editor/HTabColorAdjustmentMobile.js +8 -0
  79. package/dist/components/editor/HTabPresetMobile.d.ts +14 -0
  80. package/dist/components/editor/HTabPresetMobile.js +10 -0
  81. package/dist/components/editor/HTextField.d.ts +14 -0
  82. package/dist/components/editor/HTextField.js +51 -0
  83. package/dist/components/editor/HWatermarkView.d.ts +6 -0
  84. package/dist/components/editor/HWatermarkView.js +16 -0
  85. package/dist/components/editor/svg/Tick.d.ts +2 -0
  86. package/dist/components/editor/svg/Tick.js +6 -0
  87. package/dist/components/modal/HModalDialog.d.ts +12 -0
  88. package/dist/components/modal/HModalDialog.js +18 -0
  89. package/dist/components/modal/HModalRename.d.ts +14 -0
  90. package/dist/components/modal/HModalRename.js +35 -0
  91. package/dist/hooks/demo/HonchoEditorBulkDemo.d.ts +3 -0
  92. package/dist/hooks/demo/HonchoEditorBulkDemo.js +410 -0
  93. package/dist/hooks/demo/HonchoEditorSingleCleanDemo.d.ts +3 -0
  94. package/dist/hooks/demo/HonchoEditorSingleCleanDemo.js +354 -0
  95. package/dist/hooks/demo/index.d.ts +2 -0
  96. package/dist/hooks/demo/index.js +2 -0
  97. package/dist/hooks/editor/type.d.ts +174 -0
  98. package/dist/hooks/editor/type.js +1 -0
  99. package/dist/hooks/editor/useHonchoEditorBulk.d.ts +96 -0
  100. package/dist/hooks/editor/useHonchoEditorBulk.js +427 -0
  101. package/dist/hooks/editor/useHonchoEditorSingle.d.ts +44 -0
  102. package/dist/hooks/editor/useHonchoEditorSingle.js +163 -0
  103. package/dist/hooks/useAdjustmentHistory.d.ts +95 -0
  104. package/dist/hooks/useAdjustmentHistory.js +578 -0
  105. package/dist/hooks/useAdjustmentHistoryBatch.d.ts +177 -0
  106. package/dist/hooks/useAdjustmentHistoryBatch.js +1189 -0
  107. package/dist/hooks/useGallerySwipe.d.ts +36 -0
  108. package/dist/hooks/useGallerySwipe.js +344 -0
  109. package/dist/hooks/usePaging.d.ts +89 -0
  110. package/dist/hooks/usePaging.js +211 -0
  111. package/dist/hooks/usePreset.d.ts +82 -0
  112. package/dist/hooks/usePreset.js +344 -0
  113. package/dist/index.d.ts +39 -1474
  114. package/dist/index.js +44 -10960
  115. package/dist/lib/context/EditorContext.d.ts +28 -0
  116. package/dist/lib/context/EditorContext.js +60 -0
  117. package/dist/lib/context/EditorProcessingService.d.ts +36 -0
  118. package/dist/lib/context/EditorProcessingService.js +249 -0
  119. package/dist/lib/editor/honcho-editor.d.ts +324 -0
  120. package/dist/lib/editor/honcho-editor.js +825 -0
  121. package/dist/lib/hooks/useEditor.d.ts +22 -0
  122. package/dist/lib/hooks/useEditor.js +35 -0
  123. package/dist/lib/hooks/useEditorHeadless.d.ts +34 -0
  124. package/dist/lib/hooks/useEditorHeadless.js +207 -0
  125. package/dist/lib/hooks/useImageProcessor.d.ts +18 -0
  126. package/dist/lib/hooks/useImageProcessor.js +113 -0
  127. package/dist/setupTests.d.ts +1 -0
  128. package/dist/setupTests.js +1 -0
  129. package/dist/themes/colors.d.ts +12 -0
  130. package/dist/themes/colors.js +12 -0
  131. package/dist/themes/honchoTheme.d.ts +25 -0
  132. package/dist/themes/honchoTheme.js +94 -0
  133. package/dist/utils/adjustment.d.ts +6 -0
  134. package/dist/utils/adjustment.js +48 -0
  135. package/dist/utils/imageLoader.d.ts +11 -0
  136. package/dist/utils/imageLoader.js +48 -0
  137. package/dist/utils/isMobile.d.ts +1 -0
  138. package/dist/utils/isMobile.js +5 -0
  139. package/package.json +6 -12
  140. package/dist/index.d.mts +0 -1474
  141. package/dist/index.js.map +0 -1
  142. package/dist/index.mjs +0 -10939
  143. package/dist/index.mjs.map +0 -1
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/editor/honcho-editor.js","../src/index.ts","../src/hooks/editor/useHonchoEditorSingle.ts","../src/hooks/useAdjustmentHistory.ts","../src/hooks/useGallerySwipe.ts","../src/hooks/usePreset.ts","../src/hooks/editor/useHonchoEditorBulk.ts","../src/hooks/useAdjustmentHistoryBatch.ts","../src/utils/adjustment.ts","../src/hooks/usePaging.ts","../src/components/editor/HHeaderEditor.tsx","../src/themes/honchoTheme.ts","../src/themes/colors.ts","../src/utils/isMobile.tsx","../src/components/editor/HFooter.tsx","../src/components/editor/HAccordionColorAdjustment.tsx","../src/components/editor/HAccordionColor.tsx","../src/components/editor/HAccordionLight.tsx","../src/components/editor/HAccordionDetails.tsx","../src/components/editor/HAccordionPreset.tsx","../src/components/editor/HDialogBox.tsx","../src/components/editor/HDialogCopy.tsx","../src/components/editor/HImageEditorMobile.tsx","../src/components/editor/HSliderColorMobile.tsx","../src/components/editor/HSliderLightMobile.tsx","../src/components/editor/HSliderDetailsMobile.tsx","../src/components/editor/HTabColorAdjustmentMobile.tsx","../src/components/editor/HTabPresetMobile.tsx","../src/components/editor/HImageEditorDekstop.tsx","../src/components/editor/HImageEditorBulkDekstop.tsx","../src/components/editor/HImageEditorBulkMobile.tsx","../src/components/editor/HBulkColorMobile.tsx","../src/components/editor/HBulkLightMobile.tsx","../src/components/editor/HBulkDetailsMobile.tsx","../src/components/editor/HBulkColorAdjustmentMobile.tsx","../src/components/editor/HBulkPresetMobile.tsx","../src/components/editor/HBulkAccordionColorAdjustment.tsx","../src/components/editor/HBulkAccordionColorAdjustmentColors.tsx","../src/components/editor/HBulkAccordionColorAdjustmentLight.tsx","../src/components/editor/HBulkAccordionColorAdjustmentDetails.tsx","../src/components/editor/HBulkPreset.tsx","../src/components/editor/HModalEditorDekstop.tsx","../src/components/editor/HTextField.tsx","../src/components/editor/HWatermarkView.tsx","../src/components/editor/HModalMobile.tsx","../src/components/editor/HPresetOptionMenu.tsx","../src/components/editor/HAlertBox.tsx","../src/components/editor/GalleryAlbum/AlbumImageGallery.tsx","../src/components/editor/GalleryAlbum/ImageItem.tsx","../src/color.ts","../src/lib/context/EditorContext.tsx","../src/lib/hooks/useEditorHeadless.tsx","../src/utils/imageLoader.ts","../src/lib/context/EditorProcessingService.ts","../src/lib/hooks/useImageProcessor.tsx","../src/lib/hooks/useEditor.tsx","../src/components/modal/HModalDialog.tsx","../src/components/editor/HPresetDelete.tsx","../src/components/modal/HModalRename.tsx"],"sourcesContent":["/**\r\n * Honcho Photo Editor - JavaScript Wrapper\r\n * \r\n * This wrapper provides a clean interface to the C++ image processing engine.\r\n * \r\n * ARCHITECTURE: Dual-Path Processing\r\n * ================================\r\n * \r\n * FRONTEND (Real-time Preview):\r\n * - Uses GPU-to-GPU rendering via renderToCanvas()\r\n * - Zero memory copies for 60fps performance\r\n * - Optimized for interactive UI sliders\r\n * \r\n * BACKEND (Server Processing):\r\n * - Uses CPU memory path via getProcessedImageData()\r\n * - Full quality data export for server workflows\r\n * - Headless processing without WebGL context\r\n * - Batch processing and API endpoints\r\n * \r\n * Both paths use the same C++ processing core with identical results.\r\n * JavaScript handles all UI and canvas rendering.\r\n * C++ handles all image processing algorithms.\r\n */\r\n\r\n// Adjustment ranges for UI components\r\nconst ADJUSTMENT_RANGES = {\r\n temperature: { min: -100, max: 100, default: 0, step: 1 },\r\n tint: { min: -100, max: 100, default: 0, step: 1 },\r\n saturation: { min: -100, max: 100, default: 0, step: 1 },\r\n vibrance: { min: -100, max: 100, default: 0, step: 1 },\r\n exposure: { min: -100, max: 100, default: 0, step: 1 },\r\n contrast: { min: -100, max: 100, default: 0, step: 1 },\r\n highlights: { min: -100, max: 100, default: 0, step: 1 },\r\n shadows: { min: -100, max: 100, default: 0, step: 1 },\r\n whites: { min: -100, max: 100, default: 0, step: 1 },\r\n blacks: { min: -100, max: 100, default: 0, step: 1 },\r\n clarity: { min: -100, max: 100, default: 0, step: 1 },\r\n sharpness: { min: -100, max: 100, default: 0, step: 1 }\r\n};\r\n\r\nclass HonchoEditor {\r\n constructor() {\r\n this.wasmModule = null;\r\n this.isInitialized = false;\r\n this.currentImageData = null;\r\n this.canvas = null;\r\n this.currentWidth = 0;\r\n this.currentHeight = 0;\r\n }\r\n\r\n /**\r\n * Initialize the WASM module\r\n * @param {boolean} verbose - Enable verbose logging (default: false)\r\n */\r\n async initialize(verbose = false) {\r\n try {\r\n console.log('Initializing Honcho Photo Editor...');\r\n \r\n // Create a hidden canvas for WebGL context that C++ can find\r\n this.canvas = document.createElement('canvas');\r\n this.canvas.width = 1;\r\n this.canvas.height = 1;\r\n this.canvas.style.display = 'none';\r\n this.canvas.id = 'canvas'; // Use standard ID that C++ looks for\r\n document.body.appendChild(this.canvas);\r\n \r\n // Load the WASM module - Module is a factory function\r\n if (typeof Module !== 'undefined') {\r\n // Configure the module with the canvas\r\n this.wasmModule = await Module({\r\n canvas: this.canvas,\r\n noExitRuntime: true,\r\n noInitialRun: true\r\n });\r\n } else {\r\n throw new Error('WASM module not found - make sure to load honcho-editor.js first');\r\n }\r\n \r\n // Create the processor instance with verbose flag (this will initialize OpenGL)\r\n console.log('Creating processor...');\r\n \r\n // Check if the function exists first\r\n if (this.wasmModule && typeof this.wasmModule._createProcessor === 'function') {\r\n this.wasmModule._createProcessor(verbose);\r\n console.log('Successfully created processor with verbose =', verbose);\r\n } else {\r\n console.error('_createProcessor function not found!');\r\n if (this.wasmModule) {\r\n console.log('Available functions:', Object.keys(this.wasmModule));\r\n }\r\n throw new Error('_createProcessor function not available');\r\n }\r\n \r\n this.isInitialized = true;\r\n console.log('Honcho Photo Editor initialized successfully');\r\n \r\n return true;\r\n } catch (error) {\r\n console.error('Failed to initialize Honcho Photo Editor:', error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Clean up resources before loading a new image\r\n */\r\n cleanupForNewImage() {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n return;\r\n }\r\n\r\n try {\r\n // Reset any internal state\r\n this.currentImageData = null;\r\n this.currentWidth = 0;\r\n this.currentHeight = 0;\r\n \r\n // Call C++ cleanup if available\r\n if (typeof this.wasmModule._resetProcessor === 'function') {\r\n this.wasmModule._resetProcessor();\r\n }\r\n \r\n console.log('Cleaned up for new image');\r\n } catch (error) {\r\n console.warn('Warning during cleanup:', error);\r\n }\r\n }\r\n\r\n /**\r\n * Load image from File object (drag & drop, file input)\r\n */\r\n async loadImageFromFile(file) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n // Clean up before loading new image\r\n this.cleanupForNewImage();\r\n\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n \r\n reader.onload = (e) => {\r\n const img = new Image();\r\n \r\n img.onload = () => {\r\n try {\r\n const size = this.loadImageFromImageElement(img);\r\n resolve(size);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n };\r\n \r\n img.onerror = () => {\r\n reject(new Error('Failed to load image'));\r\n };\r\n \r\n img.src = e.target.result;\r\n };\r\n \r\n reader.onerror = () => {\r\n reject(new Error('Failed to read file'));\r\n };\r\n \r\n reader.readAsDataURL(file);\r\n });\r\n }\r\n\r\n /**\r\n * Load image from URL\r\n */\r\n async loadImageFromUrl(url) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n // Clean up before loading new image\r\n this.cleanupForNewImage();\r\n\r\n return new Promise((resolve, reject) => {\r\n const img = new Image();\r\n \r\n img.onload = () => {\r\n try {\r\n const size = this.loadImageFromImageElement(img);\r\n resolve(size);\r\n } catch (error) {\r\n reject(error);\r\n }\r\n };\r\n \r\n img.onerror = () => {\r\n reject(new Error('Failed to load image from URL'));\r\n };\r\n \r\n img.crossOrigin = 'anonymous'; // Enable CORS\r\n img.src = url;\r\n });\r\n }\r\n\r\n /**\r\n * Load image from HTML Image element\r\n */\r\n loadImageFromImageElement(img) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n // Clean up before loading new image\r\n this.cleanupForNewImage();\r\n\r\n // Create canvas to extract image data\r\n const canvas = document.createElement('canvas');\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n \r\n const ctx = canvas.getContext('2d');\r\n if (!ctx) {\r\n throw new Error('Failed to get 2D context');\r\n }\r\n \r\n ctx.drawImage(img, 0, 0);\r\n const imageData = ctx.getImageData(0, 0, img.width, img.height);\r\n \r\n return this.loadImageFromImageData(imageData);\r\n }\r\n\r\n /**\r\n * Load image from ImageData\r\n */\r\n loadImageFromImageData(imageData) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n // Clean up before loading new image (only if we have existing image data)\r\n if (this.currentImageData) {\r\n this.cleanupForNewImage();\r\n }\r\n\r\n try {\r\n // Validate input\r\n if (!imageData || !imageData.data || imageData.width <= 0 || imageData.height <= 0) {\r\n throw new Error('Invalid image data provided');\r\n }\r\n\r\n this.currentImageData = imageData;\r\n this.currentWidth = imageData.width;\r\n this.currentHeight = imageData.height;\r\n \r\n // Allocate memory in WASM\r\n const dataSize = imageData.data.length;\r\n const expectedSize = imageData.width * imageData.height * 4; // RGBA\r\n \r\n if (dataSize !== expectedSize) {\r\n throw new Error(`Image data size mismatch: expected ${expectedSize}, got ${dataSize}`);\r\n }\r\n \r\n console.log(`Allocating ${dataSize} bytes for ${imageData.width}x${imageData.height} image`);\r\n const dataPtr = this.wasmModule._malloc(dataSize);\r\n \r\n if (!dataPtr) {\r\n throw new Error('Failed to allocate memory in WASM');\r\n }\r\n \r\n // Copy image data to WASM memory\r\n this.wasmModule.HEAPU8.set(imageData.data, dataPtr);\r\n \r\n // Set image data in C++\r\n const result = this.wasmModule._setImageData(dataPtr, imageData.width, imageData.height, 4);\r\n \r\n // Free allocated memory\r\n this.wasmModule._free(dataPtr);\r\n \r\n if (!result) {\r\n throw new Error('C++ setImageData failed');\r\n }\r\n \r\n console.log(`Image loaded successfully: ${imageData.width}x${imageData.height}`);\r\n \r\n return {\r\n width: imageData.width,\r\n height: imageData.height\r\n };\r\n \r\n } catch (error) {\r\n console.error('Failed to load image data:', error);\r\n throw error;\r\n }\r\n }\r\n\r\n // Adjustment methods (all auto-trigger re-render)\r\n setExposure(value) {\r\n this.validateAdjustment('exposure', value);\r\n this.wasmModule?._setExposure(value);\r\n }\r\n\r\n setContrast(value) {\r\n this.validateAdjustment('contrast', value);\r\n this.wasmModule?._setContrast(value);\r\n }\r\n\r\n setHighlights(value) {\r\n this.validateAdjustment('highlights', value);\r\n this.wasmModule?._setHighlights(value);\r\n }\r\n\r\n setShadows(value) {\r\n this.validateAdjustment('shadows', value);\r\n this.wasmModule?._setShadows(value);\r\n }\r\n\r\n setSaturation(value) {\r\n this.validateAdjustment('saturation', value);\r\n this.wasmModule?._setSaturation(value);\r\n }\r\n\r\n setVibrance(value) {\r\n this.validateAdjustment('vibrance', value);\r\n this.wasmModule?._setVibrance(value);\r\n }\r\n\r\n setTemperature(value) {\r\n this.validateAdjustment('temperature', value);\r\n this.wasmModule?._setTemperature(value);\r\n }\r\n\r\n setTint(value) {\r\n this.validateAdjustment('tint', value);\r\n this.wasmModule?._setTint(value);\r\n }\r\n\r\n setBlacks(value) {\r\n this.validateAdjustment('blacks', value);\r\n if (this.wasmModule && typeof this.wasmModule._setBlacks === 'function') {\r\n this.wasmModule._setBlacks(value);\r\n } else {\r\n console.warn('setBlacks not available in current WASM build');\r\n }\r\n }\r\n\r\n setWhites(value) {\r\n this.validateAdjustment('whites', value);\r\n if (this.wasmModule && typeof this.wasmModule._setWhites === 'function') {\r\n this.wasmModule._setWhites(value);\r\n } else {\r\n console.warn('setWhites not available in current WASM build');\r\n }\r\n }\r\n\r\n setClarity(value) {\r\n this.validateAdjustment('clarity', value);\r\n if (this.wasmModule && typeof this.wasmModule._setClarity === 'function') {\r\n this.wasmModule._setClarity(value);\r\n } else {\r\n console.warn('setClarity not available in current WASM build');\r\n }\r\n }\r\n\r\n setSharpness(value) {\r\n this.validateAdjustment('sharpness', value);\r\n if (this.wasmModule && typeof this.wasmModule._setSharpness === 'function') {\r\n this.wasmModule._setSharpness(value);\r\n } else {\r\n console.warn('setSharpness not available in current WASM build');\r\n }\r\n }\r\n\r\n /**\r\n * Set multiple adjustments at once\r\n */\r\n setAdjustments(adjustments) {\r\n Object.entries(adjustments).forEach(([key, value]) => {\r\n if (value !== undefined) {\r\n const methodName = `set${key.charAt(0).toUpperCase() + key.slice(1)}`;\r\n if (typeof this[methodName] === 'function') {\r\n this[methodName](value);\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Reset all adjustments to default values\r\n */\r\n resetAdjustments() {\r\n this.wasmModule?._resetAdjustments();\r\n }\r\n\r\n // ==========================================\r\n // FRAME FUNCTIONALITY - NEW FEATURE\r\n // ==========================================\r\n\r\n /**\r\n * Set a frame overlay from raw image data\r\n * @param {Uint8Array} data - Raw RGBA image data\r\n * @param {number} width - Frame width\r\n * @param {number} height - Frame height\r\n * @param {number} channels - Number of channels (usually 4 for RGBA)\r\n * @returns {boolean} - true if frame was set successfully\r\n */\r\n setFrame(data, width, height, channels = 4) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n if (!this.currentImageData) {\r\n throw new Error('No image loaded. Load an image first before setting frame.');\r\n }\r\n\r\n try {\r\n // Allocate memory in WASM for frame data\r\n const frameSize = width * height * channels;\r\n const framePtr = this.wasmModule._malloc(frameSize);\r\n \r\n if (!framePtr) {\r\n throw new Error('Failed to allocate memory for frame data');\r\n }\r\n\r\n // Copy frame data to WASM memory\r\n this.wasmModule.HEAPU8.set(data, framePtr);\r\n\r\n // Call native setFrame function\r\n const success = this.wasmModule._setFrame(framePtr, width, height, channels);\r\n \r\n // Free allocated memory\r\n this.wasmModule._free(framePtr);\r\n\r\n if (success) {\r\n console.log(`✅ Frame set: ${width}x${height}`);\r\n return true;\r\n } else {\r\n console.error('❌ Failed to set frame');\r\n return false;\r\n }\r\n } catch (error) {\r\n console.error('Error setting frame:', error);\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Set a frame overlay from an ImageData object\r\n * The frame will be scaled to match the image size and composited on top\r\n * @param {ImageData} frameImageData - Frame image data (preferably with alpha channel)\r\n * @returns {boolean} - true if frame was set successfully\r\n */\r\n setFrameFromImageData(frameImageData) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n if (!this.currentImageData) {\r\n throw new Error('No image loaded. Load an image first before setting frame.');\r\n }\r\n\r\n try {\r\n const { width, height, data } = frameImageData;\r\n \r\n // Allocate memory in WASM for frame data\r\n const frameSize = width * height * 4; // RGBA\r\n const framePtr = this.wasmModule._malloc(frameSize);\r\n \r\n if (!framePtr) {\r\n throw new Error('Failed to allocate memory for frame data');\r\n }\r\n\r\n // Copy frame data to WASM memory\r\n this.wasmModule.HEAPU8.set(data, framePtr);\r\n\r\n // Call native setFrame function\r\n const success = this.wasmModule._setFrame(framePtr, width, height, 4);\r\n \r\n // Free allocated memory\r\n this.wasmModule._free(framePtr);\r\n\r\n if (success) {\r\n console.log(`✅ Frame set: ${width}x${height}`);\r\n return true;\r\n } else {\r\n console.error('❌ Failed to set frame');\r\n return false;\r\n }\r\n } catch (error) {\r\n console.error('Error setting frame:', error);\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Set a frame overlay from an HTML Image element\r\n * @param {HTMLImageElement} frameImage - Frame image element\r\n * @returns {boolean} - true if frame was set successfully\r\n */\r\n setFrameFromImage(frameImage) {\r\n if (!frameImage.complete) {\r\n throw new Error('Frame image not loaded. Wait for image.onload before calling this method.');\r\n }\r\n\r\n // Create a canvas to extract ImageData\r\n const tempCanvas = document.createElement('canvas');\r\n const tempCtx = tempCanvas.getContext('2d');\r\n \r\n tempCanvas.width = frameImage.width || frameImage.naturalWidth;\r\n tempCanvas.height = frameImage.height || frameImage.naturalHeight;\r\n \r\n // Draw frame image to canvas\r\n tempCtx.drawImage(frameImage, 0, 0);\r\n \r\n // Extract ImageData\r\n const frameImageData = tempCtx.getImageData(0, 0, tempCanvas.width, tempCanvas.height);\r\n \r\n return this.setFrameFromImageData(frameImageData);\r\n }\r\n\r\n /**\r\n * Set a frame overlay from a Canvas element\r\n * @param {HTMLCanvasElement} frameCanvas - Frame canvas element\r\n * @returns {boolean} - true if frame was set successfully\r\n */\r\n setFrameFromCanvas(frameCanvas) {\r\n const ctx = frameCanvas.getContext('2d');\r\n const frameImageData = ctx.getImageData(0, 0, frameCanvas.width, frameCanvas.height);\r\n return this.setFrameFromImageData(frameImageData);\r\n }\r\n\r\n /**\r\n * Clear the current frame overlay\r\n */\r\n clearFrame() {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n if (this.wasmModule._clearFrame) {\r\n this.wasmModule._clearFrame();\r\n console.log('🧹 Frame cleared');\r\n }\r\n }\r\n\r\n /**\r\n * Check if a frame is currently set\r\n * @returns {boolean} - true if a frame is set\r\n */\r\n hasFrame() {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n return false;\r\n }\r\n\r\n return this.wasmModule._hasFrame ? this.wasmModule._hasFrame() : false;\r\n }\r\n\r\n // ==========================================\r\n // CONVENIENCE METHODS\r\n // ==========================================\r\n\r\n /**\r\n * One-shot processing: load image, apply adjustments, get result\r\n * Most efficient for single image processing or batch operations\r\n * \r\n * @param {File|ImageData|HTMLImageElement} imageSource - Image source (File, ImageData, or Image element)\r\n * @param {Object} adjustments - Object containing adjustment values (-100 to 100)\r\n * @param {File|ImageData|HTMLImageElement|null} frameSource - Optional frame source\r\n * @returns {ImageData} - Processed image data\r\n * \r\n * @example\r\n * // Basic usage\r\n * const result = await editor.processImageOneShot(imageFile, {\r\n * exposure: 20,\r\n * contrast: 15,\r\n * saturation: 10\r\n * });\r\n * \r\n * // With frame\r\n * const result = await editor.processImageOneShot(imageFile, {\r\n * exposure: 20,\r\n * contrast: 15\r\n * }, frameFile);\r\n * \r\n * // All adjustments\r\n * const result = await editor.processImageOneShot(imageFile, {\r\n * temperature: 10,\r\n * tint: -5,\r\n * exposure: 20,\r\n * contrast: 15,\r\n * highlights: -20,\r\n * shadows: 30,\r\n * saturation: 25,\r\n * vibrance: 20,\r\n * whites: 10,\r\n * blacks: -10,\r\n * clarity: 15,\r\n * sharpness: 20\r\n * });\r\n */\r\n async processImageOneShot(\r\n imageSource, \r\n adjustments = {}, \r\n frameSource = null\r\n ) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n try {\r\n // Step 1: Load the image\r\n console.log('📁 Loading image for one-shot processing...');\r\n let imageSize;\r\n \r\n if (imageSource instanceof File) {\r\n imageSize = await this.loadImageFromFile(imageSource);\r\n } else if (imageSource instanceof ImageData) {\r\n imageSize = this.loadImageFromImageData(imageSource);\r\n } else if (imageSource instanceof HTMLImageElement) {\r\n imageSize = this.loadImageFromImageElement(imageSource);\r\n } else {\r\n throw new Error('Unsupported image source type. Use File, ImageData, or HTMLImageElement.');\r\n }\r\n\r\n console.log(`✅ Image loaded: ${imageSize.width}×${imageSize.height}`);\r\n\r\n // Step 2: Apply frame if provided\r\n if (frameSource) {\r\n console.log('🖼️ Applying frame...');\r\n \r\n if (frameSource instanceof File) {\r\n await this.setFrameFromFile(frameSource);\r\n } else if (frameSource instanceof ImageData) {\r\n this.setFrameFromImageData(frameSource);\r\n } else if (frameSource instanceof HTMLImageElement) {\r\n this.setFrameFromImage(frameSource);\r\n } else {\r\n throw new Error('Unsupported frame source type. Use File, ImageData, or HTMLImageElement.');\r\n }\r\n \r\n console.log('✅ Frame applied successfully');\r\n }\r\n\r\n // Step 3: Apply all adjustments\r\n console.log('🎛️ Applying adjustments:', adjustments);\r\n const validAdjustments = [\r\n 'temperature', 'tint', 'exposure', 'contrast', 'highlights', \r\n 'shadows', 'saturation', 'vibrance', 'whites', 'blacks', \r\n 'clarity', 'sharpness'\r\n ];\r\n\r\n validAdjustments.forEach(name => {\r\n if (adjustments[name] !== undefined) {\r\n const methodName = `set${name.charAt(0).toUpperCase() + name.slice(1)}`;\r\n if (typeof this[methodName] === 'function') {\r\n this[methodName](adjustments[name]);\r\n }\r\n }\r\n });\r\n\r\n // Step 4: Process the image\r\n console.log('⚙️ Processing image...');\r\n this.processImage();\r\n\r\n // Step 5: Get the processed result\r\n console.log('📤 Exporting processed image data...');\r\n const result = this.getProcessedImageData();\r\n\r\n console.log('✅ One-shot processing complete');\r\n return result;\r\n\r\n } catch (error) {\r\n console.error('❌ One-shot processing failed:', error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Helper method to load frame from File (for processImageOneShot)\r\n */\r\n async setFrameFromFile(frameFile) {\r\n return new Promise((resolve, reject) => {\r\n const img = new Image();\r\n \r\n img.onload = () => {\r\n try {\r\n this.setFrameFromImage(img);\r\n resolve();\r\n } catch (error) {\r\n reject(error);\r\n }\r\n };\r\n \r\n img.onerror = () => reject(new Error('Failed to load frame image'));\r\n \r\n const reader = new FileReader();\r\n reader.onload = (e) => {\r\n img.src = e.target.result;\r\n };\r\n reader.onerror = () => reject(new Error('Failed to read frame file'));\r\n reader.readAsDataURL(frameFile);\r\n });\r\n }\r\n\r\n /**\r\n * Manual processing trigger - call this after setting adjustments\r\n */\r\n processImage() {\r\n if (this.wasmModule && typeof this.wasmModule._processImage === 'function') {\r\n this.wasmModule._processImage();\r\n } else {\r\n console.warn('processImage not available in current WASM build');\r\n }\r\n }\r\n\r\n /**\r\n * GPU Path: Render to canvas for real-time preview (<1ms)\r\n */\r\n renderToCanvas(canvas) {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n if (!this.currentImageData) {\r\n throw new Error('No image loaded');\r\n }\r\n\r\n try {\r\n // Resize canvas to match image if needed\r\n if (canvas.width !== this.currentWidth || canvas.height !== this.currentHeight) {\r\n canvas.width = this.currentWidth;\r\n canvas.height = this.currentHeight;\r\n }\r\n\r\n // Update the C++ canvas size to match our target canvas\r\n if (this.canvas) {\r\n this.canvas.width = this.currentWidth;\r\n this.canvas.height = this.currentHeight;\r\n }\r\n\r\n // Trigger GPU rendering in C++\r\n this.wasmModule._renderToDisplay();\r\n\r\n // Copy from C++ canvas to target canvas\r\n const ctx = canvas.getContext('2d');\r\n if (ctx && this.canvas) {\r\n ctx.drawImage(this.canvas, 0, 0);\r\n }\r\n\r\n } catch (error) {\r\n console.error('Failed to render to canvas:', error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * CPU Path: Get processed image data for export (50-100ms)\r\n */\r\n getProcessedImageData() {\r\n if (!this.isInitialized || !this.wasmModule) {\r\n throw new Error('Editor not initialized');\r\n }\r\n\r\n if (!this.currentImageData) {\r\n throw new Error('No image loaded');\r\n }\r\n\r\n try {\r\n // Get processed image data from C++\r\n const dataPtr = this.wasmModule._getProcessedImageData();\r\n \r\n if (dataPtr === 0) {\r\n throw new Error('Failed to get processed image data');\r\n }\r\n\r\n // Copy data from WASM memory\r\n const dataSize = this.currentWidth * this.currentHeight * 4;\r\n const processedData = new Uint8ClampedArray(dataSize);\r\n processedData.set(this.wasmModule.HEAPU8.subarray(dataPtr, dataPtr + dataSize));\r\n\r\n // Create ImageData object\r\n const imageData = new ImageData(processedData, this.currentWidth, this.currentHeight);\r\n \r\n return imageData;\r\n\r\n } catch (error) {\r\n console.error('Failed to get processed image data:', error);\r\n throw error;\r\n }\r\n }\r\n\r\n /**\r\n * Get current image dimensions\r\n */\r\n getImageSize() {\r\n return {\r\n width: this.currentWidth,\r\n height: this.currentHeight\r\n };\r\n }\r\n\r\n /**\r\n * Get current image width\r\n */\r\n getWidth() {\r\n return this.currentWidth || 0;\r\n }\r\n\r\n /**\r\n * Get current image height\r\n */\r\n getHeight() {\r\n return this.currentHeight || 0;\r\n }\r\n\r\n /**\r\n * Check if editor is initialized\r\n */\r\n getInitialized() {\r\n return this.isInitialized;\r\n }\r\n\r\n /**\r\n * Get raw WASM module (advanced usage)\r\n */\r\n getRawModule() {\r\n return this.wasmModule;\r\n }\r\n\r\n /**\r\n * Validate adjustment value against range\r\n */\r\n validateAdjustment(name, value) {\r\n const range = ADJUSTMENT_RANGES[name];\r\n if (!range) {\r\n throw new Error(`Unknown adjustment: ${name}`);\r\n }\r\n if (value < range.min || value > range.max) {\r\n throw new Error(`${name} value ${value} out of range [${range.min}, ${range.max}]`);\r\n }\r\n }\r\n\r\n /**\r\n * Cleanup resources\r\n */\r\n cleanup() {\r\n if (this.wasmModule) {\r\n this.wasmModule._destroyProcessor();\r\n }\r\n \r\n if (this.canvas && this.canvas.parentNode) {\r\n this.canvas.parentNode.removeChild(this.canvas);\r\n }\r\n \r\n this.isInitialized = false;\r\n this.wasmModule = null;\r\n this.currentImageData = null;\r\n this.canvas = null;\r\n }\r\n}\r\n\r\n// Export for convenience\r\n// export default HonchoEditor; // Disabled for browser compatibility\r\n\r\n// Helper functions for common operations\r\nconst HonchoEditorUtils = {\r\n /**\r\n * Convert ImageData to Blob for download\r\n */\r\n async imageDataToBlob(imageData, format = 'jpeg', quality = 0.9) {\r\n const canvas = document.createElement('canvas');\r\n canvas.width = imageData.width;\r\n canvas.height = imageData.height;\r\n \r\n const ctx = canvas.getContext('2d');\r\n if (!ctx) {\r\n throw new Error('Failed to get 2D context');\r\n }\r\n \r\n ctx.putImageData(imageData, 0, 0);\r\n \r\n const mimeType = `image/${format}`;\r\n return new Promise((resolve, reject) => {\r\n canvas.toBlob((blob) => {\r\n if (blob) {\r\n resolve(blob);\r\n } else {\r\n reject(new Error('Failed to create blob'));\r\n }\r\n }, mimeType, quality);\r\n });\r\n },\r\n\r\n /**\r\n * Download blob as file\r\n */\r\n downloadBlob(blob, filename) {\r\n const url = URL.createObjectURL(blob);\r\n const a = document.createElement('a');\r\n a.href = url;\r\n a.download = filename;\r\n a.click();\r\n URL.revokeObjectURL(url);\r\n },\r\n\r\n /**\r\n * Create debounced function for performance optimization\r\n */\r\n debounce(func, wait) {\r\n let timeout;\r\n return function executedFunction(...args) {\r\n const later = () => {\r\n clearTimeout(timeout);\r\n func(...args);\r\n };\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n };\r\n },\r\n\r\n /**\r\n * Validate image file type\r\n */\r\n isValidImageFile(file) {\r\n const validTypes = ['image/jpeg', 'image/png', 'image/webp', 'image/gif', 'image/bmp'];\r\n return validTypes.includes(file.type);\r\n },\r\n\r\n /**\r\n * Get file size in human readable format\r\n */\r\n formatFileSize(bytes) {\r\n if (bytes === 0) return '0 Bytes';\r\n const k = 1024;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\r\n }\r\n};\r\n\r\n// Export for both Node.js and browser\r\nif (typeof module !== 'undefined' && module.exports) {\r\n module.exports = { HonchoEditor, HonchoEditorUtils, ADJUSTMENT_RANGES };\r\n} else {\r\n window.HonchoEditor = HonchoEditor;\r\n window.HonchoEditorUtils = HonchoEditorUtils;\r\n window.ADJUSTMENT_RANGES = ADJUSTMENT_RANGES;\r\n}\r\n","// START: delete later\r\n// export { HonchoEditorBulkDemo } from './hooks/demo/HonchoEditorBulkDemo';\r\n// export { HonchoEditorSingleCleanDemo } from './hooks/demo/HonchoEditorSingleCleanDemo';\r\n// END\r\n\r\nexport { useHonchoEditorSingle } from './hooks/editor/useHonchoEditorSingle.js';\r\nexport { useHonchoEditorBulk } from './hooks/editor/useHonchoEditorBulk.js';\r\nexport type {\r\n Controller,\r\n AdjustmentState,\r\n Preset,\r\n ImageItem,\r\n ColorAdjustment,\r\n CreateEditorTaskRequest,\r\n EditorHistoryEntry,\r\n GetGalleryUpdateTimestampResponse,\r\n GetHistoryResponse,\r\n} from './hooks/editor/type.js';\r\nexport type { \r\n PhotoData \r\n} from './hooks/editor/useHonchoEditorBulk.js';\r\n\r\nexport type { Gallery, Content } from './hooks/editor/type.js';\r\nexport { default as HHeaderEditor } from './components/editor/HHeaderEditor.js';\r\nexport { default as HFooter } from './components/editor/HFooter.js';\r\nexport { default as HAccordionColorAdjustment } from './components/editor/HAccordionColorAdjustment.js';\r\nexport { default as HAccordionPreset } from './components/editor/HAccordionPreset.js';\r\nexport { HBaseDialog, HDialogForPreset } from './components/editor/HDialogBox.js';\r\nexport { HDialogCopy, HDialogPreset } from './components/editor/HDialogCopy.js';\r\nexport { default as HImageEditorMobile } from './components/editor/HImageEditorMobile.js';\r\nexport { default as HImageEditorDesktop } from './components/editor/HImageEditorDekstop.js';\r\nexport { default as HImageEditorBulkDekstop } from './components/editor/HImageEditorBulkDekstop.js';\r\nexport { default as HImageEditorBulkMobile } from './components/editor/HImageEditorBulkMobile.js';\r\nexport { default as HBulkAccordionColorAdjustment } from './components/editor/HBulkAccordionColorAdjustment.js';\r\nexport { default as HBulkPreset } from './components/editor/HBulkPreset.js';\r\nexport { default as HModalEditorDekstop } from './components/editor/HModalEditorDekstop.js';\r\nexport { HTextField, HTextFieldRename } from './components/editor/HTextField.js';\r\nexport { default as HWatermarkView } from './components/editor/HWatermarkView.js';\r\nexport { default as HModalMobile } from './components/editor/HModalMobile.js';\r\nexport { default as HPresetOptionsMenu } from './components/editor/HPresetOptionMenu.js';\r\nexport { HAlertInternetBox, HAlertCopyBox, HAlertInternetConnectionBox, HAlertPresetSave } from './components/editor/HAlertBox.js';\r\nexport { AlbumImageGallery } from './components/editor/GalleryAlbum/AlbumImageGallery.js';\r\nexport { default as GalleryImageItem } from './components/editor/GalleryAlbum/ImageItem.js';\r\nexport { EditorProvider, useEditorContext } from './lib/context/EditorContext.js';\r\nexport { useImageProcessor } from './lib/hooks/useImageProcessor.js';\r\nexport { useEditorHeadless } from './lib/hooks/useEditorHeadless.js';\r\nexport { ImageSize, HonchoEditor, AdjustmentValues, AdjustmentRange, AdjustmentRanges } from './lib/editor/honcho-editor.js'\r\nexport { default as HPresetDeleteDialog } from './components/editor/HPresetDelete.js';\r\nexport { default as HModalDialog } from './components/modal/HModalDialog.js';\r\nexport { default as HModalRename } from './components/modal/HModalRename.js';\r\n\r\n// --- History Hooks ---\r\nexport { \r\n useAdjustmentHistory,\r\n type UseAdjustmentHistoryReturn,\r\n type HistoryInfo,\r\n type HistoryActions,\r\n type HistoryConfig\r\n} from './hooks/useAdjustmentHistory.js';\r\nexport { \r\n useAdjustmentHistoryBatch,\r\n type UseAdjustmentHistoryBatchReturn,\r\n type BatchAdjustmentState,\r\n type ImageAdjustmentConfig,\r\n type BatchHistoryInfo,\r\n type BatchHistoryActions,\r\n type BatchHistoryConfig\r\n} from './hooks/useAdjustmentHistoryBatch.js';\r\n\r\n// --- Preset Hook ---\r\nexport {\r\n usePreset,\r\n type UsePresetReturn,\r\n type PresetInfo,\r\n type PresetActions,\r\n type PresetOptions\r\n} from './hooks/usePreset.js';\r\n\r\n// --- Paging Hook ---\r\nexport {\r\n usePaging,\r\n type UsePagingReturn,\r\n type PagingInfo,\r\n type PagingActions,\r\n type PagingOptions\r\n} from './hooks/usePaging.js';\r\n\r\n// --- Theme & Utils ---\r\nexport { default as useColors } from './themes/colors.js';\r\nexport { default as useHonchoTypography } from './themes/honchoTheme.js';\r\nexport { default as useIsMobile } from './utils/isMobile.js';\r\n","'use client';\r\n\r\nimport { useState, useEffect, useCallback, useMemo } from 'react';\r\nimport { HistoryOptions, useAdjustmentHistory } from '../useAdjustmentHistory';\r\nimport { useGallerySwipe } from '../useGallerySwipe';\r\nimport { usePreset } from '../usePreset';\r\nimport { Controller, AdjustmentState, Preset } from './type';\r\nimport { Gallery } from './type';\r\nimport { AdjustmentValues } from '../../lib/editor/honcho-editor';\r\n\r\n// Default adjustment values\r\nconst initialAdjustments: AdjustmentState = {\r\n tempScore: 0, tintScore: 0, vibranceScore: 0, saturationScore: 0,\r\n exposureScore: 0, highlightsScore: 0, shadowsScore: 0, whitesScore: 0,\r\n blacksScore: 0, contrastScore: 0, clarityScore: 0, sharpnessScore: 0,\r\n};\r\n\r\nexport interface UseHonchoEditorSingleOptions {\r\n controller: Controller;\r\n initImageId: string;\r\n firebaseUid: string;\r\n}\r\n\r\nexport interface UseHonchoEditorSingleState {\r\n // Image state\r\n currentImageData: Gallery | null;\r\n isGalleryLoading: boolean;\r\n galleryError: string | null;\r\n \r\n // Adjustment state\r\n currentAdjustments: AdjustmentState;\r\n isBatchMode: boolean;\r\n canUndo: boolean;\r\n canRedo: boolean;\r\n \r\n // Navigation state\r\n isNextAvailable: boolean;\r\n isPrevAvailable: boolean;\r\n \r\n // Preset state\r\n presets: Preset[];\r\n activePreset: Preset | null;\r\n presetsLoading: boolean;\r\n presetsError: string | null;\r\n}\r\n\r\nexport interface UseHonchoEditorSingleActions {\r\n // Navigation\r\n navigateNext: () => void;\r\n navigatePrev: () => void;\r\n \r\n // Adjustments\r\n updateAdjustment: (field: keyof AdjustmentState, value: number) => void;\r\n setBatchMode: (enabled: boolean) => void;\r\n startBatchMode: () => void;\r\n endBatchMode: () => void;\r\n \r\n // History\r\n undo: () => void;\r\n redo: () => void;\r\n reset: () => void;\r\n \r\n // Presets\r\n loadPresets: () => Promise<void>;\r\n applyPreset: (preset: Preset) => void;\r\n createPreset: (name: string, adjustments: AdjustmentState) => Promise<Preset | null>;\r\n renamePreset: (presetId: string, newName: string) => Promise<boolean>;\r\n deletePreset: (presetId: string) => Promise<void>;\r\n \r\n // Adjustment conversion for editor\r\n getEditorAdjustments: () => AdjustmentValues;\r\n}\r\n\r\nexport function useHonchoEditorSingle({\r\n controller,\r\n initImageId,\r\n firebaseUid\r\n}: UseHonchoEditorSingleOptions) {\r\n // Memoize parameters to prevent unnecessary re-renders\r\n const memoizedController = useMemo(() => controller, [controller]);\r\n const memoizedInitImageId = useMemo(() => initImageId, [initImageId]);\r\n const memoizedFirebaseUid = useMemo(() => firebaseUid, [firebaseUid]);\r\n\r\n // Initialize business logic hooks only\r\n const adjustmentHistory = useAdjustmentHistory(initialAdjustments, memoizedController, memoizedFirebaseUid, memoizedInitImageId);\r\n const gallerySwipe = useGallerySwipe(memoizedFirebaseUid, memoizedInitImageId, memoizedController);\r\n const presetHook = usePreset(memoizedController, memoizedFirebaseUid, { autoLoad: true });\r\n \r\n // Find active preset based on current adjustments\r\n const activePreset = presetHook.actions.findByAdjustments(adjustmentHistory.currentState);\r\n \r\n // Actions - pure business logic, no editor interaction - wrapped in useCallback to prevent re-renders\r\n const navigateNext = useCallback(() => {\r\n if (gallerySwipe.isNextAvailable) {\r\n gallerySwipe.onSwipeNext();\r\n }\r\n }, [gallerySwipe.isNextAvailable, gallerySwipe.onSwipeNext]);\r\n \r\n const navigatePrev = useCallback(() => {\r\n if (gallerySwipe.isPrevAvailable) {\r\n gallerySwipe.onSwipePrev();\r\n }\r\n }, [gallerySwipe.isPrevAvailable, gallerySwipe.onSwipePrev]);\r\n \r\n const updateAdjustment = useCallback((field: keyof AdjustmentState, value: number) => {\r\n const newState = {\r\n ...adjustmentHistory.currentState,\r\n [field]: value\r\n };\r\n adjustmentHistory.actions.pushState(newState);\r\n }, [adjustmentHistory.currentState, adjustmentHistory.actions.pushState, adjustmentHistory.historyInfo.isBatchMode]);\r\n \r\n const setBatchMode = useCallback((enabled: boolean) => {\r\n adjustmentHistory.config.setBatchMode(enabled);\r\n }, [adjustmentHistory.config.setBatchMode]);\r\n \r\n const startBatchMode = useCallback(() => {\r\n adjustmentHistory.config.setBatchMode(true);\r\n }, [adjustmentHistory.config.setBatchMode]);\r\n \r\n const endBatchMode = useCallback(() => {\r\n adjustmentHistory.config.setBatchMode(false);\r\n }, [adjustmentHistory.config.setBatchMode]);\r\n \r\n const undo = useCallback(() => {\r\n adjustmentHistory.actions.undo();\r\n }, [adjustmentHistory.actions.undo]);\r\n \r\n const redo = useCallback(() => {\r\n adjustmentHistory.actions.redo();\r\n }, [adjustmentHistory.actions.redo]);\r\n \r\n const reset = useCallback(async () => {\r\n // Reset means setting all adjustments to 0 and adding it as new history entry\r\n // This allows users to undo the reset operation\r\n // Reset acts like normal adjustment - each reset creates a new history entry\r\n console.log('Resetting adjustments to 0 - adding to history');\r\n \r\n // Always add reset to history (this automatically syncs to backend via batch mode)\r\n await adjustmentHistory.config.setBatchMode(true);\r\n adjustmentHistory.actions.pushState(initialAdjustments);\r\n await adjustmentHistory.config.setBatchMode(false, true); // forceHistory = true\r\n }, [adjustmentHistory.actions.pushState, adjustmentHistory.config.setBatchMode]);\r\n \r\n const loadPresets = useCallback(async () => {\r\n await presetHook.actions.load();\r\n }, [presetHook.actions.load]);\r\n \r\n const applyPreset = useCallback(async (preset: Preset) => {\r\n console.log('Applying preset:', preset.name);\r\n const adjustmentState: AdjustmentState = {\r\n tempScore: preset.temperature,\r\n tintScore: preset.tint,\r\n vibranceScore: preset.vibrance,\r\n saturationScore: preset.saturation,\r\n exposureScore: preset.exposure,\r\n highlightsScore: preset.highlights,\r\n shadowsScore: preset.shadows,\r\n whitesScore: preset.whites,\r\n blacksScore: preset.blacks,\r\n contrastScore: preset.contrast,\r\n clarityScore: preset.clarity,\r\n sharpnessScore: preset.sharpness,\r\n };\r\n console.log('Applying preset:', preset.name, 'with adjustments:', adjustmentState);\r\n\r\n // Always apply preset and add to history (this automatically syncs to backend via batch mode)\r\n await adjustmentHistory.config.setBatchMode(true);\r\n adjustmentHistory.actions.pushState(adjustmentState);\r\n await adjustmentHistory.config.setBatchMode(false, true); // forceHistory = true\r\n }, [adjustmentHistory.actions.pushState, adjustmentHistory.config.setBatchMode]);\r\n \r\n const createPreset = useCallback(async (name: string, adjustments: AdjustmentState) => {\r\n return await presetHook.actions.create(name, adjustments);\r\n }, [presetHook.actions.create]);\r\n \r\n const renamePreset = useCallback(async (presetId: string, newName: string) => {\r\n return await presetHook.actions.rename(presetId, newName);\r\n }, [presetHook.actions.rename]);\r\n \r\n const deletePreset = useCallback(async (presetId: string) => {\r\n await presetHook.actions.delete(presetId);\r\n }, [presetHook.actions.delete]);\r\n \r\n const getEditorAdjustments = useCallback((): AdjustmentValues => {\r\n const adjustments = adjustmentHistory.currentState;\r\n return {\r\n temperature: adjustments.tempScore,\r\n tint: adjustments.tintScore,\r\n vibrance: adjustments.vibranceScore,\r\n saturation: adjustments.saturationScore,\r\n exposure: adjustments.exposureScore,\r\n highlights: adjustments.highlightsScore,\r\n shadows: adjustments.shadowsScore,\r\n whites: adjustments.whitesScore,\r\n blacks: adjustments.blacksScore,\r\n contrast: adjustments.contrastScore,\r\n clarity: adjustments.clarityScore,\r\n sharpness: adjustments.sharpnessScore,\r\n };\r\n }, [adjustmentHistory.currentState]);\r\n \r\n const actions: UseHonchoEditorSingleActions = {\r\n // Navigation\r\n navigateNext,\r\n navigatePrev,\r\n \r\n // Adjustments\r\n updateAdjustment,\r\n setBatchMode,\r\n startBatchMode,\r\n endBatchMode,\r\n \r\n // History\r\n undo,\r\n redo,\r\n reset,\r\n \r\n // Presets\r\n loadPresets,\r\n applyPreset,\r\n createPreset,\r\n renamePreset,\r\n deletePreset,\r\n \r\n // Adjustment conversion for editor\r\n getEditorAdjustments\r\n };\r\n \r\n // State - pure business state, no editor state\r\n const state: UseHonchoEditorSingleState = {\r\n // Image state\r\n currentImageData: gallerySwipe.currentImageData,\r\n isGalleryLoading: gallerySwipe.isLoading,\r\n galleryError: gallerySwipe.error,\r\n \r\n // Adjustment state\r\n currentAdjustments: adjustmentHistory.currentState,\r\n isBatchMode: adjustmentHistory.historyInfo.isBatchMode,\r\n canUndo: adjustmentHistory.historyInfo.canUndo,\r\n canRedo: adjustmentHistory.historyInfo.canRedo,\r\n \r\n // Navigation state\r\n isNextAvailable: gallerySwipe.isNextAvailable,\r\n isPrevAvailable: gallerySwipe.isPrevAvailable,\r\n \r\n // Preset state\r\n presets: presetHook.presets,\r\n activePreset: activePreset || null,\r\n presetsLoading: presetHook.info.isLoading,\r\n presetsError: presetHook.info.error,\r\n };\r\n \r\n return {\r\n state,\r\n actions\r\n };\r\n}\r\n","import { useState, useCallback, useMemo, useRef, useEffect } from 'react';\r\nimport { AdjustmentState, Controller, EditorHistoryEntry } from './editor/type';\r\nimport { CreateEditorTaskRequest, ColorAdjustment } from './editor/type';\r\n\r\n/**\r\n * History entry with task ID for backend synchronization\r\n */\r\ninterface HistoryEntry {\r\n /** The adjustment state */\r\n state: AdjustmentState;\r\n /** Task ID for backend operations (if synced) */\r\n taskId: string;\r\n}\r\n\r\n/**\r\n * Configuration options for the adjustment history hook\r\n */\r\nexport interface HistoryOptions {\r\n /** Maximum number of history entries to keep. Use 'unlimited' for no limit */\r\n maxSize?: number | 'unlimited';\r\n /** Whether to enable batch mode for grouping multiple changes */\r\n enableBatching?: boolean;\r\n /** Enable development warnings for performance issues */\r\n devWarnings?: boolean;\r\n}\r\n\r\n/**\r\n * Information about the current history state\r\n */\r\nexport interface HistoryInfo {\r\n /** Whether undo operation is available */\r\n canUndo: boolean;\r\n /** Whether redo operation is available */\r\n canRedo: boolean;\r\n /** Current position in history (0-based index) */\r\n currentIndex: number;\r\n /** Total number of states in history */\r\n totalStates: number;\r\n /** Current size of history in memory */\r\n historySize: number;\r\n /** Whether batch mode is currently active */\r\n isBatchMode: boolean;\r\n}\r\n\r\n/**\r\n * Actions available for history management\r\n */\r\nexport interface HistoryActions {\r\n /** Add a new adjustment state to history */\r\n pushState: (state: AdjustmentState) => void;\r\n /** Undo to previous adjustment state */\r\n undo: () => void;\r\n /** Redo to next adjustment state */\r\n redo: () => void;\r\n /** Jump to specific index in history */\r\n jumpToIndex: (index: number) => void;\r\n /** Clear all history and start fresh */\r\n clearHistory: () => void;\r\n /** Get a copy of the entire history array */\r\n getHistory: () => AdjustmentState[];\r\n /** Trim history to specified size, keeping most recent entries */\r\n trimHistory: (keepLast: number) => void;\r\n /** Sync history from backend using getEditorHistory */\r\n syncFromBackend: () => Promise<void>;\r\n}\r\n\r\n/**\r\n * Configuration actions for runtime adjustment\r\n */\r\nexport interface HistoryConfig {\r\n /** Set maximum history size */\r\n setMaxSize: (size: number | 'unlimited') => void;\r\n /** Enable or disable batch mode */\r\n setBatchMode: (enabled: boolean, forceHistory?: boolean) => Promise<void>;\r\n /** Get current memory usage estimate */\r\n getMemoryUsage: () => number;\r\n}\r\n\r\n/**\r\n * Return type for the useAdjustmentHistory hook\r\n */\r\nexport interface UseAdjustmentHistoryReturn {\r\n /** Current adjustment state value */\r\n currentState: AdjustmentState;\r\n /** Current index in history */\r\n currentIndex: number;\r\n /** Information about history state */\r\n historyInfo: HistoryInfo;\r\n /** Available history actions */\r\n actions: HistoryActions;\r\n /** Configuration options */\r\n config: HistoryConfig;\r\n}\r\n\r\n/**\r\n * Convert AdjustmentState to ColorAdjustment format for backend\r\n */\r\nconst convertAdjustmentStateToColorAdjustment = (adjustmentState: AdjustmentState): ColorAdjustment => {\r\n return {\r\n temperature: adjustmentState.tempScore,\r\n tint: adjustmentState.tintScore,\r\n saturation: adjustmentState.saturationScore,\r\n vibrance: adjustmentState.vibranceScore,\r\n exposure: adjustmentState.exposureScore,\r\n contrast: adjustmentState.contrastScore,\r\n highlights: adjustmentState.highlightsScore,\r\n shadows: adjustmentState.shadowsScore,\r\n whites: adjustmentState.whitesScore,\r\n blacks: adjustmentState.blacksScore,\r\n clarity: adjustmentState.clarityScore,\r\n sharpness: adjustmentState.sharpnessScore,\r\n };\r\n};\r\n\r\n/**\r\n * Convert ColorAdjustment from backend to AdjustmentState format\r\n */\r\nconst convertColorAdjustmentToAdjustmentState = (colorAdjustment: ColorAdjustment): AdjustmentState => {\r\n return {\r\n tempScore: colorAdjustment.temperature,\r\n tintScore: colorAdjustment.tint,\r\n saturationScore: colorAdjustment.saturation,\r\n vibranceScore: colorAdjustment.vibrance,\r\n exposureScore: colorAdjustment.exposure,\r\n contrastScore: colorAdjustment.contrast,\r\n highlightsScore: colorAdjustment.highlights,\r\n shadowsScore: colorAdjustment.shadows,\r\n whitesScore: colorAdjustment.whites,\r\n blacksScore: colorAdjustment.blacks,\r\n clarityScore: colorAdjustment.clarity,\r\n sharpnessScore: colorAdjustment.sharpness,\r\n };\r\n};\r\n\r\n/**\r\n * Compare two AdjustmentState objects for equality\r\n * Uses JSON.stringify for deep comparison of all adjustment values\r\n */\r\nconst compareAdjustmentStates = (a: AdjustmentState, b: AdjustmentState): boolean => {\r\n try {\r\n return JSON.stringify(a) === JSON.stringify(b);\r\n } catch (error) {\r\n // Fallback to manual comparison if JSON.stringify fails\r\n console.warn('Failed to compare adjustment states with JSON.stringify, falling back to manual comparison:', error);\r\n return (\r\n a.tempScore === b.tempScore &&\r\n a.tintScore === b.tintScore &&\r\n a.vibranceScore === b.vibranceScore &&\r\n a.saturationScore === b.saturationScore &&\r\n a.exposureScore === b.exposureScore &&\r\n a.highlightsScore === b.highlightsScore &&\r\n a.shadowsScore === b.shadowsScore &&\r\n a.whitesScore === b.whitesScore &&\r\n a.blacksScore === b.blacksScore &&\r\n a.contrastScore === b.contrastScore &&\r\n a.clarityScore === b.clarityScore &&\r\n a.sharpnessScore === b.sharpnessScore\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Advanced hook for managing AdjustmentState history with undo/redo functionality.\r\n * \r\n * Features:\r\n * - Unlimited or configurable history size\r\n * - Batch mode for grouping multiple changes into single undo operations\r\n * - Memory usage monitoring and optimization\r\n * - Internal stabilization to prevent re-render issues\r\n * - Jump to any point in history\r\n * - Automatic AdjustmentState comparison\r\n * \r\n * @param initialState - The initial AdjustmentState value\r\n * @param controller - Controller for backend operations (optional)\r\n * @param firebaseUid - Firebase UID for backend operations (optional)\r\n * @param currentImageId - Current image ID for backend operations (optional)\r\n * @param options - Configuration options for history behavior\r\n * @returns Object with current state, history info, actions, and config\r\n */\r\nexport function useAdjustmentHistory(\r\n initialState: AdjustmentState,\r\n controller?: Controller,\r\n firebaseUid?: string,\r\n currentImageId?: string,\r\n options: HistoryOptions = {}\r\n): UseAdjustmentHistoryReturn {\r\n // Internal stabilization - prevent re-renders from options object recreation\r\n const internalOptions = useMemo(() => ({\r\n maxSize: options.maxSize ?? 'unlimited' as const,\r\n enableBatching: options.enableBatching ?? false,\r\n devWarnings: options.devWarnings ?? false,\r\n controller: controller,\r\n firebaseUid: firebaseUid,\r\n currentImageId: currentImageId\r\n }), [\r\n options.maxSize, \r\n options.enableBatching, \r\n options.devWarnings,\r\n controller,\r\n firebaseUid,\r\n currentImageId\r\n ]);\r\n\r\n // Core state management\r\n const [history, setHistory] = useState<HistoryEntry[]>([{ state: initialState, taskId: `initial_${Date.now()}` }]);\r\n const [currentState, setCurrentState] = useState<AdjustmentState>(initialState);\r\n const currentIndexRef = useRef<number>(0);\r\n const currentStateRef = useRef<AdjustmentState>(initialState);\r\n \r\n // Batch mode state - ref to avoid triggering effects\r\n const batchModeRef = useRef(internalOptions.enableBatching);\r\n const batchStartIndexRef = useRef<number | null>(null);\r\n const batchStartStateRef = useRef<AdjustmentState | null>(null);\r\n const batchModeProcessingRef = useRef(false); // Guard against double execution\r\n \r\n // Configuration refs - prevent re-renders when config changes\r\n const maxSizeRef = useRef(internalOptions.maxSize);\r\n const devWarningsRef = useRef(internalOptions.devWarnings);\r\n\r\n // Computed current index for return value (defined early for dependencies)\r\n const currentIndex = currentIndexRef.current;\r\n\r\n // Performance monitoring\r\n const performanceRef = useRef({\r\n lastHistorySize: 1,\r\n lastUpdateTime: Date.now(),\r\n largeHistoryWarningShown: false\r\n });\r\n\r\n // Sync currentState with history when not in batch mode\r\n // useEffect(() => {\r\n // if (!batchModeRef.current) {\r\n // console.log(`[useAdjustmentHistory] Syncing currentState with history:`, history[currentIndex]?.state);\r\n // setCurrentState(history[currentIndex]?.state || initialState);\r\n // }\r\n // }, [history, currentIndex, initialState]);\r\n\r\n useEffect(() => {\r\n if (internalOptions.currentImageId) {\r\n syncFromBackend().catch(console.error);\r\n }\r\n }, [internalOptions.currentImageId, internalOptions.firebaseUid, internalOptions.controller]);\r\n\r\n const getMemoryUsage = useCallback(() => {\r\n try {\r\n const historyString = JSON.stringify(history);\r\n return historyString.length * 2; // Rough estimate: 2 bytes per character\r\n } catch (error) {\r\n console.warn('Failed to estimate memory usage:', error);\r\n return history.length * 1000; // Fallback estimate\r\n }\r\n }, [history]);\r\n\r\n // Development warnings for performance\r\n const checkPerformance = useCallback(() => {\r\n if (!devWarningsRef.current) return;\r\n\r\n const now = Date.now();\r\n const perfData = performanceRef.current;\r\n \r\n // Warn about large history sizes\r\n if (history.length > 1000 && !perfData.largeHistoryWarningShown) {\r\n console.warn(`useAdjustmentHistory: Large history size detected (${history.length} entries). Consider setting a maxSize limit.`);\r\n perfData.largeHistoryWarningShown = true;\r\n }\r\n\r\n // Update performance tracking\r\n perfData.lastHistorySize = history.length;\r\n perfData.lastUpdateTime = now;\r\n }, [history.length]);\r\n\r\n // Trim history to specified size, keeping most recent entries\r\n const trimHistoryToSize = useCallback((size: number) => {\r\n if (size <= 0) return;\r\n \r\n setHistory(prevHistory => {\r\n if (prevHistory.length <= size) return prevHistory;\r\n \r\n const startIndex = Math.max(0, prevHistory.length - size);\r\n const trimmedHistory = prevHistory.slice(startIndex);\r\n \r\n // Adjust current index to maintain relative position\r\n const prevIndex = currentIndexRef.current;\r\n const adjustedIndex = prevIndex - startIndex;\r\n currentIndexRef.current = Math.max(0, Math.min(adjustedIndex, trimmedHistory.length - 1));\r\n \r\n return trimmedHistory;\r\n });\r\n }, []);\r\n\r\n // Apply max size limit when history grows\r\n const enforceMaxSize = useCallback(() => {\r\n if (maxSizeRef.current === 'unlimited') return;\r\n \r\n const maxSize = maxSizeRef.current;\r\n if (history.length > maxSize) {\r\n trimHistoryToSize(maxSize);\r\n }\r\n }, [history.length, trimHistoryToSize]);\r\n\r\n // Push new state to history\r\n const pushState = useCallback((newState: AdjustmentState) => {\r\n // Always update currentState immediately for smooth UI\r\n currentStateRef.current = newState;\r\n setCurrentState(newState);\r\n\r\n if (batchModeRef.current) {\r\n // In batch mode: Don't update history yet, just update UI state\r\n // History will be updated when batch mode ends\r\n console.log(`[useAdjustmentHistory] Pushing state in batch mode:`, newState);\r\n return;\r\n }\r\n\r\n // Normal mode: Update history immediately\r\n console.log(`[useAdjustmentHistory] Pushing new state to history:`, newState);\r\n setHistory(prevHistory => {\r\n const truncatedHistory = prevHistory.slice(0, currentIndexRef.current + 1);\r\n // const taskId = `task_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\r\n // we put the taskId empty to check this state no need to save it\r\n const newHistory = [...truncatedHistory, { state: newState, taskId: \"\" }];\r\n currentIndexRef.current = newHistory.length - 1;\r\n return newHistory;\r\n });\r\n }, []);\r\n\r\n // Undo to previous state\r\n const undo = useCallback(async () => {\r\n if (currentIndexRef.current > 0) {\r\n const newIndex = currentIndexRef.current - 1;\r\n const historyEntry = history[newIndex];\r\n const newState = historyEntry.state;\r\n \r\n currentIndexRef.current = newIndex;\r\n currentStateRef.current = newState;\r\n setCurrentState(newState);\r\n\r\n console.log(`[useAdjustmentHistory] Undoing to index ${newIndex}:`, newState);\r\n \r\n // Call controller to set history index in backend if taskId exists\r\n if (historyEntry.taskId && internalOptions.controller && internalOptions.firebaseUid && internalOptions.currentImageId) {\r\n try {\r\n console.log(`🔙 Undo: Setting history index to taskId: ${historyEntry.taskId}`);\r\n await internalOptions.controller.setHistoryIndex(\r\n internalOptions.firebaseUid,\r\n internalOptions.currentImageId,\r\n historyEntry.taskId\r\n );\r\n console.log('✅ Successfully set history index for undo');\r\n } catch (error) {\r\n console.error('❌ Failed to set history index for undo:', error);\r\n }\r\n } else {\r\n console.log(\"🔙 Undo: No taskId available for setting history index\", historyEntry.taskId, internalOptions.firebaseUid, internalOptions.currentImageId);\r\n }\r\n \r\n // Exit batch mode when undoing\r\n if (batchModeRef.current) {\r\n batchModeRef.current = false;\r\n batchStartIndexRef.current = null;\r\n batchStartStateRef.current = null;\r\n }\r\n }\r\n }, [history, internalOptions]);\r\n\r\n // Redo to next state\r\n const redo = useCallback(async () => {\r\n if (currentIndexRef.current < history.length - 1) {\r\n const newIndex = currentIndexRef.current + 1;\r\n const historyEntry = history[newIndex];\r\n const newState = historyEntry.state;\r\n \r\n currentIndexRef.current = newIndex;\r\n currentStateRef.current = newState;\r\n setCurrentState(newState);\r\n\r\n console.log(`[useAdjustmentHistory] Redoing to index ${newIndex}:`, newState);\r\n \r\n // Call controller to set history index in backend if taskId exists\r\n if (historyEntry.taskId && internalOptions.controller && internalOptions.firebaseUid && internalOptions.currentImageId) {\r\n try {\r\n console.log(`🔄 Redo: Setting history index to taskId: ${historyEntry.taskId}`);\r\n await internalOptions.controller.setHistoryIndex(\r\n internalOptions.firebaseUid,\r\n internalOptions.currentImageId,\r\n historyEntry.taskId\r\n );\r\n console.log('✅ Successfully set history index for redo');\r\n } catch (error) {\r\n console.error('❌ Failed to set history index for redo:', error);\r\n }\r\n } else {\r\n console.warn('🔄 Redo: No taskId available for setting history index', historyEntry.taskId, internalOptions.firebaseUid, internalOptions.currentImageId);\r\n }\r\n }\r\n }, [history, internalOptions]);\r\n\r\n // Reset history with new initial state\r\n // const reset = useCallback((newInitialState: AdjustmentState) => {\r\n // console.log(\"Reset called setHistory\");\r\n // setHistory([{ state: newInitialState, taskId: `reset_${Date.now()}` }]);\r\n // currentIndexRef.current = 0;\r\n // currentStateRef.current = newInitialState;\r\n // batchModeRef.current = internalOptions.enableBatching;\r\n // batchStartIndexRef.current = null;\r\n // batchStartStateRef.current = null;\r\n // }, [internalOptions.enableBatching]);\r\n\r\n // Jump to specific index in history\r\n const jumpToIndex = useCallback((index: number) => {\r\n if (index >= 0 && index < history.length) {\r\n const historyEntry = history[index];\r\n const newState = historyEntry.state;\r\n currentIndexRef.current = index;\r\n currentStateRef.current = newState;\r\n setCurrentState(newState);\r\n \r\n // Exit batch mode when jumping\r\n if (batchModeRef.current) {\r\n batchModeRef.current = false;\r\n batchStartIndexRef.current = null;\r\n batchStartStateRef.current = null;\r\n }\r\n }\r\n }, [history]);\r\n\r\n // Clear all history and start fresh\r\n const clearHistory = useCallback(() => {\r\n console.log(\"clearHistory called setHistory\");\r\n setHistory([{ state: currentStateRef.current, taskId: `clear_${Date.now()}` }]);\r\n currentIndexRef.current = 0;\r\n batchModeRef.current = internalOptions.enableBatching;\r\n batchStartIndexRef.current = null;\r\n batchStartStateRef.current = null;\r\n }, [internalOptions.enableBatching]);\r\n\r\n // Get copy of entire history\r\n const getHistory = useCallback(() => {\r\n return history.map(entry => entry.state);\r\n }, [history]);\r\n\r\n // Manually trim history\r\n const trimHistory = useCallback((keepLast: number) => {\r\n trimHistoryToSize(keepLast);\r\n }, [trimHistoryToSize]);\r\n\r\n // Sync/replace entire history with new list\r\n const syncHistory = useCallback((newHistory: AdjustmentState[], targetIndex?: number) => {\r\n throw Error('syncHistory is not implemented yet');\r\n // // Validate input\r\n // if (!Array.isArray(newHistory) || newHistory.length === 0) {\r\n // console.warn('syncHistory: newHistory must be a non-empty array');\r\n // return;\r\n // }\r\n\r\n // // Validate all items are AdjustmentState objects\r\n // const isValidHistory = newHistory.every(state => \r\n // state && typeof state === 'object' &&\r\n // typeof state.tempScore === 'number' &&\r\n // typeof state.tintScore === 'number' &&\r\n // typeof state.vibranceScore === 'number' &&\r\n // typeof state.saturationScore === 'number' &&\r\n // typeof state.exposureScore === 'number' &&\r\n // typeof state.highlightsScore === 'number' &&\r\n // typeof state.shadowsScore === 'number' &&\r\n // typeof state.whitesScore === 'number' &&\r\n // typeof state.blacksScore === 'number' &&\r\n // typeof state.contrastScore === 'number' &&\r\n // typeof state.clarityScore === 'number' &&\r\n // typeof state.sharpnessScore === 'number'\r\n // );\r\n\r\n // if (!isValidHistory) {\r\n // console.warn('syncHistory: All items in newHistory must be valid AdjustmentState objects');\r\n // return;\r\n // }\r\n\r\n // // Exit batch mode if active\r\n // if (batchModeRef.current) {\r\n // batchModeRef.current = false;\r\n // batchStartIndexRef.current = null;\r\n // batchStartStateRef.current = null;\r\n // }\r\n\r\n // // Determine target index\r\n // let finalIndex = targetIndex ?? newHistory.length - 1; // Default to last item\r\n // finalIndex = Math.max(0, Math.min(finalIndex, newHistory.length - 1)); // Clamp to valid range\r\n\r\n // // Create a copy of the new history to avoid mutations and convert to HistoryEntry format\r\n // const historyToSet = newHistory.map((state, index) => ({ \r\n // state: { ...state }, \r\n // taskId: `sync_${Date.now()}_${index}` \r\n // }));\r\n\r\n // // Apply max size limit if needed\r\n // if (maxSizeRef.current !== 'unlimited' && historyToSet.length > maxSizeRef.current) {\r\n // const trimAmount = historyToSet.length - maxSizeRef.current;\r\n // const trimmedHistory = historyToSet.slice(trimAmount);\r\n \r\n // // Adjust target index\r\n // finalIndex = Math.max(0, finalIndex - trimAmount);\r\n \r\n // setHistory(trimmedHistory);\r\n // setCurrentIndex(finalIndex);\r\n // console.log(`syncHistory: Trimmed ${trimAmount} entries to respect maxSize of ${maxSizeRef.current}`);\r\n // setCurrentState(trimmedHistory[finalIndex].state);\r\n \r\n // if (devWarningsRef.current) {\r\n // console.warn(`syncHistory: Trimmed ${trimAmount} entries to respect maxSize of ${maxSizeRef.current}`);\r\n // }\r\n // } else {\r\n // // Set history as-is\r\n // setHistory(historyToSet);\r\n // setCurrentIndex(finalIndex);\r\n // console.log(`syncHistory: Synchronized ${historyToSet.length} states, current index: ${finalIndex}`);\r\n // setCurrentState(historyToSet[finalIndex].state);\r\n // }\r\n\r\n // if (devWarningsRef.current) {\r\n // console.log(`syncHistory: Synchronized ${historyToSet.length} states, current index: ${finalIndex}`);\r\n // }\r\n }, []);\r\n\r\n // Configuration setters\r\n const setMaxSize = useCallback((size: number | 'unlimited') => {\r\n maxSizeRef.current = size;\r\n if (size !== 'unlimited') {\r\n enforceMaxSize();\r\n }\r\n }, [enforceMaxSize]);\r\n\r\n const setBatchMode = useCallback(async (enabled: boolean, forceHistory = false) => {\r\n const wasInBatch = batchModeRef.current;\r\n \r\n console.log(`🔧 setBatchMode called: enabled=${enabled}, wasInBatch=${wasInBatch}, currentIndex=${currentIndexRef.current}, historyLength=${history.length}`);\r\n \r\n if (enabled && !wasInBatch) {\r\n // Starting batch mode - save current state as batch start\r\n\r\n batchModeRef.current = true;\r\n batchStartIndexRef.current = currentIndexRef.current;\r\n batchStartStateRef.current = currentStateRef.current;\r\n console.log(\"🔧 setBatchMode(true): Starting batch mode\", {\r\n currentState: currentStateRef.current,\r\n currentIndex: currentIndexRef.current,\r\n batchStartState: currentStateRef.current\r\n });\r\n } else if (!enabled && wasInBatch) {\r\n // Guard against double execution\r\n console.log(\"🔧 setBatchMode: Ending batch mode\", batchModeProcessingRef.current);\r\n if (batchModeProcessingRef.current) {\r\n console.log(\"⚠️ setBatchMode(false) already processing, skipping duplicate call\");\r\n return;\r\n }\r\n\r\n console.log(\"🔧 setBatchMode: Ending batch mode\", currentStateRef.current, `batchStartIndex=${batchStartIndexRef.current}`);\r\n \r\n // Ending batch mode - commit final state to history\r\n batchModeProcessingRef.current = true;\r\n batchModeRef.current = false;\r\n \r\n // Only add to history if state actually changed from batch start\r\n const statesEqual = batchStartStateRef.current ? \r\n compareAdjustmentStates(currentStateRef.current, batchStartStateRef.current) : true;\r\n \r\n console.log(\"🔧 setBatchMode(false): Comparing states\", {\r\n currentState: currentStateRef.current,\r\n batchStartState: batchStartStateRef.current,\r\n statesEqual,\r\n forceHistory,\r\n willAddToHistory: batchStartStateRef.current && (!statesEqual || forceHistory)\r\n });\r\n \r\n if (batchStartStateRef.current && (!statesEqual || forceHistory)) {\r\n \r\n // Generate a unique task ID for this history entry\r\n const taskId = `task_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\r\n\r\n console.log('📋 Before SetHistory state for backend:', batchStartIndexRef.current, currentStateRef.current, history.length);\r\n \r\n // Store variables for backend call BEFORE setHistory\r\n let replaceFromTaskId: string | undefined;\r\n const batchStartIndex = batchStartIndexRef.current ?? currentIndexRef.current;\r\n const wasInMiddleOfHistory = batchStartIndex < history.length - 1;\r\n \r\n if (wasInMiddleOfHistory) {\r\n // Get the task_id from the original history entry to use as replace_from\r\n const currentHistoryEntry = history[batchStartIndex];\r\n replaceFromTaskId = currentHistoryEntry?.taskId;\r\n console.log(`📍 Was in middle of history (index ${batchStartIndex}), using replace_from: ${replaceFromTaskId}`);\r\n } else {\r\n console.log(`📍 At latest history (index ${batchStartIndex}), no replace_from needed`);\r\n }\r\n\r\n setHistory(prevHistory => {\r\n // Check if we were in the middle of history BEFORE any truncation\r\n // Handle case where batchStartIndexRef.current might be null (e.g., after undo)\r\n const batchStartIndex = batchStartIndexRef.current ?? currentIndexRef.current;\r\n \r\n const truncatedHistory = prevHistory.slice(0, batchStartIndex + 1);\r\n \r\n const newHistoryEntry: HistoryEntry = {\r\n state: currentStateRef.current,\r\n taskId: taskId\r\n };\r\n \r\n const newHistory = [...truncatedHistory, newHistoryEntry];\r\n currentIndexRef.current = newHistory.length - 1;\r\n\r\n return newHistory;\r\n });\r\n\r\n // Call controller to create history in backend - OUTSIDE of setHistory callback\r\n if (internalOptions.controller && internalOptions.firebaseUid && internalOptions.currentImageId) {\r\n try {\r\n console.log('🔄 Creating editor history in backend for batch mode end');\r\n console.log('📋 Current state for backend:', batchStartIndexRef.current, currentStateRef.current, history.length);\r\n \r\n const createEditorConfigPayload: CreateEditorTaskRequest = {\r\n gallery_id: internalOptions.currentImageId,\r\n task_id: taskId,\r\n color_adjustment: convertAdjustmentStateToColorAdjustment(currentStateRef.current),\r\n ...(replaceFromTaskId && { replace_from: replaceFromTaskId })\r\n };\r\n \r\n // Create editor config with current adjustments\r\n internalOptions.controller.createEditorConfig(\r\n internalOptions.firebaseUid, \r\n createEditorConfigPayload\r\n ).then(() => {\r\n console.log('✅ Successfully created editor history in backend');\r\n }).catch((error: unknown) => {\r\n console.error('❌ Failed to create editor history in backend:', error);\r\n });\r\n } catch (error) {\r\n console.error('❌ Error calling controller.createEditorConfig:', error);\r\n }\r\n } else {\r\n if (internalOptions.devWarnings) {\r\n console.warn('⚠️ Controller, firebaseUid, or currentImageId not provided - skipping backend history creation');\r\n }\r\n }\r\n } else {\r\n if (forceHistory) {\r\n console.log(\"🔧 setBatchMode: Force history requested but no batch start state\");\r\n } else {\r\n console.log(\"🔧 setBatchMode: No changes since batch start, not adding to history\");\r\n }\r\n }\r\n \r\n batchStartIndexRef.current = null;\r\n batchStartStateRef.current = null;\r\n batchModeProcessingRef.current = false; // Reset processing flag\r\n }\r\n }, [internalOptions, history]);\r\n\r\n // Sync history from backend using getEditorHistory\r\n const syncFromBackend = useCallback(async () => {\r\n if (!internalOptions.controller || !internalOptions.firebaseUid || !internalOptions.currentImageId) {\r\n console.warn('⚠️ syncFromBackend: Controller, firebaseUid, or currentImageId not provided - cannot sync from backend');\r\n return;\r\n }\r\n\r\n try {\r\n console.log('🔄 Syncing history from backend using getEditorHistory');\r\n \r\n const historyResponse = await internalOptions.controller.getEditorHistory(\r\n internalOptions.firebaseUid,\r\n internalOptions.currentImageId\r\n );\r\n\r\n // Sort history by timestamp (oldest first) before processing\r\n const sortedHistory = [...historyResponse.history].sort((a: EditorHistoryEntry, b: EditorHistoryEntry) => {\r\n const timeA = new Date(a.log.created_at).getTime();\r\n const timeB = new Date(b.log.created_at).getTime();\r\n return timeA - timeB; // Ascending order (oldest first)\r\n });\r\n\r\n // Convert backend history to AdjustmentState format with taskIds\r\n const backendHistoryEntries: HistoryEntry[] = sortedHistory.map((entry: EditorHistoryEntry) => ({\r\n state: convertColorAdjustmentToAdjustmentState(entry.editor_config.color_adjustment),\r\n taskId: entry.task_id\r\n }));\r\n\r\n // Find the index of the current task\r\n let currentTaskIndex = -1;\r\n if (historyResponse.current_task_id) {\r\n currentTaskIndex = backendHistoryEntries.findIndex(entry => entry.taskId === historyResponse.current_task_id);\r\n }\r\n\r\n // If current_task_id is not found in history, default to the last entry\r\n if (currentTaskIndex === -1 && backendHistoryEntries.length > 0) {\r\n currentTaskIndex = backendHistoryEntries.length - 1;\r\n console.warn(`⚠️ Current task ID \"${historyResponse.current_task_id}\" not found in history, defaulting to last entry`);\r\n }\r\n\r\n // Handle empty history case\r\n if (backendHistoryEntries.length === 0) {\r\n console.log('📝 Backend history is empty, keeping current local history');\r\n return;\r\n }\r\n\r\n // Exit batch mode if active\r\n if (batchModeRef.current) {\r\n batchModeRef.current = false;\r\n batchStartIndexRef.current = null;\r\n batchStartStateRef.current = null;\r\n }\r\n\r\n // Update history state with backend data\r\n setHistory(backendHistoryEntries);\r\n currentIndexRef.current = Math.max(0, currentTaskIndex);\r\n console.log(`📍 Setting current index to: ${Math.max(0, currentTaskIndex)} (task_id: ${historyResponse.current_task_id})`);\r\n currentStateRef.current = backendHistoryEntries[Math.max(0, currentTaskIndex)].state;\r\n setCurrentState(backendHistoryEntries[Math.max(0, currentTaskIndex)].state);\r\n\r\n console.log(`✅ Successfully synced ${backendHistoryEntries.length} history entries from backend`);\r\n console.log(`📍 Set current index to: ${Math.max(0, currentTaskIndex)} (task_id: ${historyResponse.current_task_id})`);\r\n\r\n } catch (error) {\r\n console.error('❌ Failed to sync history from backend:', error);\r\n throw error;\r\n }\r\n }, [internalOptions]);\r\n\r\n // History info object\r\n const historyInfo: HistoryInfo = useMemo(() => ({\r\n canUndo: currentIndex > 0,\r\n canRedo: currentIndex < history.length - 1,\r\n currentIndex: currentIndex,\r\n totalStates: history.length,\r\n historySize: getMemoryUsage(),\r\n isBatchMode: batchModeRef.current\r\n }), [history.length, getMemoryUsage, currentIndex]);\r\n\r\n // Actions object - stabilized with useMemo\r\n const actions: HistoryActions = useMemo(() => ({\r\n pushState,\r\n undo,\r\n redo,\r\n jumpToIndex,\r\n clearHistory,\r\n getHistory,\r\n trimHistory,\r\n syncFromBackend\r\n }), [pushState, undo, redo, jumpToIndex, clearHistory, getHistory, trimHistory, syncFromBackend]);\r\n\r\n // Config object - stabilized with useMemo\r\n const config: HistoryConfig = useMemo(() => ({\r\n setMaxSize,\r\n setBatchMode,\r\n getMemoryUsage\r\n }), [setMaxSize, setBatchMode, getMemoryUsage]);\r\n\r\n // Apply max size enforcement when history changes\r\n useEffect(() => {\r\n enforceMaxSize();\r\n checkPerformance();\r\n }, [enforceMaxSize, checkPerformance]);\r\n\r\n return {\r\n currentState,\r\n currentIndex,\r\n historyInfo,\r\n actions,\r\n config\r\n };\r\n}\r\n","import { useState, useEffect, useCallback, useRef } from \"react\";\r\nimport { Controller } from \"./editor/type\";\r\nimport { Gallery, ResponseGalleryPaging } from \"./editor/type\";\r\n\r\n/**\r\n * Return type for the useGallerySwipe hook\r\n * Provides image navigation functionality with pagination support\r\n */\r\ninterface UseGallerySwipeReturn {\r\n /** Current image data object containing all image information */\r\n currentImageData: Gallery | null;\r\n /** Whether next image navigation is available (considers pagination) */\r\n isNextAvailable: boolean;\r\n /** Whether previous image navigation is available */\r\n isPrevAvailable: boolean;\r\n /** Function to navigate to the next image (async due to potential API calls) */\r\n onSwipeNext: () => Promise<void>;\r\n /** Function to navigate to the previous image (async due to potential API calls) */\r\n onSwipePrev: () => Promise<void>;\r\n /** Loading state during image transitions and API calls */\r\n isLoading: boolean;\r\n /** Error message if any operation fails */\r\n error: string | null;\r\n}\r\n\r\n/**\r\n * Custom hook for handling image gallery navigation with automatic pagination\r\n * \r\n * This hook manages image swipe/navigation functionality across a paginated gallery.\r\n * It handles the complexity of finding images across multiple pages and loading\r\n * additional pages as needed during navigation.\r\n * \r\n * @param firebaseUid - User's Firebase UID (can be null during initialization)\r\n * @param initImageId - Initial image ID to start with (can be null during initialization)\r\n * @param controller - Controller instance for API calls (can be null during initialization)\r\n * @returns Object containing current image data and navigation functions\r\n */\r\nexport function useGallerySwipe(\r\n firebaseUid: string | null, \r\n initImageId: string | null, \r\n controller: Controller | null\r\n): UseGallerySwipeReturn {\r\n // Core state for current image and navigation\r\n const [currentImageId, setCurrentImageId] = useState<string | null>(initImageId);\r\n const [currentImageData, setCurrentImageData] = useState<Gallery | null>(null);\r\n const [currentEventId, setCurrentEventId] = useState<string | null>(null);\r\n \r\n // Pagination and image list state\r\n const [currentImageList, setCurrentImageList] = useState<Gallery[]>([]);\r\n const [currentPage, setCurrentPage] = useState<number>(1);\r\n const [hasNextPage, setHasNextPage] = useState<boolean>(false);\r\n \r\n // UI state management\r\n const [isLoading, setIsLoading] = useState<boolean>(false);\r\n const [error, setError] = useState<string | null>(null);\r\n const [isInitialized, setIsInitialized] = useState<boolean>(false);\r\n \r\n // Refs to track parameter changes and avoid unnecessary re-initialization\r\n // This prevents the hook from re-initializing when the same values are passed\r\n const prevFirebaseUid = useRef<string | null>(null);\r\n const prevInitImageId = useRef<string | null>(null);\r\n\r\n /**\r\n * Get the index of the current image in the loaded image list\r\n * Returns -1 if the current image is not found in the list\r\n */\r\n const getCurrentImageIndex = useCallback(() => {\r\n if (!currentImageId || currentImageList.length === 0) return -1;\r\n return currentImageList.findIndex(img => img.id === currentImageId);\r\n }, [currentImageId, currentImageList]);\r\n\r\n /**\r\n * Fetch image pages sequentially until the target image is found\r\n * This is necessary because we don't know which page contains the initial image\r\n * \r\n * @param imageId - The target image ID to find\r\n * @param eventId - The event ID to search within\r\n * @returns Array of all gallery images up to and including the page containing the target image\r\n */\r\n const getImageListUntilFound = useCallback(async (imageId: string, eventId: string): Promise<Gallery[]> => {\r\n let page = 1;\r\n let allImages: Gallery[] = [];\r\n let isFound = false;\r\n\r\n // Search through pages until we find the target image or reach safety limit\r\n while (!isFound && page <= 100) { // Safety limit to prevent infinite loop\r\n try {\r\n const response: ResponseGalleryPaging = await controller!.getImageList(firebaseUid!, eventId, page);\r\n \r\n if (response.gallery && response.gallery.length > 0) {\r\n // Accumulate all images from previous pages\r\n allImages = [...allImages, ...response.gallery];\r\n \r\n // Check if target image is found in current page\r\n isFound = response.gallery.some(img => img.id === imageId);\r\n \r\n if (isFound) {\r\n // Update pagination state when target is found\r\n setCurrentPage(page);\r\n setHasNextPage(response.next_page !== 0 && response.next_page > response.current_page);\r\n break;\r\n }\r\n \r\n // If no next page exists, stop searching\r\n if (response.next_page === 0 || response.next_page <= response.current_page) {\r\n break;\r\n }\r\n \r\n page++;\r\n } else {\r\n // Empty response, stop searching\r\n break;\r\n }\r\n } catch (err) {\r\n console.error(`Error fetching page ${page}:`, err);\r\n break;\r\n }\r\n }\r\n\r\n return allImages;\r\n }, [controller, firebaseUid]);\r\n\r\n /**\r\n * Load the next page of images when user reaches the end of current list\r\n * This enables seamless navigation across page boundaries\r\n * \r\n * @returns Array of new images from the next page, or empty array if no more pages\r\n */\r\n const loadNextPage = useCallback(async (): Promise<Gallery[]> => {\r\n // Check prerequisites before attempting to load next page\r\n if (!hasNextPage || !currentEventId || !controller || !firebaseUid) {\r\n return [];\r\n }\r\n\r\n try {\r\n const nextPageNum = currentPage + 1;\r\n const response: ResponseGalleryPaging = await controller.getImageList(firebaseUid, currentEventId, nextPageNum);\r\n \r\n if (response.gallery && response.gallery.length > 0) {\r\n // Update pagination state with new page information\r\n setCurrentPage(nextPageNum);\r\n setHasNextPage(response.next_page !== 0 && response.next_page > response.current_page);\r\n return response.gallery;\r\n }\r\n } catch (err) {\r\n console.error('Error loading next page:', err);\r\n }\r\n\r\n return [];\r\n }, [hasNextPage, currentEventId, controller, firebaseUid, currentPage]);\r\n\r\n /**\r\n * Initialize or re-initialize the gallery when parameters change\r\n * This function:\r\n * 1. Fetches initial image data\r\n * 2. Discovers the event ID from the image\r\n * 3. Loads all image pages until the initial image is found\r\n * 4. Sets up pagination state\r\n * \r\n * Only re-initializes when parameters actually change to avoid unnecessary API calls\r\n */\r\n const initializeGallery = useCallback(async () => {\r\n // Early return if required parameters are missing\r\n if (!firebaseUid || !initImageId || !controller) {\r\n setCurrentImageData(null);\r\n setCurrentImageList([]);\r\n setIsInitialized(false);\r\n return;\r\n }\r\n\r\n // Check if re-initialization is needed by comparing with previous values\r\n const needsReinit = \r\n prevFirebaseUid.current !== firebaseUid || \r\n prevInitImageId.current !== initImageId || \r\n !isInitialized;\r\n\r\n if (!needsReinit) return;\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n // Step 1: Get initial image data to discover event ID\r\n const gallery = await controller.onGetImage(firebaseUid, initImageId);\r\n if (!gallery) {\r\n throw new Error('Failed to fetch initial image data');\r\n }\r\n\r\n // Step 2: Set up initial state with discovered data\r\n setCurrentImageData(gallery);\r\n setCurrentImageId(initImageId);\r\n setCurrentEventId(gallery.event_id);\r\n\r\n // Step 3: Get complete image list by searching through pages\r\n // This ensures we have navigation context for the current image\r\n const allImages = await getImageListUntilFound(initImageId, gallery.event_id);\r\n console.log(\"Print all images Id: \", allImages.map(image => image.id).join(', '));\r\n setCurrentImageList(allImages);\r\n\r\n // Step 4: Update tracking refs to prevent unnecessary re-initialization\r\n prevFirebaseUid.current = firebaseUid;\r\n prevInitImageId.current = initImageId;\r\n setIsInitialized(true);\r\n\r\n } catch (err) {\r\n const errorMessage = err instanceof Error ? err.message : 'Unknown error occurred';\r\n setError(errorMessage);\r\n console.error('Error initializing gallery:', err);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n }, [firebaseUid, initImageId, controller, getImageListUntilFound, isInitialized]);\r\n\r\n /**\r\n * Navigate to the next image in the gallery\r\n * Handles two scenarios:\r\n * 1. Next image exists in current loaded list - navigate directly\r\n * 2. At end of current list - load next page and navigate to first image of new page\r\n * \r\n * @returns Promise that resolves when navigation is complete\r\n */\r\n const onSwipeNext = useCallback(async () => {\r\n // Prevent action if no current image or already loading\r\n if (!currentImageId || isLoading) return;\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n // Debug logging\r\n console.log(\"=== SWIPE NEXT DEBUG ===\");\r\n console.log(\"currentImageId:\", currentImageId);\r\n console.log(\"currentImageList length:\", currentImageList.length);\r\n console.log(\"currentImageList IDs:\", currentImageList.map(img => img.id).join(\", \"));\r\n \r\n // Calculate current index\r\n const currentIndex = getCurrentImageIndex();\r\n console.log(\"Current index: \", currentIndex);\r\n \r\n if (currentIndex === -1) {\r\n throw new Error('Current image not found in list');\r\n }\r\n\r\n // Scenario 1: At the last image of current list\r\n if (currentIndex === currentImageList.length - 1) {\r\n console.log(\"[SCENARIO 1] if last image: \" + currentImageList.length);\r\n // Try to load next page for more images\r\n const newImages = await loadNextPage();\r\n if (newImages.length > 0) {\r\n // Extend current list with new images\r\n const updatedList = [...currentImageList, ...newImages];\r\n setCurrentImageList(updatedList);\r\n \r\n // Navigate to first image of the new page\r\n const nextImage = newImages[0];\r\n console.log(\"Setting currentImageId to:\", nextImage.id);\r\n setCurrentImageId(nextImage.id);\r\n \r\n // Fetch complete data for the new current image\r\n const nextImageData = await controller!.onGetImage(firebaseUid!, nextImage.id);\r\n if (nextImageData) {\r\n setCurrentImageData(nextImageData);\r\n }\r\n } else {\r\n // No more pages available - end of gallery reached\r\n setError('No more images available');\r\n }\r\n } else {\r\n // Scenario 2: Navigate to next image in current list\r\n const nextImage = currentImageList[currentIndex + 1];\r\n console.log(\"[SCENARIO 2] Navigating to next image:\", nextImage.id);\r\n console.log(\"Setting currentImageId from\", currentImageId, \"to\", nextImage.id);\r\n \r\n setCurrentImageId(nextImage.id);\r\n \r\n // Fetch complete data for the next image\r\n const nextImageData = await controller!.onGetImage(firebaseUid!, nextImage.id);\r\n if (nextImageData) {\r\n setCurrentImageData(nextImageData);\r\n }\r\n }\r\n } catch (err) {\r\n const errorMessage = err instanceof Error ? err.message : 'Error moving to next image';\r\n setError(errorMessage);\r\n console.error('Error in onSwipeNext:', err);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n }, [currentImageId, isLoading, getCurrentImageIndex, currentImageList, loadNextPage, controller, firebaseUid]);\r\n\r\n /**\r\n * Navigate to the previous image in the gallery\r\n * Only works within the currently loaded image list\r\n * (Previous pages are not loaded on-demand for backward navigation)\r\n * \r\n * @returns Promise that resolves when navigation is complete\r\n */\r\n const onSwipePrev = useCallback(async () => {\r\n // Prevent action if no current image or already loading\r\n if (!currentImageId || isLoading) return;\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n // Calculate current index\r\n const currentIndex = getCurrentImageIndex();\r\n \r\n if (currentIndex === -1) {\r\n throw new Error('Current image not found in list');\r\n }\r\n\r\n if (currentIndex > 0) {\r\n // Navigate to previous image in the current list\r\n const prevImage = currentImageList[currentIndex - 1];\r\n setCurrentImageId(prevImage.id);\r\n \r\n // Fetch complete data for the previous image\r\n const prevImageData = await controller!.onGetImage(firebaseUid!, prevImage.id);\r\n if (prevImageData) {\r\n setCurrentImageData(prevImageData);\r\n }\r\n } else {\r\n // Already at the first image of loaded list\r\n setError('Already at the first image');\r\n }\r\n } catch (err) {\r\n const errorMessage = err instanceof Error ? err.message : 'Error moving to previous image';\r\n setError(errorMessage);\r\n console.error('Error in onSwipePrev:', err);\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n }, [currentImageId, isLoading, getCurrentImageIndex, currentImageList, controller, firebaseUid]);\r\n\r\n /**\r\n * Calculate if next image navigation is available\r\n * Returns true if:\r\n * 1. There's a next image in the current loaded list, OR\r\n * 2. We're at the end of current list but more pages are available\r\n * \r\n * @returns Boolean indicating if next navigation is possible\r\n */\r\n const isNextAvailable = useCallback(() => {\r\n if (isLoading || !currentImageId) return false;\r\n \r\n // Calculate current index\r\n const currentIndex = getCurrentImageIndex();\r\n if (currentIndex === -1) return false;\r\n \r\n // If we're not at the last image, next is definitely available\r\n if (currentIndex < currentImageList.length - 1) return true;\r\n \r\n // If we're at the last image but there are more pages, next is still available\r\n return hasNextPage;\r\n }, [isLoading, getCurrentImageIndex, currentImageList.length, hasNextPage]);\r\n\r\n /**\r\n * Calculate if previous image navigation is available\r\n * Returns true if there's a previous image in the currently loaded list\r\n * \r\n * @returns Boolean indicating if previous navigation is possible\r\n */\r\n const isPrevAvailable = useCallback(() => {\r\n if (isLoading || !currentImageId) return false;\r\n \r\n // Calculate current index\r\n const currentIndex = getCurrentImageIndex();\r\n return currentIndex > 0;\r\n }, [isLoading, getCurrentImageIndex]);\r\n\r\n // Initialize when dependencies change\r\n useEffect(() => {\r\n initializeGallery();\r\n }, [initializeGallery]);\r\n\r\n // Update currentImageId when initImageId changes from external source\r\n // This allows the hook to respond to external changes to the initial image ID\r\n // but should not interfere with internal navigation\r\n useEffect(() => {\r\n // Only update if initImageId actually changed and we're not currently loading\r\n // (loading indicates we're in the middle of navigation)\r\n if (initImageId && initImageId !== currentImageId && !isLoading) {\r\n // Additional check: only update if this is truly an external change\r\n // If prevInitImageId is different from initImageId, it's an external change\r\n if (prevInitImageId.current !== initImageId) {\r\n console.log(\"External initImageId change detected, updating currentImageId\");\r\n setCurrentImageId(initImageId);\r\n }\r\n }\r\n }, [initImageId]);\r\n\r\n // Return all the functionality and state that components need\r\n return {\r\n currentImageData,\r\n isNextAvailable: isNextAvailable(),\r\n isPrevAvailable: isPrevAvailable(),\r\n onSwipeNext,\r\n onSwipePrev,\r\n isLoading,\r\n error\r\n };\r\n}\r\n","import { useState, useCallback, useEffect, useRef, useMemo } from 'react';\r\nimport { Controller, Preset, AdjustmentState } from './editor/type';\r\n\r\n/**\r\n * Configuration options for the preset hook\r\n */\r\nexport interface PresetOptions {\r\n /** Enable development warnings for debugging */\r\n devWarnings?: boolean;\r\n /** Auto-load presets on hook initialization */\r\n autoLoad?: boolean;\r\n}\r\n\r\n/**\r\n * Information about the current preset state\r\n */\r\nexport interface PresetInfo {\r\n /** Whether presets are currently being loaded */\r\n isLoading: boolean;\r\n /** Error message if any operation failed */\r\n error: string | null;\r\n /** Number of presets currently managed */\r\n count: number;\r\n /** Whether the hook has been initialized */\r\n isInitialized: boolean;\r\n}\r\n\r\n/**\r\n * Actions available for preset management\r\n */\r\nexport interface PresetActions {\r\n /** Create a new preset */\r\n create: (name: string, settings: AdjustmentState) => Promise<Preset | null>;\r\n /** Rename an existing preset */\r\n rename: (presetId: string, newName: string) => Promise<boolean>;\r\n /** Delete a preset */\r\n delete: (presetId: string) => Promise<boolean>;\r\n /** Load/refresh presets from backend */\r\n load: () => Promise<void>;\r\n /** Find preset that matches the given adjustment state */\r\n findByAdjustments: (adjustments: AdjustmentState) => Preset | null;\r\n}\r\n\r\n/**\r\n * Return type for the usePreset hook\r\n */\r\nexport interface UsePresetReturn {\r\n /** Current list of presets */\r\n presets: Preset[];\r\n /** Information about preset state */\r\n info: PresetInfo;\r\n /** Available preset actions */\r\n actions: PresetActions;\r\n}\r\n\r\n/**\r\n * Hook for managing presets with backend communication through Controller.\r\n * \r\n * **Key Features:**\r\n * - **Backend Communication**: All operations go through the provided Controller\r\n * - **Local State Management**: Maintains local preset list for UI performance\r\n * - **CRUD Operations**: Create, rename, delete, and list presets\r\n * - **Error Handling**: Provides error states for failed operations\r\n * - **Auto-loading**: Optional automatic preset loading on initialization\r\n * \r\n * **Typical Usage:**\r\n * ```typescript\r\n * const { presets, actions, info } = usePreset(controller, firebaseUid, { autoLoad: true });\r\n * \r\n * // Create preset\r\n * const newPreset = await actions.create('My Preset', adjustmentState);\r\n * \r\n * // Rename preset\r\n * const success = await actions.rename(presetId, 'New Name');\r\n * \r\n * // Delete preset\r\n * const deleted = await actions.delete(presetId);\r\n * \r\n * // Manual reload\r\n * await actions.load();\r\n * ```\r\n * \r\n * @param controller - Backend controller for API communication\r\n * @param firebaseUid - User identifier for backend operations\r\n * @param options - Configuration options\r\n * @returns Object with presets, info, and actions\r\n */\r\nexport function usePreset(\r\n controller: Controller | null,\r\n firebaseUid: string,\r\n options: PresetOptions = {}\r\n): UsePresetReturn {\r\n // Memoize options to prevent re-renders when object is recreated with same values\r\n const memoizedOptions = useMemo(() => ({\r\n devWarnings: options.devWarnings ?? false,\r\n autoLoad: options.autoLoad ?? false\r\n }), [options.devWarnings, options.autoLoad]);\r\n\r\n // Core state\r\n const [presets, setPresets] = useState<Preset[]>([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [error, setError] = useState<string | null>(null);\r\n const [isInitialized, setIsInitialized] = useState(false);\r\n\r\n // Helper function to log debug messages - memoized to prevent re-renders\r\n const debugLog = useCallback((message: string, data?: unknown) => {\r\n if (memoizedOptions.devWarnings) {\r\n console.log(`[usePreset] ${message}`, data || '');\r\n }\r\n }, [memoizedOptions.devWarnings]);\r\n\r\n // Stable references for controller and firebaseUid to detect actual changes\r\n const stableControllerRef = useRef(controller);\r\n const stableFirebaseUidRef = useRef(firebaseUid);\r\n const prevStableControllerRef = useRef(controller);\r\n const prevStableFirebaseUidRef = useRef(firebaseUid);\r\n\r\n // Update refs only when values actually change (by reference)\r\n if (stableControllerRef.current !== controller) {\r\n stableControllerRef.current = controller;\r\n }\r\n if (stableFirebaseUidRef.current !== firebaseUid) {\r\n stableFirebaseUidRef.current = firebaseUid;\r\n }\r\n\r\n // Helper function to handle errors\r\n const handleError = useCallback((operation: string, error: unknown) => {\r\n const errorMessage = `Failed to ${operation}: ${error instanceof Error ? error.message : String(error)}`;\r\n setError(errorMessage);\r\n debugLog(`Error in ${operation}`, error);\r\n return false;\r\n }, [debugLog]);\r\n\r\n // Load presets from backend\r\n const load = useCallback(async () => {\r\n console.log(\"Load Presets Get Function Called\");\r\n if (!stableControllerRef.current || !stableFirebaseUidRef.current) {\r\n debugLog('Load skipped: missing controller or firebaseUid');\r\n return;\r\n }\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n debugLog('Loading presets from backend...');\r\n const loadedPresets = await stableControllerRef.current.getPresets(stableFirebaseUidRef.current);\r\n\r\n // Ensure we always have an array\r\n const presetsArray = Array.isArray(loadedPresets) ? loadedPresets : [];\r\n \r\n setPresets(presetsArray);\r\n setIsInitialized(true);\r\n\r\n debugLog('Presets loaded successfully', { count: presetsArray.length });\r\n } catch (err) {\r\n handleError('load presets', err);\r\n setPresets([]); // Clear presets on error\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n }, [debugLog, handleError]);\r\n\r\n // Fire-and-forget version of load for internal use\r\n const loadInBackground = useCallback(() => {\r\n if (!stableControllerRef.current || !stableFirebaseUidRef.current) {\r\n debugLog('Background load skipped: missing controller or firebaseUid');\r\n return;\r\n }\r\n\r\n debugLog('Background loading presets...');\r\n \r\n // Don't set loading state for background operations\r\n stableControllerRef.current.getPresets(stableFirebaseUidRef.current)\r\n .then((loadedPresets: Preset[]) => {\r\n // Ensure we always have an array\r\n const presetsArray = Array.isArray(loadedPresets) ? loadedPresets : [];\r\n \r\n setPresets(presetsArray);\r\n if (!isInitialized) {\r\n setIsInitialized(true);\r\n }\r\n debugLog('Background presets loaded successfully', { count: presetsArray.length });\r\n })\r\n .catch((err: unknown) => {\r\n debugLog('Background load failed:', err);\r\n // Don't set error state for background operations\r\n });\r\n }, [debugLog, isInitialized]);\r\n\r\n // Create a new preset\r\n const create = useCallback(async (name: string, settings: AdjustmentState): Promise<Preset | null> => {\r\n console.log(\"Create Preset Get Function Called\");\r\n if (!stableControllerRef.current || !stableFirebaseUidRef.current) {\r\n debugLog('Create skipped: missing controller or firebaseUid');\r\n return null;\r\n }\r\n\r\n if (!name.trim()) {\r\n setError('Preset name cannot be empty');\r\n return null;\r\n }\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n debugLog('Creating preset...', { name, settings });\r\n \r\n // Fire the create request but don't wait for preset data in response\r\n await stableControllerRef.current.createPreset(\r\n stableFirebaseUidRef.current,\r\n name,\r\n settings\r\n );\r\n\r\n debugLog('Preset creation request completed');\r\n\r\n const newPreset: Preset = {\r\n id: `temp-${Date.now()}`, // Use a temporary ID\r\n name: name,\r\n is_default: false,\r\n temperature: settings.tempScore,\r\n tint: settings.tintScore,\r\n saturation: settings.saturationScore,\r\n vibrance: settings.vibranceScore,\r\n exposure: settings.exposureScore,\r\n contrast: settings.contrastScore,\r\n highlights: settings.highlightsScore,\r\n shadows: settings.shadowsScore,\r\n whites: settings.whitesScore,\r\n blacks: settings.blacksScore,\r\n clarity: settings.clarityScore,\r\n sharpness: settings.sharpnessScore,\r\n };\r\n // Add the new preset to the local state immediately\r\n setPresets(prev => [...prev, newPreset]);\r\n\r\n // Fire and forget: Schedule a delayed refresh to get updated preset list\r\n setTimeout(() => {\r\n debugLog('Refreshing presets after create (fire and forget)');\r\n loadInBackground();\r\n }, 500); // 500ms delay to allow backend processing\r\n\r\n // Return a minimal success indicator since we don't have the actual preset data\r\n // return { id: 'pending', name, is_default: false } as Preset;\r\n return newPreset;\r\n } catch (err) {\r\n handleError('create preset', err);\r\n return null;\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n // loadInBackground\r\n }, [presets, debugLog, handleError, loadInBackground]);\r\n\r\n // Rename an existing preset\r\n const rename = useCallback(async (presetId: string, newName: string): Promise<boolean> => {\r\n if (!stableControllerRef.current || !stableFirebaseUidRef.current) {\r\n debugLog('Rename skipped: missing controller or firebaseUid');\r\n return false;\r\n }\r\n\r\n if (!newName.trim()) {\r\n setError('Preset name cannot be empty');\r\n return false;\r\n }\r\n\r\n const existingPreset = Array.isArray(presets) ? presets.find(p => p.id === presetId) : null;\r\n if (!existingPreset) {\r\n setError('Preset not found');\r\n return false;\r\n }\r\n\r\n // Check for duplicate names (excluding the current preset)\r\n if (Array.isArray(presets) && presets.some(p => p.id !== presetId && p.name.toLowerCase() === newName.toLowerCase())) {\r\n setError('A preset with this name already exists');\r\n return false;\r\n }\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n debugLog('Renaming preset...', { presetId, oldName: existingPreset.name, newName });\r\n\r\n const updatedPreset = { ...existingPreset, name: newName };\r\n await stableControllerRef.current.updatePreset(stableFirebaseUidRef.current, updatedPreset);\r\n\r\n // Update local state\r\n setPresets(prev => prev.map(p => p.id === presetId ? updatedPreset : p));\r\n\r\n debugLog('Preset renamed successfully');\r\n return true;\r\n } catch (err) {\r\n handleError('rename preset', err);\r\n return false;\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n }, [presets, debugLog, handleError]);\r\n\r\n // Delete a preset\r\n const deletePreset = useCallback(async (presetId: string): Promise<boolean> => {\r\n console.log(\"Delete Presets Get Function Called\");\r\n if (!stableControllerRef.current || !stableFirebaseUidRef.current) {\r\n debugLog('Delete skipped: missing controller or firebaseUid');\r\n return false;\r\n }\r\n\r\n const existingPreset = Array.isArray(presets) ? presets.find(p => p.id === presetId) : null;\r\n if (!existingPreset) {\r\n setError('Preset not found');\r\n return false;\r\n }\r\n\r\n setIsLoading(true);\r\n setError(null);\r\n\r\n try {\r\n debugLog('Deleting preset...', { presetId, name: existingPreset.name });\r\n\r\n await stableControllerRef.current.deletePreset(stableFirebaseUidRef.current, presetId);\r\n\r\n // Remove from local state\r\n setPresets(prev => prev.filter(p => p.id !== presetId));\r\n\r\n debugLog('Preset deleted successfully');\r\n return true;\r\n } catch (err) {\r\n handleError('delete preset', err);\r\n return false;\r\n } finally {\r\n setIsLoading(false);\r\n }\r\n }, [presets, debugLog, handleError]);\r\n\r\n // Find preset that matches the given adjustment state\r\n const findByAdjustments = useCallback((adjustments: AdjustmentState): Preset | null => {\r\n // Helper function to normalize adjustment values (treat null/undefined as 0)\r\n const normalizeValue = (value: number | null | undefined): number => {\r\n return value ?? 0;\r\n };\r\n\r\n // Helper function to convert Preset to AdjustmentState for comparison\r\n const presetToAdjustmentState = (preset: Preset): AdjustmentState => {\r\n return {\r\n tempScore: normalizeValue(preset.temperature),\r\n tintScore: normalizeValue(preset.tint),\r\n vibranceScore: normalizeValue(preset.vibrance),\r\n saturationScore: normalizeValue(preset.saturation),\r\n exposureScore: normalizeValue(preset.exposure),\r\n highlightsScore: normalizeValue(preset.highlights),\r\n shadowsScore: normalizeValue(preset.shadows),\r\n whitesScore: normalizeValue(preset.whites),\r\n blacksScore: normalizeValue(preset.blacks),\r\n contrastScore: normalizeValue(preset.contrast),\r\n clarityScore: normalizeValue(preset.clarity),\r\n sharpnessScore: normalizeValue(preset.sharpness)\r\n };\r\n };\r\n\r\n // Helper function to compare two adjustment states\r\n const adjustmentsMatch = (presetSettings: AdjustmentState, current: AdjustmentState): boolean => {\r\n const keys: (keyof AdjustmentState)[] = [\r\n 'tempScore', 'tintScore', 'vibranceScore', 'saturationScore',\r\n 'exposureScore', 'highlightsScore', 'shadowsScore', 'whitesScore',\r\n 'blacksScore', 'contrastScore', 'clarityScore', 'sharpnessScore'\r\n ];\r\n\r\n return keys.every(key =>\r\n normalizeValue(presetSettings[key]) === normalizeValue(current[key])\r\n );\r\n };\r\n\r\n debugLog('Finding preset by adjustments...', adjustments);\r\n\r\n // Find preset that matches the current adjustments\r\n const matchingPreset = Array.isArray(presets) ? presets.find(preset => {\r\n const presetAdjustments = presetToAdjustmentState(preset);\r\n return adjustmentsMatch(presetAdjustments, adjustments);\r\n }) : null;\r\n\r\n if (matchingPreset) {\r\n debugLog('Found matching preset:', matchingPreset);\r\n return matchingPreset;\r\n } else {\r\n debugLog('No matching preset found');\r\n return null;\r\n }\r\n }, [presets, debugLog]);\r\n \r\n // Auto-load presets on initialization or when firebaseUid becomes available\r\n useEffect(() => {\r\n const hasValidCredentials = stableControllerRef.current && stableFirebaseUidRef.current;\r\n const shouldAutoLoad = memoizedOptions.autoLoad && hasValidCredentials;\r\n \r\n if (shouldAutoLoad && !isInitialized) {\r\n debugLog('Auto-loading presets on initialization...');\r\n load();\r\n } else if (shouldAutoLoad && isInitialized) {\r\n // If we're already initialized but firebaseUid changed to a new valid value, reload\r\n const firebaseUidChanged = prevStableFirebaseUidRef.current !== stableFirebaseUidRef.current;\r\n if (firebaseUidChanged && stableFirebaseUidRef.current) {\r\n debugLog('Auto-loading presets due to firebaseUid change...');\r\n load();\r\n }\r\n }\r\n }, [memoizedOptions.autoLoad, stableControllerRef.current, stableFirebaseUidRef.current, isInitialized, load]);\r\n\r\n // Clear state when controller or firebaseUid changes - but only when they actually change\r\n useEffect(() => {\r\n const controllerChanged = prevStableControllerRef.current !== stableControllerRef.current;\r\n const firebaseUidChanged = prevStableFirebaseUidRef.current !== stableFirebaseUidRef.current;\r\n \r\n if ((controllerChanged || firebaseUidChanged) && isInitialized) {\r\n debugLog('Controller or firebaseUid changed, clearing state');\r\n setError(null);\r\n \r\n // Only reset initialization if firebaseUid became null/empty\r\n if (firebaseUidChanged && !stableFirebaseUidRef.current) {\r\n setIsInitialized(false);\r\n setPresets([]); // Clear presets when user changes\r\n }\r\n }\r\n \r\n prevStableControllerRef.current = stableControllerRef.current;\r\n prevStableFirebaseUidRef.current = stableFirebaseUidRef.current;\r\n }, [stableControllerRef.current, stableFirebaseUidRef.current, isInitialized, debugLog]);\r\n\r\n // Preset info object - memoized to prevent re-renders\r\n const info: PresetInfo = useMemo(() => ({\r\n isLoading,\r\n error,\r\n count: Array.isArray(presets) ? presets.length : 0,\r\n isInitialized\r\n }), [isLoading, error, presets, isInitialized]);\r\n\r\n // Actions object - memoized to prevent re-renders when functions don't change\r\n const actions: PresetActions = useMemo(() => ({\r\n create,\r\n rename,\r\n delete: deletePreset,\r\n load,\r\n findByAdjustments\r\n }), [create, rename, deletePreset, load, findByAdjustments]);\r\n\r\n // Return object - memoized to prevent re-renders when values don't change\r\n return useMemo(() => ({\r\n presets,\r\n info,\r\n actions\r\n }), [presets, info, actions]);\r\n}\r\n","'use client';\r\n\r\nimport { useState, useCallback, useEffect, useMemo, useRef } from 'react';\r\nimport { SelectChangeEvent } from \"@mui/material\";\r\nimport { AdjustmentState, Controller, Preset } from './type';\r\nimport { ColorAdjustment, Gallery } from '../../hooks/editor/type'\r\nimport { useAdjustmentHistoryBatch, ImageAdjustmentConfig } from '../useAdjustmentHistoryBatch';\r\nimport { AdjustmentValues } from \"../../lib/editor/honcho-editor\";\r\nimport { usePaging } from \"../usePaging\";\r\nimport { usePreset } from \"../usePreset\";\r\nimport { mapAdjustmentStateToAdjustmentEditor } from \"../../utils/adjustment\";\r\n\r\nexport interface PhotoData {\r\n key: string;\r\n src: string;\r\n original: string;\r\n width: number;\r\n height: number;\r\n alt: string;\r\n isSelected: boolean;\r\n adjustments?: Partial<AdjustmentValues>;\r\n}\r\n\r\n// Helper function to map the API response to the format our UI component needs\r\nconst mapGalleryToPhotoData = (gallery: Gallery, selectedIds: string[]): PhotoData => {\r\n return {\r\n key: gallery.id,\r\n src: gallery.raw_thumbnail?.path ? gallery.raw_thumbnail.path : gallery.thumbnail?.path,\r\n original: gallery.download?.path || gallery.thumbnail?.path,\r\n width: gallery.thumbnail?.width,\r\n height: gallery.thumbnail?.height,\r\n alt: gallery.id || 'gallery image',\r\n isSelected: selectedIds.includes(gallery.id),\r\n adjustments: gallery.editor_config?.color_adjustment,\r\n };\r\n};\r\n\r\nconst mapToImageAdjustmentConfig = (gallery: Gallery): ImageAdjustmentConfig => {\r\n return {\r\n imageId: gallery.id,\r\n adjustment: mapColorAdjustmentToAdjustmentState(gallery.editor_config?.color_adjustment),\r\n };\r\n};\r\n\r\nfunction mapColorAdjustmentToAdjustmentState(adj: ColorAdjustment | undefined): AdjustmentState | undefined {\r\n if (!adj) return undefined;\r\n\r\n return {\r\n tempScore: adj.temperature || 0,\r\n tintScore: adj.tint || 0,\r\n vibranceScore: adj.vibrance || 0,\r\n saturationScore: adj.saturation || 0,\r\n exposureScore: adj.exposure || 0,\r\n highlightsScore: adj.highlights || 0,\r\n shadowsScore: adj.shadows || 0,\r\n whitesScore: adj.whites || 0,\r\n blacksScore: adj.blacks || 0,\r\n contrastScore: adj.contrast || 0,\r\n clarityScore: adj.clarity || 0,\r\n sharpnessScore: adj.sharpness || 0,\r\n };\r\n}\r\n\r\n// Helper function to convert Preset to AdjustmentState\r\nconst presetToAdjustmentState = (preset: Preset): AdjustmentState => {\r\n return {\r\n tempScore: preset.temperature || 0,\r\n tintScore: preset.tint || 0,\r\n vibranceScore: preset.vibrance || 0,\r\n saturationScore: preset.saturation || 0,\r\n exposureScore: preset.exposure || 0,\r\n highlightsScore: preset.highlights || 0,\r\n shadowsScore: preset.shadows || 0,\r\n whitesScore: preset.whites || 0,\r\n blacksScore: preset.blacks || 0,\r\n contrastScore: preset.contrast || 0,\r\n clarityScore: preset.clarity || 0,\r\n sharpnessScore: preset.sharpness || 0,\r\n };\r\n};\r\n\r\n// Helper function to compare adjustment states\r\nconst adjustmentsMatch = (a: AdjustmentState, b: AdjustmentState): boolean => {\r\n const keys: (keyof AdjustmentState)[] = [\r\n 'tempScore', 'tintScore', 'vibranceScore', 'saturationScore',\r\n 'exposureScore', 'highlightsScore', 'shadowsScore', 'whitesScore',\r\n 'blacksScore', 'contrastScore', 'clarityScore', 'sharpnessScore'\r\n ];\r\n\r\n return keys.every(key => (a[key] || 0) === (b[key] || 0));\r\n};\r\n\r\n/**\r\n * Hook for bulk photo editing with multi-image backend synchronization.\r\n * \r\n * **Multi-Image Backend Sync:**\r\n * - Each selected image maintains its own history and backend state\r\n * - History operations (undo/redo) trigger separate controller.setHistoryIndex() calls for each selected image\r\n * - Preset application triggers separate controller.createEditorConfig() calls for each selected image\r\n * - Adjustment changes trigger separate controller.createEditorConfig() calls for each selected image\r\n * \r\n * **Key Features:**\r\n * - Individual history tracking per image with backend persistence\r\n * - Bulk operations that respect per-image differences\r\n * - Automatic backend synchronization for all state changes\r\n * - Comprehensive logging of multi-image operations\r\n */\r\nexport function useHonchoEditorBulk(controller: Controller, eventID: string, firebaseUid: string) {\r\n console.log('[useHonchoEditorBulk] 🏭 Initializing with controller for multi-image backend sync');\r\n const { currentBatch, selectedIds, actions: batchActions, historyInfo } = useAdjustmentHistoryBatch({\r\n controller,\r\n firebaseUid,\r\n eventId: eventID,\r\n devWarnings: true\r\n });\r\n const { images, info, actions } = usePaging(controller, firebaseUid, eventID, {\r\n autoLoad: true,\r\n autoReset: false // Prevent auto-reset to avoid loops\r\n });\r\n\r\n // Preset management\r\n const { presets, actions: presetActions } = usePreset(controller, firebaseUid, {\r\n autoLoad: true,\r\n devWarnings: true\r\n });\r\n\r\n // Track which images have been synced to prevent loops\r\n const lastSyncedImageIds = useRef<Set<string>>(new Set());\r\n\r\n // State for Bulk Editing \r\n const [selectedBulkPreset, setSelectedBulkPreset] = useState<string>('');\r\n\r\n // Calculate active preset based on selected images' adjustments\r\n const activePreset = useMemo(() => {\r\n if (selectedIds.length === 0) {\r\n return null;\r\n }\r\n\r\n // Get adjustments for all selected images\r\n const selectedAdjustments: AdjustmentState[] = selectedIds.map(imageId => {\r\n return currentBatch.allImages[imageId] || {\r\n tempScore: 0, tintScore: 0, vibranceScore: 0, saturationScore: 0,\r\n exposureScore: 0, highlightsScore: 0, shadowsScore: 0, whitesScore: 0,\r\n blacksScore: 0, contrastScore: 0, clarityScore: 0, sharpnessScore: 0,\r\n };\r\n });\r\n\r\n // Check if all selected images have the same adjustments\r\n const firstAdjustment = selectedAdjustments[0];\r\n const allSameAdjustments = selectedAdjustments.every(adj => \r\n adjustmentsMatch(adj, firstAdjustment)\r\n );\r\n\r\n if (!allSameAdjustments) {\r\n // Selected images have different adjustments\r\n return null;\r\n }\r\n\r\n // Find preset that matches the common adjustment state\r\n const matchingPreset = presets.find(preset => {\r\n const presetAdjustments = presetToAdjustmentState(preset);\r\n return adjustmentsMatch(presetAdjustments, firstAdjustment);\r\n });\r\n\r\n return matchingPreset || null;\r\n }, [selectedIds, currentBatch.allImages, presets]);\r\n\r\n // Update selectedBulkPreset when activePreset changes\r\n useEffect(() => {\r\n setSelectedBulkPreset(activePreset?.id || '');\r\n }, [activePreset]);\r\n\r\n // Use loading states from usePaging instead of local state\r\n const isLoading = info.isLoading;\r\n const error = info.error;\r\n const hasMore = info.hasMore;\r\n\r\n const imageData = useMemo(() => {\r\n // console.debug(\"imageData recalculating with:\", {\r\n // imagesLength: images.length,\r\n // selectedIds,\r\n // currentBatch_allImages: currentBatch.allImages,\r\n // currentBatch_allImages_keys: Object.keys(currentBatch.allImages)\r\n // });\r\n \r\n const res = images.map(item => {\r\n const basePhoto = mapGalleryToPhotoData(item, selectedIds);\r\n const batchAdjustment = currentBatch.allImages[item.id];\r\n\r\n if (batchAdjustment) {\r\n const adjustmentsValues = mapAdjustmentStateToAdjustmentEditor(batchAdjustment);\r\n basePhoto.adjustments = adjustmentsValues;\r\n }\r\n \r\n // Merge batch adjustments over backend adjustments\r\n return batchAdjustment ? { ...basePhoto } : basePhoto;\r\n });\r\n return res;\r\n }, [images, selectedIds, currentBatch.allImages]);\r\n\r\n // Store the latest batchActions.syncAdjustment in a ref to avoid dependency issues\r\n const syncAdjustmentRef = useRef(batchActions.syncAdjustment);\r\n syncAdjustmentRef.current = batchActions.syncAdjustment;\r\n\r\n // Safe sync: Only sync new images to prevent infinite loops\r\n useEffect(() => {\r\n console.log('[useHonchoEditorBulk] 🔄 Sync effect triggered:', {\r\n imagesLength: images.length,\r\n imageIds: images.map(img => img.id),\r\n lastSyncedImageIds: Array.from(lastSyncedImageIds.current),\r\n lastSyncedCount: lastSyncedImageIds.current.size\r\n });\r\n\r\n if (images.length === 0) return;\r\n \r\n // Check if we have new images that haven't been synced\r\n const currentImageIds = new Set(images.map(img => img.id));\r\n const hasNewImages = images.some(img => !lastSyncedImageIds.current.has(img.id));\r\n \r\n console.log('[useHonchoEditorBulk] 🔍 New images check:', {\r\n currentImageIds: Array.from(currentImageIds),\r\n hasNewImages,\r\n newImages: images.filter(img => !lastSyncedImageIds.current.has(img.id)).map(img => img.id)\r\n });\r\n \r\n if (hasNewImages) {\r\n console.log('[useHonchoEditorBulk] ⚠️ SYNC TRIGGER: Syncing new images to batch (THIS RESETS HISTORY!):', images.length);\r\n syncAdjustmentRef.current(images.map(mapToImageAdjustmentConfig));\r\n lastSyncedImageIds.current = currentImageIds;\r\n } else {\r\n console.log('[useHonchoEditorBulk] ✅ No new images, skipping sync (history preserved)');\r\n }\r\n }, [images]); // Only depend on images, not batchActions\r\n\r\n const handleBackCallbackBulk = useCallback(() => {\r\n const lastSelectedId = selectedIds.length > 0 ? selectedIds[selectedIds.length - 1] : \"\";\r\n controller.handleBack(firebaseUid, lastSelectedId);\r\n }, [controller, firebaseUid, selectedIds]);\r\n \r\n const handleSelectBulkPreset = useCallback((event: SelectChangeEvent<string>) => {\r\n const presetId = event.target.value as string;\r\n setSelectedBulkPreset(presetId);\r\n\r\n console.log('[useHonchoEditorBulk] 🎨 Preset selection attempt:', {\r\n presetId,\r\n selectedImages: selectedIds,\r\n imageCount: selectedIds.length,\r\n hasController: !!controller,\r\n hasFirebaseUid: !!firebaseUid\r\n });\r\n\r\n if (!presetId) {\r\n console.log('[useHonchoEditorBulk] ❌ No preset ID provided, skipping backend call');\r\n return;\r\n }\r\n\r\n if (selectedIds.length === 0) {\r\n console.log('[useHonchoEditorBulk] ❌ No images selected, skipping backend call');\r\n return;\r\n }\r\n\r\n console.log('[useHonchoEditorBulk] 🎨 Applying preset to multiple images:', {\r\n presetId,\r\n selectedImages: selectedIds,\r\n imageCount: selectedIds.length\r\n });\r\n \r\n // Find the preset\r\n const preset = presets.find(p => p.id === presetId);\r\n if (!preset) {\r\n console.log('[useHonchoEditorBulk] ❌ Preset not found in presets list:', presetId);\r\n return;\r\n }\r\n\r\n // Convert preset to adjustment state\r\n const presetAdjustments = presetToAdjustmentState(preset);\r\n \r\n console.log('[useHonchoEditorBulk] 📤 Sending preset adjustments to controller for each image:', presetAdjustments);\r\n console.log('[useHonchoEditorBulk] 🔄 About to call batchActions.adjustSelectedWithPreset');\r\n \r\n // Apply preset directly to all selected images using the clean action\r\n // This will trigger backend calls for each selected image via adjustSelectedWithPreset\r\n batchActions.adjustSelectedWithPreset(presetAdjustments);\r\n \r\n console.log('[useHonchoEditorBulk] ✅ Called batchActions.adjustSelectedWithPreset, backend calls should be triggered');\r\n }, [presets, selectedIds, batchActions, controller, firebaseUid]);\r\n // This factory creates functions that adjust a value for all selected images\r\n \r\n const createRelativeAdjuster = useCallback((key: keyof AdjustmentState, amount: number) => () => {\r\n console.debug(`[useHonchoEditorBulk] 🎛️ Bulk ${key} adjustment:`, { \r\n key, \r\n amount, \r\n selectedImages: selectedIds,\r\n imageCount: selectedIds.length \r\n });\r\n console.debug('[useHonchoEditorBulk] 📤 Sending bulk adjustment to controller for each selected image');\r\n console.debug(\"currentBatch.allImages before:\", currentBatch.allImages);\r\n batchActions.adjustSelected({ [key]: amount });\r\n \r\n // Debug after a short delay to see if the state changed\r\n setTimeout(() => {\r\n console.debug(\"currentBatch.allImages after:\", currentBatch.allImages);\r\n }, 100);\r\n }, [batchActions, selectedIds, currentBatch.allImages]);\r\n\r\n const handleBulkTempDecreaseMax = createRelativeAdjuster('tempScore', -20);\r\n const handleBulkTempDecrease = createRelativeAdjuster('tempScore', -5);\r\n const handleBulkTempIncrease = createRelativeAdjuster('tempScore', 5);\r\n const handleBulkTempIncreaseMax = createRelativeAdjuster('tempScore', 20);\r\n\r\n const handleBulkTintDecreaseMax = createRelativeAdjuster('tintScore', -20);\r\n const handleBulkTintDecrease = createRelativeAdjuster('tintScore', -5);\r\n const handleBulkTintIncrease = createRelativeAdjuster('tintScore', 5);\r\n const handleBulkTintIncreaseMax = createRelativeAdjuster('tintScore', 20);\r\n \r\n const handleBulkVibranceDecreaseMax = createRelativeAdjuster('vibranceScore', -20);\r\n const handleBulkVibranceDecrease = createRelativeAdjuster('vibranceScore', -5);\r\n const handleBulkVibranceIncrease = createRelativeAdjuster('vibranceScore', 5);\r\n const handleBulkVibranceIncreaseMax = createRelativeAdjuster('vibranceScore', 20);\r\n \r\n const handleBulkSaturationDecreaseMax = createRelativeAdjuster('saturationScore', -20);\r\n const handleBulkSaturationDecrease = createRelativeAdjuster('saturationScore', -5);\r\n const handleBulkSaturationIncrease = createRelativeAdjuster('saturationScore', 5);\r\n const handleBulkSaturationIncreaseMax = createRelativeAdjuster('saturationScore', 20);\r\n \r\n const handleBulkExposureDecreaseMax = createRelativeAdjuster('exposureScore', -20);\r\n const handleBulkExposureDecrease = createRelativeAdjuster('exposureScore', -5);\r\n const handleBulkExposureIncrease = createRelativeAdjuster('exposureScore', 5);\r\n const handleBulkExposureIncreaseMax = createRelativeAdjuster('exposureScore', 20);\r\n\r\n const handleBulkContrastDecreaseMax = createRelativeAdjuster('contrastScore', -20);\r\n const handleBulkContrastDecrease = createRelativeAdjuster('contrastScore', -5);\r\n const handleBulkContrastIncrease = createRelativeAdjuster('contrastScore', 5);\r\n const handleBulkContrastIncreaseMax = createRelativeAdjuster('contrastScore', 20);\r\n\r\n const handleBulkHighlightsDecreaseMax = createRelativeAdjuster('highlightsScore', -20);\r\n const handleBulkHighlightsDecrease = createRelativeAdjuster('highlightsScore', -5);\r\n const handleBulkHighlightsIncrease = createRelativeAdjuster('highlightsScore', 5);\r\n const handleBulkHighlightsIncreaseMax = createRelativeAdjuster('highlightsScore', 20);\r\n \r\n const handleBulkShadowsDecreaseMax = createRelativeAdjuster('shadowsScore', -20);\r\n const handleBulkShadowsDecrease = createRelativeAdjuster('shadowsScore', -5);\r\n const handleBulkShadowsIncrease = createRelativeAdjuster('shadowsScore', 5);\r\n const handleBulkShadowsIncreaseMax = createRelativeAdjuster('shadowsScore', 20);\r\n\r\n const handleBulkWhitesDecreaseMax = createRelativeAdjuster('whitesScore', -20);\r\n const handleBulkWhitesDecrease = createRelativeAdjuster('whitesScore', -5);\r\n const handleBulkWhitesIncrease = createRelativeAdjuster('whitesScore', 5);\r\n const handleBulkWhitesIncreaseMax = createRelativeAdjuster('whitesScore', 20);\r\n \r\n const handleBulkBlacksDecreaseMax = createRelativeAdjuster('blacksScore', -20);\r\n const handleBulkBlacksDecrease = createRelativeAdjuster('blacksScore', -5);\r\n const handleBulkBlacksIncrease = createRelativeAdjuster('blacksScore', 5);\r\n const handleBulkBlacksIncreaseMax = createRelativeAdjuster('blacksScore', 20);\r\n \r\n const handleBulkClarityDecreaseMax = createRelativeAdjuster('clarityScore', -20);\r\n const handleBulkClarityDecrease = createRelativeAdjuster('clarityScore', -5);\r\n const handleBulkClarityIncrease = createRelativeAdjuster('clarityScore', 5);\r\n const handleBulkClarityIncreaseMax = createRelativeAdjuster('clarityScore', 20);\r\n \r\n const handleBulkSharpnessDecreaseMax = createRelativeAdjuster('sharpnessScore', -20);\r\n const handleBulkSharpnessDecrease = createRelativeAdjuster('sharpnessScore', -5);\r\n const handleBulkSharpnessIncrease = createRelativeAdjuster('sharpnessScore', 5);\r\n const handleBulkSharpnessIncreaseMax = createRelativeAdjuster('sharpnessScore', 20);\r\n\r\n // const loadImages = useCallback(async (pageNum: number) => {\r\n // // Use the correct loading state\r\n // if (pageNum === 1) {\r\n // setIsLoading(true);\r\n // } else {\r\n // setIsFetchingMore(true);\r\n // }\r\n // setError(null);\r\n\r\n // try {\r\n // const response = await controller.getImageList(firebaseUid, eventID, pageNum);\r\n\r\n // // Sync adjustments for the new images with the batch history\r\n // batchActions.syncAdjustment(response.gallery.map(mapToImageAdjustmentConfig));\r\n\r\n // // Append new images for page > 1, otherwise replace\r\n // setImageCollection(prev => pageNum === 1 ? response.gallery : [...prev, ...response.gallery]);\r\n \r\n // setPage(response.current_page);\r\n // setHasMore(response.next_page > 0 && response.gallery.length > 0);\r\n\r\n // } catch (err: any) {\r\n // console.error(\"Failed to fetch image list:\", err);\r\n // setError(err.message || \"Could not load images.\");\r\n // } finally {\r\n // if (pageNum === 1) {\r\n // setIsLoading(false);\r\n // } else {\r\n // setIsFetchingMore(false);\r\n // }\r\n // }\r\n // }, [controller, firebaseUid, eventID, batchActions]);\r\n\r\n // const loadMoreImages = useCallback(() => {\r\n // if (!isFetchingMore && hasMore) {\r\n // loadImages(page + 1);\r\n // }\r\n // }, [isFetchingMore, hasMore, page, loadImages]);\r\n\r\n // Note: Image loading is now handled by usePaging hook\r\n // The sync logic above handles syncing loaded images to batch state\r\n\r\n // useEffect(() => {\r\n // if (eventID && firebaseUid) {\r\n // setImageCollection([]); // reset when event changes\r\n // setPage(1);\r\n // loadImages(1);\r\n // }\r\n // }, [eventID, firebaseUid, loadImages]);\r\n\r\n return {\r\n imageData,\r\n isLoading,\r\n error,\r\n selectedIds,\r\n hasMore,\r\n // loadMoreImages,\r\n // Gallery Handlers\r\n handleBackCallbackBulk,\r\n\r\n // Preset functionality\r\n presets,\r\n selectedBulkPreset,\r\n activePreset,\r\n handleSelectBulkPreset,\r\n \r\n // Preset creation handlers\r\n presetActions, // Expose preset actions for create/rename/delete\r\n \r\n handleToggleImageSelection: batchActions.toggleSelection,\r\n handleLoadMore: actions.loadMore,\r\n handleRefresh: actions.refresh,\r\n\r\n // Adjustment\r\n handleBulkTempDecreaseMax,\r\n handleBulkTempDecrease,\r\n handleBulkTempIncrease,\r\n handleBulkTempIncreaseMax,\r\n handleBulkTintDecreaseMax,\r\n handleBulkTintDecrease,\r\n handleBulkTintIncrease,\r\n handleBulkTintIncreaseMax,\r\n handleBulkVibranceDecreaseMax,\r\n handleBulkVibranceDecrease,\r\n handleBulkVibranceIncrease,\r\n handleBulkVibranceIncreaseMax,\r\n handleBulkSaturationDecreaseMax,\r\n handleBulkSaturationDecrease,\r\n handleBulkSaturationIncrease,\r\n handleBulkSaturationIncreaseMax,\r\n // Adjustment Light\r\n handleBulkExposureDecreaseMax,\r\n handleBulkExposureDecrease,\r\n handleBulkExposureIncrease,\r\n handleBulkExposureIncreaseMax,\r\n handleBulkContrastDecreaseMax,\r\n handleBulkContrastDecrease,\r\n handleBulkContrastIncrease,\r\n handleBulkContrastIncreaseMax,\r\n handleBulkHighlightsDecreaseMax,\r\n handleBulkHighlightsDecrease,\r\n handleBulkHighlightsIncrease,\r\n handleBulkHighlightsIncreaseMax,\r\n handleBulkShadowsDecreaseMax,\r\n handleBulkShadowsDecrease,\r\n handleBulkShadowsIncrease,\r\n handleBulkShadowsIncreaseMax,\r\n handleBulkWhitesDecreaseMax,\r\n handleBulkWhitesDecrease,\r\n handleBulkWhitesIncrease,\r\n handleBulkWhitesIncreaseMax,\r\n handleBulkBlacksDecreaseMax,\r\n handleBulkBlacksDecrease,\r\n handleBulkBlacksIncrease,\r\n handleBulkBlacksIncreaseMax,\r\n // Adjustment Details\r\n handleBulkClarityDecreaseMax,\r\n handleBulkClarityDecrease,\r\n handleBulkClarityIncrease,\r\n handleBulkClarityIncreaseMax,\r\n handleBulkSharpnessDecreaseMax,\r\n handleBulkSharpnessDecrease,\r\n handleBulkSharpnessIncrease,\r\n handleBulkSharpnessIncreaseMax,\r\n \r\n // History actions\r\n handleUndo: () => {\r\n console.log('[useHonchoEditorBulk] ⏪ Undo requested for multiple images:', {\r\n selectedImages: selectedIds,\r\n imageCount: selectedIds.length\r\n });\r\n console.log('[useHonchoEditorBulk] 📤 Sending undo (setHistoryIndex) to controller for each image');\r\n return batchActions.undo();\r\n },\r\n handleRedo: () => {\r\n console.log('[useHonchoEditorBulk] ⏩ Redo requested for multiple images:', {\r\n selectedImages: selectedIds,\r\n imageCount: selectedIds.length\r\n });\r\n console.log('[useHonchoEditorBulk] 📤 Sending redo (setHistoryIndex) to controller for each image');\r\n return batchActions.redo();\r\n },\r\n handleReset: batchActions.reset,\r\n historyInfo,\r\n };\r\n}","import { useState, useCallback, useMemo, useRef, useEffect } from 'react';\r\nimport { AdjustmentState, Controller } from './editor/type';\r\nimport { mapAdjustmentStateToColorAdjustment, mapColorAdjustmentToAdjustmentState } from '../utils/adjustment';\r\n\r\nexport interface HistoryAdjustmentBatch {\r\n imageId: string;\r\n currentHistoryEntryId: string;\r\n history: HistoryAdjustmentEntry[];\r\n}\r\n\r\nexport interface HistoryAdjustmentEntry {\r\n id: string; // This ID is also used as the task ID for backend operations\r\n adjustment: AdjustmentState;\r\n}\r\n\r\n/**\r\n * Configuration for image with adjustment state\r\n */\r\nexport interface ImageAdjustmentConfig {\r\n imageId: string;\r\n /** Adjustment state for this image. If not provided, uses default (all zeros) */\r\n adjustment?: AdjustmentState;\r\n}\r\n\r\n/**\r\n * Batch adjustment state - maps image IDs to their adjustment states\r\n */\r\nexport interface BatchAdjustmentState {\r\n /** Currently selected images that are being actively adjusted */\r\n currentSelection: {\r\n [imageId: string]: AdjustmentState;\r\n };\r\n /** All images that have been selected/adjusted before (persistent state) */\r\n allImages: {\r\n [imageId: string]: AdjustmentState;\r\n };\r\n /** Track initial/baseline state for each image */\r\n initialStates: {\r\n [imageId: string]: AdjustmentState;\r\n };\r\n}\r\n\r\n/**\r\n * Configuration options for the batch adjustment history hook\r\n */\r\ninterface BatchHistoryOptions {\r\n /** Maximum number of history entries to keep. Use 'unlimited' for no limit */\r\n maxSize?: number | 'unlimited';\r\n /** Enable development warnings for performance issues */\r\n devWarnings?: boolean;\r\n /** Default adjustment state for new images */\r\n defaultAdjustmentState?: Partial<AdjustmentState>;\r\n /** Controller for backend operations */\r\n controller?: Controller;\r\n /** Firebase UID for backend operations */\r\n firebaseUid?: string;\r\n /** Event ID for backend operations */\r\n eventId?: string;\r\n}\r\n\r\n/**\r\n * Information about the current batch history state\r\n */\r\nexport interface BatchHistoryInfo {\r\n /** Whether undo operation is available for selected images */\r\n canUndo: boolean;\r\n /** Whether redo operation is available for selected images */\r\n canRedo: boolean;\r\n /** Current position in history (0-based index) */\r\n currentIndex: number;\r\n /** Total number of states in history */\r\n totalStates: number;\r\n /** Number of currently selected images */\r\n selectedCount: number;\r\n /** Total number of images being managed */\r\n totalImages: number;\r\n /** Current size of history in memory */\r\n historySize: number;\r\n}\r\n\r\n/**\r\n * Actions available for batch history management\r\n */\r\nexport interface BatchHistoryActions {\r\n /** Apply adjustment deltas to selected images */\r\n adjustSelected: (delta: Partial<AdjustmentState>) => void;\r\n /** Apply preset values directly to selected images (preserves history) */\r\n adjustSelectedWithPreset: (presetAdjustments: AdjustmentState) => void;\r\n /** Undo last changes to selected images */\r\n undo: () => void;\r\n /** Redo next changes to selected images */\r\n redo: () => void;\r\n /** Reset selected images to default state */\r\n reset: (imageIds?: string[]) => void;\r\n /** Set selection with optional initial adjustments per image */\r\n setSelection: (configs: ImageAdjustmentConfig[]) => void;\r\n /** Sync/replace adjustment for images (clears their history) */\r\n syncAdjustment: (configs: ImageAdjustmentConfig[]) => void;\r\n /** Check for gallery updates and sync history for updated images */\r\n syncGalleryUpdates: () => Promise<void>;\r\n /** Add or remove image from selection */\r\n toggleSelection: (imageId: string) => void;\r\n /** Select all images */\r\n selectAll: () => void;\r\n /** Clear selection */\r\n clearSelection: () => void;\r\n /** Jump to specific index in history */\r\n jumpToIndex: (index: number) => void;\r\n /** Clear all history and start fresh */\r\n clearHistory: () => void;\r\n /** Get copy of current batch state */\r\n getCurrentBatch: () => BatchAdjustmentState;\r\n /** Sync entire batch state */\r\n syncBatch: (newBatch: BatchAdjustmentState, targetIndex?: number) => void;\r\n}\r\n\r\n/**\r\n * Configuration actions for runtime adjustment\r\n */\r\nexport interface BatchHistoryConfig {\r\n /** Set maximum history size */\r\n setMaxSize: (size: number | 'unlimited') => void;\r\n /** Get current memory usage estimate */\r\n getMemoryUsage: () => number;\r\n}\r\n\r\n/**\r\n * Return type for the useAdjustmentHistoryBatch hook\r\n */\r\nexport interface UseAdjustmentHistoryBatchReturn {\r\n /** Current batch adjustment state */\r\n currentBatch: BatchAdjustmentState;\r\n /** Currently selected image IDs */\r\n selectedIds: string[];\r\n /** All image IDs being managed */\r\n allImageIds: string[];\r\n /** Information about history state */\r\n historyInfo: BatchHistoryInfo;\r\n /** Available history actions */\r\n actions: BatchHistoryActions;\r\n /** Configuration options */\r\n config: BatchHistoryConfig;\r\n}\r\n\r\n/**\r\n * Create default adjustment state\r\n */\r\nconst createDefaultAdjustmentState = (overrides?: Partial<AdjustmentState>): AdjustmentState => ({\r\n tempScore: 0,\r\n tintScore: 0,\r\n vibranceScore: 0,\r\n saturationScore: 0,\r\n exposureScore: 0,\r\n highlightsScore: 0,\r\n shadowsScore: 0,\r\n whitesScore: 0,\r\n blacksScore: 0,\r\n contrastScore: 0,\r\n clarityScore: 0,\r\n sharpnessScore: 0,\r\n ...overrides\r\n});\r\n\r\n/**\r\n * Compare two BatchAdjustmentState objects for equality\r\n */\r\nconst compareBatchStates = (a: BatchAdjustmentState, b: BatchAdjustmentState): boolean => {\r\n try {\r\n return JSON.stringify(a) === JSON.stringify(b);\r\n } catch (error) {\r\n console.warn('Failed to compare batch states with JSON.stringify:', error);\r\n return false;\r\n }\r\n};\r\n\r\n/**\r\n * Create empty batch state\r\n */\r\nconst createEmptyBatchState = (): BatchAdjustmentState => ({\r\n currentSelection: {},\r\n allImages: {},\r\n initialStates: {}\r\n});\r\n\r\n/**\r\n * Generate unique ID for history entries using UUID format\r\n */\r\nconst generateEntryId = (): string => {\r\n // Simple UUID v4 implementation\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\r\n const r = Math.random() * 16 | 0;\r\n const v = c === 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n};\r\n\r\n/**\r\n * Generate unique task ID for backend operations (same as entry ID)\r\n */\r\nconst generateTaskId = (): string => {\r\n return generateEntryId();\r\n};\r\n\r\n/**\r\n * Advanced hook for managing batch AdjustmentState history with selective undo/redo functionality.\r\n * \r\n * **Pure State Management Design:**\r\n * - Starts empty, no image loading functionality\r\n * - Focus on state management and history tracking only\r\n * - Selection-based operations with persistent state\r\n * - Manual selection via `actions.setSelection()`\r\n * \r\n * **Key Features:**\r\n * - **Current Selection**: Images actively being adjusted\r\n * - **All Images**: Persistent state for every image touched\r\n * - **Selective Operations**: Undo/redo only affects selected images\r\n * - **Automatic State Persistence**: Images remain in allImages even when deselected\r\n * \r\n * **Typical Usage Flow:**\r\n * ```typescript\r\n * const { actions, currentBatch, selectedIds } = useAdjustmentHistoryBatch();\r\n * \r\n * // Select images (new images get default state automatically)\r\n * actions.setSelection(['img1', 'img2', 'img3']);\r\n * \r\n * // Apply adjustments to selected images\r\n * actions.adjustSelected({ exposureScore: 10 });\r\n * \r\n * // Change selection (img1, img2 state persists in allImages)\r\n * actions.setSelection(['img3']); \r\n * \r\n * // Adjust only img3\r\n * actions.adjustSelected({ contrastScore: 5 });\r\n * \r\n * // Undo affects only currently selected (img3)\r\n * actions.undo();\r\n * ```\r\n * \r\n * **State Structure:**\r\n * - `currentBatch.currentSelection`: Currently selected images and their states\r\n * - `currentBatch.allImages`: All images that have been selected/adjusted (persistent)\r\n * - `selectedIds`: Array of currently selected image IDs\r\n * \r\n * @param options - Configuration options for history behavior\r\n * @returns Object with current batch, selection, history info, actions, and config\r\n */\r\nexport function useAdjustmentHistoryBatch(\r\n options: BatchHistoryOptions = {}\r\n): UseAdjustmentHistoryBatchReturn {\r\n // Internal stabilization\r\n const internalOptions = useMemo(() => ({\r\n maxSize: options.maxSize ?? 'unlimited' as const,\r\n devWarnings: options.devWarnings ?? false,\r\n defaultAdjustmentState: options.defaultAdjustmentState ?? {},\r\n controller: options.controller,\r\n firebaseUid: options.firebaseUid,\r\n eventId: options.eventId\r\n }), [\r\n options.maxSize, \r\n options.devWarnings,\r\n options.defaultAdjustmentState,\r\n options.controller,\r\n options.firebaseUid,\r\n options.eventId\r\n ]);\r\n\r\n // Core state management - using per-image history instead of batch history\r\n const [allImageIds, setAllImageIds] = useState<string[]>([]);\r\n const [selectedIds, setSelectedIds] = useState<string[]>([]);\r\n const [imageHistories, setImageHistories] = useState<HistoryAdjustmentBatch[]>([]);\r\n const [currentBatch, setCurrentBatch] = useState<BatchAdjustmentState>(createEmptyBatchState());\r\n const [lastUpdateTimestamp, setLastUpdateTimestamp] = useState<number>(Date.now());\r\n \r\n // Configuration refs\r\n const maxSizeRef = useRef(internalOptions.maxSize);\r\n const devWarningsRef = useRef(internalOptions.devWarnings);\r\n\r\n // Helper function to rebuild currentBatch from imageHistories\r\n const rebuildCurrentBatch = useCallback(() => {\r\n console.log('[useAdjustmentHistoryBatch] 🔧 rebuildCurrentBatch called with imageHistories:', \r\n imageHistories.map(h => ({\r\n imageId: h.imageId,\r\n currentHistoryEntryId: h.currentHistoryEntryId,\r\n historyLength: h.history.length,\r\n historyIds: h.history.map(entry => entry.id)\r\n }))\r\n );\r\n\r\n const newBatch = createEmptyBatchState();\r\n \r\n imageHistories.forEach(imageHistory => {\r\n // Find current adjustment using currentHistoryEntryId\r\n const currentEntry = imageHistory.history.find(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n \r\n console.log(`[useAdjustmentHistoryBatch] 🔍 rebuildCurrentBatch for image ${imageHistory.imageId}:`, {\r\n currentHistoryEntryId: imageHistory.currentHistoryEntryId,\r\n foundCurrentEntry: !!currentEntry,\r\n historyLength: imageHistory.history.length,\r\n historyIds: imageHistory.history.map(entry => entry.id)\r\n });\r\n\r\n if (currentEntry) {\r\n newBatch.allImages[imageHistory.imageId] = currentEntry.adjustment;\r\n if (selectedIds.includes(imageHistory.imageId)) {\r\n newBatch.currentSelection[imageHistory.imageId] = currentEntry.adjustment;\r\n }\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Successfully rebuilt batch for image ${imageHistory.imageId}`);\r\n } else {\r\n console.error(`[useAdjustmentHistoryBatch] ❌ CRITICAL: Current entry not found for image ${imageHistory.imageId}!`, {\r\n searchingFor: imageHistory.currentHistoryEntryId,\r\n availableIds: imageHistory.history.map(entry => entry.id),\r\n historyLength: imageHistory.history.length\r\n });\r\n }\r\n });\r\n \r\n console.log('[useAdjustmentHistoryBatch] 🔧 rebuildCurrentBatch result:', {\r\n allImagesCount: Object.keys(newBatch.allImages).length,\r\n currentSelectionCount: Object.keys(newBatch.currentSelection).length,\r\n allImagesIds: Object.keys(newBatch.allImages),\r\n currentSelectionIds: Object.keys(newBatch.currentSelection)\r\n });\r\n \r\n return newBatch;\r\n }, [imageHistories, selectedIds]);\r\n\r\n // Sync currentBatch with imageHistories\r\n useEffect(() => {\r\n setCurrentBatch(rebuildCurrentBatch());\r\n }, [rebuildCurrentBatch]);\r\n\r\n // Memory usage calculation\r\n const getMemoryUsage = useCallback(() => {\r\n try {\r\n const historiesString = JSON.stringify(imageHistories);\r\n return historiesString.length * 2; // Rough estimate: 2 bytes per character\r\n } catch (error) {\r\n console.warn('Failed to estimate memory usage:', error);\r\n return imageHistories.length * 100 * 1000; // Fallback estimate\r\n }\r\n }, [imageHistories]);\r\n\r\n // Trim individual image histories to specified size\r\n const trimImageHistoriesToSize = useCallback((size: number) => {\r\n if (size <= 0) return;\r\n \r\n setImageHistories(prevHistories => \r\n prevHistories.map(imageHistory => ({\r\n ...imageHistory,\r\n history: imageHistory.history.length <= size \r\n ? imageHistory.history \r\n : imageHistory.history.slice(-size) // Keep last 'size' entries\r\n }))\r\n );\r\n }, []);\r\n\r\n // Apply max size limit\r\n const enforceMaxSize = useCallback(() => {\r\n if (maxSizeRef.current === 'unlimited') return;\r\n \r\n const maxSize = maxSizeRef.current;\r\n if (typeof maxSize === 'number' && imageHistories.length > 0) {\r\n const totalHistorySize = imageHistories.reduce((sum, h) => sum + h.history.length, 0);\r\n if (totalHistorySize > maxSize * imageHistories.length) {\r\n trimImageHistoriesToSize(maxSize);\r\n }\r\n }\r\n }, [imageHistories, trimImageHistoriesToSize]);\r\n\r\n // Apply adjustment deltas to selected images - with entry-based history and backend sync\r\n const adjustSelected = useCallback(async (delta: Partial<AdjustmentState>) => {\r\n if (selectedIds.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] adjustSelected called with no selection');\r\n }\r\n return;\r\n }\r\n\r\n // Prepare backend operations BEFORE state update (outside setImageHistories)\r\n const backendOperations: Array<{\r\n imageId: string;\r\n taskId: string;\r\n adjustment: AdjustmentState;\r\n replaceFromTaskId?: string;\r\n }> = [];\r\n\r\n // Process each image to prepare operations\r\n const operationsToApply: Array<{\r\n imageId: string;\r\n newEntryId: string;\r\n newHistory: HistoryAdjustmentEntry[];\r\n }> = [];\r\n\r\n imageHistories.forEach(imageHistory => {\r\n if (!selectedIds.includes(imageHistory.imageId)) {\r\n return; // Skip images not being adjusted\r\n }\r\n\r\n // Get current adjustment from current entry\r\n const currentEntry = imageHistory.history.find(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n const currentAdjustment = currentEntry?.adjustment || createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n \r\n // Apply deltas with clamping\r\n const newAdjustment = { ...currentAdjustment };\r\n (Object.keys(delta) as (keyof AdjustmentState)[]).forEach(key => {\r\n const deltaValue = delta[key];\r\n if (typeof deltaValue === 'number') {\r\n const currentValue = newAdjustment[key] as number;\r\n newAdjustment[key] = Math.max(-100, Math.min(100, currentValue + deltaValue)) as any;\r\n }\r\n });\r\n\r\n // Check if user is in the middle of history (not at latest state)\r\n const currentEntryIndex = imageHistory.history.findIndex(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n const isInMiddleOfHistory = currentEntryIndex < imageHistory.history.length - 1;\r\n let replaceFromTaskId: string | undefined;\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🎯 Delta replace logic for image ${imageHistory.imageId}:`, {\r\n currentEntryIndex,\r\n historyLength: imageHistory.history.length,\r\n isInMiddleOfHistory,\r\n currentEntryId: currentEntry?.id\r\n });\r\n\r\n if (isInMiddleOfHistory) {\r\n // If user is in middle of history, get the task ID of current position\r\n replaceFromTaskId = currentEntry?.id;\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 DELTA will REPLACE current position. replaceFromTaskId=${replaceFromTaskId}`);\r\n } else {\r\n console.log(`[useAdjustmentHistoryBatch] ➕ DELTA will ADD new entry (at end of history)`);\r\n }\r\n\r\n // Generate new task ID for backend (same as entry ID)\r\n const taskId = generateTaskId();\r\n\r\n // Create new entry with task ID\r\n const newEntryId = taskId; // Use the same ID for both entry and task\r\n const newEntry: HistoryAdjustmentEntry = {\r\n id: newEntryId,\r\n adjustment: newAdjustment\r\n };\r\n\r\n // Build new history\r\n let newHistory: HistoryAdjustmentEntry[];\r\n \r\n if (isInMiddleOfHistory) {\r\n // If in middle of history, truncate from current position and add new entry\r\n newHistory = [...imageHistory.history.slice(0, currentEntryIndex + 1), newEntry];\r\n } else {\r\n // If at end of history, just add new entry\r\n newHistory = [...imageHistory.history, newEntry];\r\n }\r\n \r\n // Trim if needed\r\n const maxSize = maxSizeRef.current;\r\n const trimmedHistory = typeof maxSize === 'number' && newHistory.length > maxSize\r\n ? newHistory.slice(-maxSize)\r\n : newHistory;\r\n\r\n // Store operation for state update\r\n operationsToApply.push({\r\n imageId: imageHistory.imageId,\r\n newEntryId,\r\n newHistory: trimmedHistory\r\n });\r\n\r\n // Prepare backend operation (OUTSIDE state setter)\r\n if (internalOptions.controller && internalOptions.firebaseUid) {\r\n backendOperations.push({\r\n imageId: imageHistory.imageId,\r\n taskId,\r\n adjustment: newAdjustment,\r\n replaceFromTaskId\r\n });\r\n }\r\n });\r\n\r\n // Now update state with prepared operations (no backend preparation inside)\r\n setImageHistories(prevHistories => {\r\n return prevHistories.map(imageHistory => {\r\n // Find operation for this image\r\n const operation = operationsToApply.find(op => op.imageId === imageHistory.imageId);\r\n if (!operation) {\r\n return imageHistory; // No change for images not being adjusted\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 📝 Applying state update for delta on image ${imageHistory.imageId}`);\r\n\r\n return {\r\n ...imageHistory,\r\n history: operation.newHistory,\r\n currentHistoryEntryId: operation.newEntryId // Update current pointer\r\n };\r\n });\r\n });\r\n\r\n // Perform backend operations asynchronously (already prepared)\r\n if (backendOperations.length > 0 && internalOptions.controller && internalOptions.firebaseUid) {\r\n try {\r\n console.log(`[useAdjustmentHistoryBatch] 📤 Syncing ${backendOperations.length} adjustments to backend (createEditorConfig for each image)`);\r\n \r\n const promises = backendOperations.map(async (operation) => {\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Calling createEditorConfig for image ${operation.imageId} with taskId ${operation.taskId}`);\r\n await internalOptions.controller!.createEditorConfig(internalOptions.firebaseUid!, {\r\n gallery_id: operation.imageId,\r\n task_id: operation.taskId,\r\n color_adjustment: mapAdjustmentStateToColorAdjustment(operation.adjustment),\r\n replace_from: operation.replaceFromTaskId\r\n });\r\n });\r\n\r\n await Promise.all(promises);\r\n \r\n if (devWarningsRef.current) {\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Successfully synced ${backendOperations.length} adjustments to backend`);\r\n }\r\n } catch (error) {\r\n console.error('[useAdjustmentHistoryBatch] ❌ Failed to sync adjustments to backend:', error);\r\n }\r\n }\r\n }, [selectedIds, internalOptions, imageHistories]);\r\n\r\n // Shared function for applying adjustments (used by both reset and preset)\r\n const applyAdjustmentToSelected = useCallback(async (\r\n adjustment: AdjustmentState,\r\n operationType: 'reset' | 'preset',\r\n targetImageIds?: string[]\r\n ) => {\r\n const idsToProcess = targetImageIds || selectedIds;\r\n if (idsToProcess.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.warn(`[useAdjustmentHistoryBatch] ❌ ${operationType} called with no images to process`);\r\n }\r\n return;\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 ${operationType.toUpperCase()} called for images:`, idsToProcess);\r\n\r\n // Prepare backend operations BEFORE state update (outside setImageHistories)\r\n const backendOperations: Array<{\r\n imageId: string;\r\n taskId: string;\r\n adjustment: AdjustmentState;\r\n replaceFromTaskId?: string;\r\n }> = [];\r\n\r\n // Process each image to prepare operations\r\n const operationsToApply: Array<{\r\n imageId: string;\r\n newEntryId: string;\r\n newHistory: HistoryAdjustmentEntry[];\r\n }> = [];\r\n\r\n imageHistories.forEach(imageHistory => {\r\n if (!idsToProcess.includes(imageHistory.imageId)) {\r\n return; // Skip images not being processed\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Processing ${operationType} for image ${imageHistory.imageId}`);\r\n\r\n // Get current entry for replace_from logic\r\n const currentEntry = imageHistory.history.find(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n const currentEntryIndex = imageHistory.history.findIndex(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n const isInMiddleOfHistory = currentEntryIndex < imageHistory.history.length - 1;\r\n \r\n let replaceFromTaskId: string | undefined;\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🎯 ${operationType.toUpperCase()} replace logic for image ${imageHistory.imageId}:`, {\r\n currentEntryIndex,\r\n historyLength: imageHistory.history.length,\r\n isInMiddleOfHistory,\r\n currentEntryId: currentEntry?.id\r\n });\r\n\r\n if (isInMiddleOfHistory && currentEntry?.id) {\r\n // Only use replace_from when truly in middle of history (not at latest)\r\n replaceFromTaskId = currentEntry.id;\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 ${operationType.toUpperCase()} will REPLACE current position. replaceFromTaskId=${replaceFromTaskId}`);\r\n } else {\r\n console.log(`[useAdjustmentHistoryBatch] ➕ ${operationType.toUpperCase()} will ADD new entry (at end of history)`);\r\n }\r\n\r\n // Create new entry with adjustment\r\n const newEntryId = generateEntryId();\r\n const newEntry: HistoryAdjustmentEntry = {\r\n id: newEntryId,\r\n adjustment\r\n };\r\n\r\n // Build new history\r\n let newHistory: HistoryAdjustmentEntry[];\r\n \r\n if (isInMiddleOfHistory) {\r\n // If in middle of history, truncate from current position and add new entry\r\n newHistory = [...imageHistory.history.slice(0, currentEntryIndex + 1), newEntry];\r\n } else {\r\n // If at end of history, just add new entry\r\n newHistory = [...imageHistory.history, newEntry];\r\n }\r\n \r\n // Trim if needed\r\n const maxSize = maxSizeRef.current;\r\n const trimmedHistory = typeof maxSize === 'number' && newHistory.length > maxSize\r\n ? newHistory.slice(-maxSize)\r\n : newHistory;\r\n\r\n // Store operation for state update\r\n operationsToApply.push({\r\n imageId: imageHistory.imageId,\r\n newEntryId,\r\n newHistory: trimmedHistory\r\n });\r\n\r\n // Prepare backend operation (OUTSIDE state setter)\r\n if (internalOptions.controller && internalOptions.firebaseUid) {\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Adding ${operationType.toUpperCase()} backend operation for image ${imageHistory.imageId} with taskId ${newEntryId}`, {\r\n replaceFromTaskId,\r\n willReplace: !!replaceFromTaskId\r\n });\r\n \r\n backendOperations.push({\r\n imageId: imageHistory.imageId,\r\n taskId: newEntryId,\r\n adjustment,\r\n replaceFromTaskId\r\n });\r\n }\r\n });\r\n\r\n // Now update state with prepared operations (no backend preparation inside)\r\n setImageHistories(prevHistories => {\r\n return prevHistories.map(imageHistory => {\r\n // Find operation for this image\r\n const operation = operationsToApply.find(op => op.imageId === imageHistory.imageId);\r\n if (!operation) {\r\n return imageHistory; // No change for images not being processed\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 📝 Applying state update for ${operationType} on image ${imageHistory.imageId}`);\r\n\r\n return {\r\n ...imageHistory,\r\n history: operation.newHistory,\r\n currentHistoryEntryId: operation.newEntryId // Update current pointer\r\n };\r\n });\r\n });\r\n\r\n // Perform backend operations asynchronously (already prepared)\r\n if (backendOperations.length > 0 && internalOptions.controller && internalOptions.firebaseUid) {\r\n try {\r\n console.log(`[useAdjustmentHistoryBatch] 📤 Syncing ${backendOperations.length} ${operationType} operations to backend (createEditorConfig for each image)`);\r\n \r\n const promises = backendOperations.map(async (operation) => {\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Calling createEditorConfig for ${operationType} on image ${operation.imageId} with taskId ${operation.taskId}`, {\r\n replaceFrom: operation.replaceFromTaskId,\r\n hasReplaceFrom: !!operation.replaceFromTaskId\r\n });\r\n \r\n await internalOptions.controller!.createEditorConfig(internalOptions.firebaseUid!, {\r\n gallery_id: operation.imageId,\r\n task_id: operation.taskId,\r\n color_adjustment: mapAdjustmentStateToColorAdjustment(operation.adjustment),\r\n replace_from: operation.replaceFromTaskId\r\n });\r\n });\r\n\r\n await Promise.all(promises);\r\n \r\n if (devWarningsRef.current) {\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Successfully synced ${backendOperations.length} ${operationType} operations to backend`);\r\n }\r\n } catch (error) {\r\n console.error(`[useAdjustmentHistoryBatch] ❌ Failed to sync ${operationType} to backend:`, error);\r\n }\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 📊 ${operationType.toUpperCase()} backend operations prepared: ${backendOperations.length}`);\r\n }, [selectedIds, internalOptions, imageHistories]);\r\n\r\n // Apply preset values directly to selected images - now uses shared logic\r\n const adjustSelectedWithPreset = useCallback(async (presetAdjustments: AdjustmentState) => {\r\n console.log('[useAdjustmentHistoryBatch] 🎨 adjustSelectedWithPreset called with:', {\r\n selectedIds,\r\n selectedCount: selectedIds.length,\r\n presetAdjustments,\r\n hasController: !!internalOptions.controller,\r\n hasFirebaseUid: !!internalOptions.firebaseUid,\r\n imageHistoriesCount: imageHistories.length,\r\n imageHistoriesIds: imageHistories.map(h => h.imageId)\r\n });\r\n\r\n console.log('[useAdjustmentHistoryBatch] 🔍 PRESET: Current imageHistories state at start:', \r\n imageHistories.map(h => ({\r\n imageId: h.imageId,\r\n currentHistoryEntryId: h.currentHistoryEntryId,\r\n historyLength: h.history.length,\r\n historyIds: h.history.map(entry => entry.id)\r\n }))\r\n );\r\n\r\n if (selectedIds.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] ❌ adjustSelectedWithPreset called with no selection');\r\n }\r\n return;\r\n }\r\n\r\n // Apply preset values with clamping\r\n const clampedPreset = { ...presetAdjustments };\r\n (Object.keys(clampedPreset) as (keyof AdjustmentState)[]).forEach(key => {\r\n const presetValue = clampedPreset[key] as number;\r\n clampedPreset[key] = Math.max(-100, Math.min(100, presetValue)) as any;\r\n });\r\n\r\n console.log('[useAdjustmentHistoryBatch] 🎨 Using SHARED logic for preset (same as reset)');\r\n \r\n // Use the same logic as reset, just with preset values instead of default values\r\n await applyAdjustmentToSelected(clampedPreset, 'preset');\r\n }, [selectedIds, internalOptions, imageHistories, applyAdjustmentToSelected]);\r\n\r\n // Set specific adjustment states for specified images (removed since not needed)\r\n\r\n // Undo last changes to selected images - entry-based history version with backend sync\r\n const undo = useCallback(async () => {\r\n if (selectedIds.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] Cannot undo - no images selected');\r\n }\r\n return;\r\n }\r\n\r\n console.log('[useAdjustmentHistoryBatch] 🔍 UNDO: Before undo, current imageHistories state:', \r\n imageHistories.map(h => ({\r\n imageId: h.imageId,\r\n currentHistoryEntryId: h.currentHistoryEntryId,\r\n historyLength: h.history.length,\r\n historyIds: h.history.map(entry => entry.id)\r\n }))\r\n );\r\n\r\n // Prepare backend operations BEFORE state update (outside setImageHistories)\r\n let anyChanges = false;\r\n const backendOperations: Array<{\r\n imageId: string;\r\n taskId: string;\r\n }> = [];\r\n\r\n // Process each image to prepare operations\r\n const operationsToApply: Array<{\r\n imageId: string;\r\n newCurrentHistoryEntryId: string;\r\n }> = [];\r\n\r\n imageHistories.forEach(imageHistory => {\r\n if (!selectedIds.includes(imageHistory.imageId)) {\r\n return; // Skip images not selected\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🔍 UNDO: Processing image ${imageHistory.imageId} with history:`, {\r\n currentHistoryEntryId: imageHistory.currentHistoryEntryId,\r\n historyLength: imageHistory.history.length,\r\n historyIds: imageHistory.history.map(entry => entry.id)\r\n });\r\n\r\n // Find current entry index\r\n const currentEntryIndex = imageHistory.history.findIndex(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n \r\n if (currentEntryIndex <= 0) {\r\n console.log(`[useAdjustmentHistoryBatch] 🔍 UNDO: Cannot undo image ${imageHistory.imageId} - at first entry or not found`);\r\n return; // Cannot undo if at first entry or entry not found\r\n }\r\n\r\n // Move to previous entry\r\n const previousEntry = imageHistory.history[currentEntryIndex - 1];\r\n anyChanges = true;\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🔍 UNDO: Moving image ${imageHistory.imageId} from index ${currentEntryIndex} to ${currentEntryIndex - 1}`, {\r\n fromId: imageHistory.currentHistoryEntryId,\r\n toId: previousEntry.id,\r\n preservedHistoryLength: imageHistory.history.length\r\n });\r\n\r\n // Store operation for state update\r\n operationsToApply.push({\r\n imageId: imageHistory.imageId,\r\n newCurrentHistoryEntryId: previousEntry.id\r\n });\r\n\r\n // Prepare backend sync operation (OUTSIDE state setter)\r\n if (previousEntry.id && internalOptions.controller && internalOptions.firebaseUid) {\r\n backendOperations.push({\r\n imageId: imageHistory.imageId,\r\n taskId: previousEntry.id\r\n });\r\n }\r\n });\r\n\r\n // Now update state with prepared operations (no backend preparation inside)\r\n setImageHistories(prevHistories => {\r\n const result = prevHistories.map(imageHistory => {\r\n // Find operation for this image\r\n const operation = operationsToApply.find(op => op.imageId === imageHistory.imageId);\r\n if (!operation) {\r\n return imageHistory; // No change for images not selected\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 📝 Applying state update for undo on image ${imageHistory.imageId}`);\r\n\r\n const updatedHistory = {\r\n ...imageHistory,\r\n currentHistoryEntryId: operation.newCurrentHistoryEntryId\r\n };\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 🔍 UNDO: Updated image ${imageHistory.imageId} history:`, {\r\n currentHistoryEntryId: updatedHistory.currentHistoryEntryId,\r\n historyLength: updatedHistory.history.length,\r\n historyIds: updatedHistory.history.map(entry => entry.id)\r\n });\r\n\r\n return updatedHistory;\r\n });\r\n\r\n console.log('[useAdjustmentHistoryBatch] 🔍 UNDO: After undo, final imageHistories state:', \r\n result.map(h => ({\r\n imageId: h.imageId,\r\n currentHistoryEntryId: h.currentHistoryEntryId,\r\n historyLength: h.history.length,\r\n historyIds: h.history.map(entry => entry.id)\r\n }))\r\n );\r\n\r\n return result;\r\n });\r\n\r\n // Sync with backend (already prepared)\r\n if (backendOperations.length > 0 && internalOptions.controller && internalOptions.firebaseUid) {\r\n try {\r\n console.log(`[useAdjustmentHistoryBatch] ⏪ Syncing ${backendOperations.length} undo operations to backend (setHistoryIndex for each image)`);\r\n \r\n const promises = backendOperations.map(async (operation) => {\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Calling setHistoryIndex for undo on image ${operation.imageId} to taskId ${operation.taskId}`);\r\n await internalOptions.controller!.setHistoryIndex(\r\n internalOptions.firebaseUid!,\r\n operation.imageId,\r\n operation.taskId\r\n );\r\n });\r\n\r\n await Promise.all(promises);\r\n \r\n if (devWarningsRef.current) {\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Successfully synced ${backendOperations.length} undo operations to backend`);\r\n }\r\n } catch (error) {\r\n console.error('[useAdjustmentHistoryBatch] ❌ Failed to sync undo to backend:', error);\r\n }\r\n }\r\n\r\n if (!anyChanges && devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] Undo skipped - no changes to undo for selected images');\r\n }\r\n }, [selectedIds, internalOptions, imageHistories]);\r\n\r\n // Redo next changes to selected images - entry-based history version with backend sync\r\n const redo = useCallback(async () => {\r\n if (selectedIds.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] Cannot redo - no images selected');\r\n }\r\n return;\r\n }\r\n\r\n // Step 1: Prepare redo operations from current state\r\n let anyChanges = false;\r\n const operationsToApply: Array<{\r\n imageId: string;\r\n nextEntryId: string;\r\n }> = [];\r\n const backendOperations: Array<{\r\n imageId: string;\r\n taskId: string;\r\n }> = [];\r\n\r\n imageHistories.forEach(imageHistory => {\r\n if (!selectedIds.includes(imageHistory.imageId)) {\r\n return; // Skip unselected images\r\n }\r\n\r\n // Find current entry index\r\n const currentEntryIndex = imageHistory.history.findIndex(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n \r\n if (currentEntryIndex >= imageHistory.history.length - 1 || currentEntryIndex === -1) {\r\n return; // Cannot redo if at last entry or entry not found\r\n }\r\n\r\n // Move to next entry\r\n const nextEntry = imageHistory.history[currentEntryIndex + 1];\r\n anyChanges = true;\r\n\r\n operationsToApply.push({\r\n imageId: imageHistory.imageId,\r\n nextEntryId: nextEntry.id\r\n });\r\n\r\n // Prepare backend sync operation\r\n if (nextEntry.id && internalOptions.controller && internalOptions.firebaseUid) {\r\n backendOperations.push({\r\n imageId: imageHistory.imageId,\r\n taskId: nextEntry.id\r\n });\r\n }\r\n });\r\n\r\n // Step 2: Apply state updates cleanly\r\n if (operationsToApply.length > 0) {\r\n setImageHistories(prevHistories => {\r\n return prevHistories.map(imageHistory => {\r\n const operation = operationsToApply.find(op => op.imageId === imageHistory.imageId);\r\n if (!operation) {\r\n return imageHistory; // No change for this image\r\n }\r\n\r\n return {\r\n ...imageHistory,\r\n currentHistoryEntryId: operation.nextEntryId\r\n };\r\n });\r\n });\r\n }\r\n\r\n // Step 3: Sync with backend\r\n if (backendOperations.length > 0 && internalOptions.controller && internalOptions.firebaseUid) {\r\n try {\r\n console.log(`[useAdjustmentHistoryBatch] ⏩ Syncing ${backendOperations.length} redo operations to backend (setHistoryIndex for each image)`);\r\n \r\n const promises = backendOperations.map(async (operation) => {\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Calling setHistoryIndex for redo on image ${operation.imageId} to taskId ${operation.taskId}`);\r\n await internalOptions.controller!.setHistoryIndex(\r\n internalOptions.firebaseUid!,\r\n operation.imageId,\r\n operation.taskId\r\n );\r\n });\r\n\r\n await Promise.all(promises);\r\n \r\n if (devWarningsRef.current) {\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Successfully synced ${backendOperations.length} redo operations to backend`);\r\n }\r\n } catch (error) {\r\n console.error('[useAdjustmentHistoryBatch] ❌ Failed to sync redo to backend:', error);\r\n }\r\n }\r\n\r\n if (!anyChanges && devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] Redo skipped - no changes to redo for selected images');\r\n }\r\n }, [selectedIds, internalOptions, imageHistories]);\r\n\r\n // Check if any selected image can be undone\r\n const canUndoSelected = useCallback(() => {\r\n return selectedIds.some(imageId => {\r\n const imageHistory = imageHistories.find(h => h.imageId === imageId);\r\n if (!imageHistory) return false;\r\n \r\n const currentEntryIndex = imageHistory.history.findIndex(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n return currentEntryIndex > 0;\r\n });\r\n }, [selectedIds, imageHistories]);\r\n\r\n // Check if any selected image can be redone\r\n const canRedoSelected = useCallback(() => {\r\n return selectedIds.some(imageId => {\r\n const imageHistory = imageHistories.find(h => h.imageId === imageId);\r\n if (!imageHistory) return false;\r\n \r\n const currentEntryIndex = imageHistory.history.findIndex(entry => entry.id === imageHistory.currentHistoryEntryId);\r\n return currentEntryIndex >= 0 && currentEntryIndex < imageHistory.history.length - 1;\r\n });\r\n }, [selectedIds, imageHistories]);\r\n\r\n // Reset selected images to default state - now uses shared logic\r\n const reset = useCallback(async (imageIds?: string[]) => {\r\n const idsToReset = imageIds || selectedIds;\r\n \r\n console.log('[useAdjustmentHistoryBatch] 🔄 reset called for images:', idsToReset);\r\n \r\n // Create default state\r\n const defaultState = createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n \r\n console.log('[useAdjustmentHistoryBatch] 🔄 Using SHARED logic for reset (same as preset)');\r\n \r\n // Use the same logic as preset, just with default values instead of preset values\r\n await applyAdjustmentToSelected(defaultState, 'reset', idsToReset);\r\n }, [selectedIds, internalOptions.defaultAdjustmentState, applyAdjustmentToSelected]);\r\n\r\n // Selection management with initial adjustments - single state update\r\n const setSelection = useCallback((configs: ImageAdjustmentConfig[]) => {\r\n const imageIds = configs.map(config => config.imageId);\r\n \r\n // Update selectedIds state\r\n setSelectedIds(imageIds);\r\n \r\n // Build new batch state with initial adjustments\r\n const newBatch: BatchAdjustmentState = {\r\n currentSelection: {},\r\n allImages: { ...currentBatch.allImages },\r\n initialStates: { ...currentBatch.initialStates }\r\n };\r\n \r\n // Process each image config\r\n for (const config of configs) {\r\n const { imageId, adjustment } = config;\r\n \r\n // If image exists in allImages, use its state\r\n if (currentBatch.allImages[imageId]) {\r\n newBatch.currentSelection[imageId] = { ...currentBatch.allImages[imageId] };\r\n } else {\r\n // New image - determine initial state\r\n let initialState: AdjustmentState;\r\n \r\n if (adjustment) {\r\n // Use provided adjustment as initial state\r\n initialState = {\r\n ...createDefaultAdjustmentState(internalOptions.defaultAdjustmentState),\r\n ...adjustment\r\n };\r\n } else {\r\n // Use default state\r\n initialState = createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n }\r\n \r\n // Set initial state for new image\r\n newBatch.currentSelection[imageId] = { ...initialState };\r\n newBatch.allImages[imageId] = { ...initialState };\r\n newBatch.initialStates[imageId] = { ...initialState };\r\n }\r\n }\r\n \r\n // Update allImageIds to include any new images\r\n const newAllImageIds = Array.from(new Set([...allImageIds, ...imageIds]));\r\n setAllImageIds(newAllImageIds);\r\n \r\n // Single state update to prevent multiple re-renders\r\n setCurrentBatch(newBatch);\r\n \r\n if (internalOptions.devWarnings) {\r\n console.log('useAdjustmentHistoryBatch: Selection updated with initial adjustments', {\r\n selected: imageIds,\r\n totalImages: newAllImageIds.length,\r\n newImages: imageIds.filter(id => !allImageIds.includes(id)),\r\n withInitialAdjustments: configs.filter(c => c.adjustment).length\r\n });\r\n }\r\n }, [allImageIds, currentBatch, internalOptions.defaultAdjustmentState, internalOptions.devWarnings]);\r\n\r\n // Sync adjustments for specific images - loads full history from backend\r\n const syncAdjustment = useCallback(async (configs: ImageAdjustmentConfig[]) => {\r\n if (configs.length === 0) return;\r\n \r\n // If controller is available, load full history from backend\r\n if (internalOptions.controller && internalOptions.firebaseUid) {\r\n try {\r\n const historyPromises = configs.map(async (config) => {\r\n try {\r\n const historyResponse = await internalOptions.controller!.getEditorHistory(\r\n internalOptions.firebaseUid!,\r\n config.imageId\r\n );\r\n \r\n return {\r\n imageId: config.imageId,\r\n backendHistory: historyResponse.history || [],\r\n fallbackAdjustment: config.adjustment\r\n };\r\n } catch (error) {\r\n console.warn(`[useAdjustmentHistoryBatch] Failed to load history for image ${config.imageId}:`, error);\r\n return {\r\n imageId: config.imageId,\r\n backendHistory: [],\r\n fallbackAdjustment: config.adjustment\r\n };\r\n }\r\n });\r\n\r\n const historyResults = await Promise.all(historyPromises);\r\n\r\n setImageHistories(prevHistories => {\r\n const updatedHistories = [...prevHistories];\r\n \r\n for (const result of historyResults) {\r\n const { imageId, backendHistory, fallbackAdjustment } = result;\r\n const existingIndex = updatedHistories.findIndex(h => h.imageId === imageId);\r\n \r\n if (backendHistory.length > 0) {\r\n // Convert backend history to local history entries\r\n const historyEntries = backendHistory.map((entry, index) => ({\r\n id: entry.task_id, // Use backend task_id as our entry id\r\n adjustment: mapColorAdjustmentToAdjustmentState ? \r\n mapColorAdjustmentToAdjustmentState(entry.editor_config.color_adjustment) :\r\n createDefaultAdjustmentState(internalOptions.defaultAdjustmentState)\r\n }));\r\n\r\n const newImageHistory = {\r\n imageId,\r\n currentHistoryEntryId: historyEntries[historyEntries.length - 1].id, // Point to latest entry\r\n history: historyEntries\r\n };\r\n\r\n if (existingIndex >= 0) {\r\n updatedHistories[existingIndex] = newImageHistory;\r\n } else {\r\n updatedHistories.push(newImageHistory);\r\n }\r\n } else {\r\n // No backend history, use fallback adjustment or default\r\n const adjustment = fallbackAdjustment ? {\r\n ...createDefaultAdjustmentState(internalOptions.defaultAdjustmentState),\r\n ...fallbackAdjustment\r\n } : createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n \r\n const entryId = generateEntryId();\r\n const entry: HistoryAdjustmentEntry = {\r\n id: entryId,\r\n adjustment\r\n };\r\n\r\n const newImageHistory = {\r\n imageId,\r\n currentHistoryEntryId: entryId,\r\n history: [entry]\r\n };\r\n\r\n if (existingIndex >= 0) {\r\n updatedHistories[existingIndex] = newImageHistory;\r\n } else {\r\n updatedHistories.push(newImageHistory);\r\n }\r\n }\r\n }\r\n \r\n return updatedHistories;\r\n });\r\n\r\n if (internalOptions.devWarnings) {\r\n const syncedImageIds = configs.map(c => c.imageId);\r\n const totalHistoryEntries = historyResults.reduce((sum, result) => sum + result.backendHistory.length, 0);\r\n console.log('[useAdjustmentHistoryBatch] Synced adjustments with backend history', {\r\n syncedImages: syncedImageIds,\r\n totalHistoryEntries,\r\n historyLoaded: true\r\n });\r\n }\r\n } catch (error) {\r\n console.error('[useAdjustmentHistoryBatch] Failed to sync with backend, falling back to local only:', error);\r\n // Fall back to local-only sync\r\n syncAdjustmentLocal(configs);\r\n }\r\n } else {\r\n // No controller available, use local-only sync\r\n syncAdjustmentLocal(configs);\r\n }\r\n \r\n // Update allImageIds to include any new images\r\n const newImageIds = configs.map(c => c.imageId);\r\n setAllImageIds(prev => {\r\n const combined = Array.from(new Set([...prev, ...newImageIds]));\r\n return combined;\r\n });\r\n }, [internalOptions]);\r\n\r\n // Local-only sync for fallback\r\n const syncAdjustmentLocal = useCallback((configs: ImageAdjustmentConfig[]) => {\r\n setImageHistories(prevHistories => {\r\n const updatedHistories = [...prevHistories];\r\n \r\n for (const config of configs) {\r\n const { imageId, adjustment } = config;\r\n \r\n const existingIndex = updatedHistories.findIndex(h => h.imageId === imageId);\r\n \r\n if (adjustment) {\r\n const fullAdjustment = {\r\n ...createDefaultAdjustmentState(internalOptions.defaultAdjustmentState),\r\n ...adjustment\r\n };\r\n \r\n const entryId = generateEntryId();\r\n const entry: HistoryAdjustmentEntry = {\r\n id: entryId,\r\n adjustment: fullAdjustment\r\n };\r\n \r\n if (existingIndex >= 0) {\r\n // Update existing image history, replace with new adjustment as initial state\r\n updatedHistories[existingIndex] = {\r\n imageId,\r\n currentHistoryEntryId: entryId,\r\n history: [entry] // Reset history with synced state\r\n };\r\n } else {\r\n // Add new image history\r\n updatedHistories.push({\r\n imageId,\r\n currentHistoryEntryId: entryId,\r\n history: [entry]\r\n });\r\n }\r\n } else if (existingIndex < 0) {\r\n // Add new image with default state\r\n const defaultState = createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n const entryId = generateEntryId();\r\n const entry: HistoryAdjustmentEntry = {\r\n id: entryId,\r\n adjustment: defaultState\r\n };\r\n \r\n updatedHistories.push({\r\n imageId,\r\n currentHistoryEntryId: entryId,\r\n history: [entry]\r\n });\r\n }\r\n }\r\n \r\n return updatedHistories;\r\n });\r\n }, [internalOptions]);\r\n\r\n const toggleSelection = useCallback((imageId: string) => {\r\n setSelectedIds(prev => {\r\n const isCurrentlySelected = prev.includes(imageId);\r\n const newSelectedIds = isCurrentlySelected \r\n ? prev.filter(id => id !== imageId)\r\n : [...prev, imageId];\r\n \r\n // Update currentSelection in batch state\r\n const newBatch: BatchAdjustmentState = {\r\n currentSelection: { ...currentBatch.currentSelection },\r\n allImages: { ...currentBatch.allImages },\r\n initialStates: { ...currentBatch.initialStates }\r\n };\r\n \r\n if (isCurrentlySelected) {\r\n // Remove from currentSelection\r\n delete newBatch.currentSelection[imageId];\r\n } else {\r\n // Add to currentSelection - use existing state from allImages or create default\r\n if (currentBatch.allImages[imageId]) {\r\n newBatch.currentSelection[imageId] = { ...currentBatch.allImages[imageId] };\r\n } else {\r\n // New image - create default state\r\n const defaultState = createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n newBatch.currentSelection[imageId] = { ...defaultState };\r\n newBatch.allImages[imageId] = { ...defaultState };\r\n newBatch.initialStates[imageId] = { ...defaultState };\r\n }\r\n }\r\n \r\n setCurrentBatch(newBatch);\r\n return newSelectedIds;\r\n });\r\n }, [currentBatch, internalOptions.defaultAdjustmentState]);\r\n\r\n const selectAll = useCallback(() => {\r\n setSelectedIds([...allImageIds]);\r\n \r\n // Update currentSelection to include all images\r\n const newBatch: BatchAdjustmentState = {\r\n currentSelection: {},\r\n allImages: { ...currentBatch.allImages },\r\n initialStates: { ...currentBatch.initialStates }\r\n };\r\n \r\n for (const imageId of allImageIds) {\r\n if (currentBatch.allImages[imageId]) {\r\n newBatch.currentSelection[imageId] = { ...currentBatch.allImages[imageId] };\r\n } else {\r\n // New image - create default state\r\n const defaultState = createDefaultAdjustmentState(internalOptions.defaultAdjustmentState);\r\n newBatch.currentSelection[imageId] = { ...defaultState };\r\n newBatch.allImages[imageId] = { ...defaultState };\r\n newBatch.initialStates[imageId] = { ...defaultState };\r\n }\r\n }\r\n \r\n setCurrentBatch(newBatch);\r\n }, [allImageIds, currentBatch, internalOptions.defaultAdjustmentState]);\r\n\r\n const clearSelection = useCallback(() => {\r\n setSelectedIds([]);\r\n // Clear currentSelection but keep allImages and initialStates\r\n const newBatch: BatchAdjustmentState = {\r\n currentSelection: {},\r\n allImages: { ...currentBatch.allImages },\r\n initialStates: { ...currentBatch.initialStates }\r\n };\r\n setCurrentBatch(newBatch);\r\n }, [currentBatch]);\r\n\r\n // Jump to specific index - not applicable in per-image history\r\n const jumpToIndex = useCallback((index: number) => {\r\n if (devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] jumpToIndex not supported in per-image history mode');\r\n }\r\n }, []);\r\n\r\n // Clear all history and start fresh\r\n const clearHistory = useCallback(() => {\r\n setImageHistories([]);\r\n setCurrentBatch(createEmptyBatchState());\r\n setAllImageIds([]);\r\n setSelectedIds([]);\r\n }, []);\r\n\r\n const getCurrentBatch = useCallback(() => {\r\n return { \r\n currentSelection: { ...currentBatch.currentSelection },\r\n allImages: { ...currentBatch.allImages },\r\n initialStates: { ...currentBatch.initialStates }\r\n };\r\n }, [currentBatch]);\r\n\r\n // Sync entire batch state - adapted for entry-based history\r\n const syncBatch = useCallback((newBatch: BatchAdjustmentState, targetIndex?: number) => {\r\n // Validate input\r\n if (!newBatch || typeof newBatch !== 'object' || !newBatch.currentSelection || !newBatch.allImages || !newBatch.initialStates) {\r\n console.warn('syncBatch: newBatch must be a valid BatchAdjustmentState object with currentSelection, allImages, and initialStates');\r\n return;\r\n }\r\n\r\n // Convert batch state to entry-based histories\r\n const newImageHistories: HistoryAdjustmentBatch[] = [];\r\n \r\n Object.entries(newBatch.allImages).forEach(([imageId, adjustment]) => {\r\n const entryId = generateEntryId();\r\n const entry: HistoryAdjustmentEntry = {\r\n id: entryId,\r\n adjustment\r\n };\r\n \r\n newImageHistories.push({\r\n imageId,\r\n currentHistoryEntryId: entryId,\r\n history: [entry] // Start with current state as single history entry\r\n });\r\n });\r\n \r\n // Update state\r\n setImageHistories(newImageHistories);\r\n setCurrentBatch({ \r\n currentSelection: { ...newBatch.currentSelection },\r\n allImages: { ...newBatch.allImages },\r\n initialStates: { ...newBatch.initialStates }\r\n });\r\n \r\n // Update tracking\r\n const allImageIds = Object.keys(newBatch.allImages);\r\n const selectedImageIds = Object.keys(newBatch.currentSelection);\r\n setAllImageIds(allImageIds);\r\n setSelectedIds(selectedImageIds);\r\n \r\n if (devWarningsRef.current) {\r\n console.log('[useAdjustmentHistoryBatch] Synchronized batch state to entry-based history', {\r\n totalImages: allImageIds.length,\r\n selectedImages: selectedImageIds.length\r\n });\r\n }\r\n }, []);\r\n\r\n // Sync gallery updates - check for updated galleries and refresh their history\r\n const syncGalleryUpdates = useCallback(async () => {\r\n if (!internalOptions.controller || !internalOptions.firebaseUid || !internalOptions.eventId) {\r\n if (devWarningsRef.current) {\r\n console.warn('[useAdjustmentHistoryBatch] syncGalleryUpdates: Missing required options (controller, firebaseUid, or eventId)');\r\n }\r\n return;\r\n }\r\n\r\n try {\r\n // Step 1: Check for gallery updates since last timestamp\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Checking for gallery updates since timestamp: ${lastUpdateTimestamp}`);\r\n \r\n const updateResponse = await internalOptions.controller.getGalleryUpdateTimestamp(\r\n internalOptions.firebaseUid,\r\n internalOptions.eventId,\r\n lastUpdateTimestamp\r\n );\r\n\r\n if (!updateResponse.gallery || updateResponse.gallery.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.log('[useAdjustmentHistoryBatch] ✅ No gallery updates found');\r\n }\r\n return;\r\n }\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 📥 Found ${updateResponse.gallery.length} updated galleries:`, updateResponse.gallery);\r\n\r\n // Step 2: Fetch history for each updated gallery\r\n const historyPromises = updateResponse.gallery.map(async (galleryId) => {\r\n try {\r\n console.log(`[useAdjustmentHistoryBatch] 🔄 Fetching history for gallery: ${galleryId}`);\r\n const historyResponse = await internalOptions.controller!.getEditorHistory(\r\n internalOptions.firebaseUid!,\r\n galleryId\r\n );\r\n \r\n return {\r\n imageId: galleryId,\r\n currentTaskId: historyResponse.current_task_id,\r\n backendHistory: historyResponse.history || [],\r\n success: true\r\n };\r\n } catch (error) {\r\n console.error(`[useAdjustmentHistoryBatch] ❌ Failed to fetch history for gallery ${galleryId}:`, error);\r\n return {\r\n imageId: galleryId,\r\n currentTaskId: '',\r\n backendHistory: [],\r\n success: false\r\n };\r\n }\r\n });\r\n\r\n const historyResults = await Promise.all(historyPromises);\r\n const successfulUpdates = historyResults.filter(result => result.success && result.backendHistory.length > 0);\r\n\r\n if (successfulUpdates.length === 0) {\r\n if (devWarningsRef.current) {\r\n console.log('[useAdjustmentHistoryBatch] ℹ️ No valid history updates to apply');\r\n }\r\n // Update timestamp even if no valid updates\r\n setLastUpdateTimestamp(Date.now());\r\n return;\r\n }\r\n\r\n // Step 3: Prepare history updates from backend data\r\n const historyUpdates: Array<{\r\n imageId: string;\r\n newHistory: HistoryAdjustmentEntry[];\r\n newCurrentEntryId: string;\r\n }> = [];\r\n\r\n successfulUpdates.forEach(result => {\r\n const { imageId, currentTaskId, backendHistory } = result;\r\n \r\n if (backendHistory.length > 0) {\r\n // Convert backend history to local history entries\r\n const historyEntries = backendHistory.map((entry) => ({\r\n id: entry.task_id, // Use backend task_id as our entry id\r\n adjustment: mapColorAdjustmentToAdjustmentState ? \r\n mapColorAdjustmentToAdjustmentState(entry.editor_config.color_adjustment) :\r\n createDefaultAdjustmentState(internalOptions.defaultAdjustmentState)\r\n }));\r\n\r\n historyUpdates.push({\r\n imageId,\r\n newHistory: historyEntries,\r\n newCurrentEntryId: currentTaskId // Use current_task_id as current history entry\r\n });\r\n\r\n console.log(`[useAdjustmentHistoryBatch] 📝 Prepared history update for gallery ${imageId}:`, {\r\n historyEntries: historyEntries.length,\r\n currentEntryId: currentTaskId\r\n });\r\n }\r\n });\r\n\r\n // Step 4: Apply history updates cleanly to state\r\n if (historyUpdates.length > 0) {\r\n setImageHistories(prevHistories => {\r\n return prevHistories.map(imageHistory => {\r\n const update = historyUpdates.find(u => u.imageId === imageHistory.imageId);\r\n if (!update) {\r\n return imageHistory; // No update for this image\r\n }\r\n\r\n // Replace entire history with updated backend data\r\n return {\r\n ...imageHistory,\r\n history: update.newHistory,\r\n currentHistoryEntryId: update.newCurrentEntryId\r\n };\r\n });\r\n });\r\n\r\n console.log(`[useAdjustmentHistoryBatch] ✅ Successfully updated history for ${historyUpdates.length} galleries`);\r\n }\r\n\r\n // Step 5: Update timestamp to mark successful sync\r\n setLastUpdateTimestamp(Date.now());\r\n\r\n if (devWarningsRef.current) {\r\n console.log('[useAdjustmentHistoryBatch] 🔄 Gallery sync completed', {\r\n totalChecked: updateResponse.gallery.length,\r\n successfulUpdates: successfulUpdates.length,\r\n appliedUpdates: historyUpdates.length,\r\n newTimestamp: Date.now()\r\n });\r\n }\r\n\r\n } catch (error) {\r\n console.error('[useAdjustmentHistoryBatch] ❌ Failed to sync gallery updates:', error);\r\n // Don't update timestamp on error, so we can retry\r\n }\r\n }, [internalOptions, lastUpdateTimestamp, mapColorAdjustmentToAdjustmentState]);\r\n\r\n // Configuration actions\r\n const setMaxSize = useCallback((size: number | 'unlimited') => {\r\n maxSizeRef.current = size;\r\n if (size !== 'unlimited') {\r\n enforceMaxSize();\r\n }\r\n }, [enforceMaxSize]);\r\n\r\n // History info object - updated for per-image history\r\n const historyInfo: BatchHistoryInfo = useMemo(() => ({\r\n canUndo: canUndoSelected(),\r\n canRedo: canRedoSelected(),\r\n currentIndex: 0, // Not applicable in per-image history\r\n totalStates: imageHistories.reduce((sum, h) => sum + h.history.length, 0),\r\n selectedCount: selectedIds.length,\r\n totalImages: allImageIds.length,\r\n historySize: getMemoryUsage()\r\n }), [canUndoSelected, canRedoSelected, imageHistories, selectedIds.length, allImageIds.length, getMemoryUsage]);\r\n\r\n // Actions object - stabilized with useMemo\r\n const actions: BatchHistoryActions = useMemo(() => ({\r\n adjustSelected,\r\n adjustSelectedWithPreset,\r\n undo,\r\n redo,\r\n reset,\r\n setSelection,\r\n syncAdjustment,\r\n syncGalleryUpdates,\r\n toggleSelection,\r\n selectAll,\r\n clearSelection,\r\n jumpToIndex,\r\n clearHistory,\r\n getCurrentBatch,\r\n syncBatch\r\n }), [\r\n adjustSelected, adjustSelectedWithPreset, undo, redo, reset,\r\n setSelection, syncAdjustment, syncGalleryUpdates, toggleSelection, selectAll, clearSelection,\r\n jumpToIndex, clearHistory, getCurrentBatch, syncBatch\r\n ]);\r\n\r\n // Config object - stabilized with useMemo\r\n const config: BatchHistoryConfig = useMemo(() => ({\r\n setMaxSize,\r\n getMemoryUsage\r\n }), [setMaxSize, getMemoryUsage]);\r\n\r\n // Apply max size enforcement when history changes\r\n useEffect(() => {\r\n enforceMaxSize();\r\n }, [enforceMaxSize]);\r\n\r\n return {\r\n currentBatch,\r\n selectedIds,\r\n allImageIds,\r\n historyInfo,\r\n actions,\r\n config\r\n };\r\n}\r\n","import { ColorAdjustment } from \"../hooks/editor/type\";\r\nimport { AdjustmentState } from \"../hooks/editor/type\";\r\nimport { AdjustmentValues } from \"../lib/editor/honcho-editor\";\r\n\r\nexport function mapAdjustmentStateToAdjustmentEditor(state: AdjustmentState): AdjustmentValues {\r\n return {\r\n temperature: state.tempScore,\r\n tint: state.tintScore,\r\n saturation: state.saturationScore,\r\n vibrance: state.vibranceScore,\r\n exposure: state.exposureScore,\r\n contrast: state.contrastScore,\r\n highlights: state.highlightsScore,\r\n shadows: state.shadowsScore,\r\n whites: state.whitesScore,\r\n blacks: state.blacksScore,\r\n clarity: state.clarityScore,\r\n sharpness: state.sharpnessScore,\r\n }\r\n}\r\n\r\nexport function mapColorAdjustmentToAdjustmentState(colors: ColorAdjustment): AdjustmentState {\r\n return {\r\n tempScore: colors.temperature,\r\n tintScore: colors.tint,\r\n vibranceScore: colors.vibrance,\r\n saturationScore: colors.saturation,\r\n exposureScore: colors.exposure,\r\n highlightsScore: colors.highlights,\r\n shadowsScore: colors.shadows,\r\n whitesScore: colors.whites,\r\n blacksScore: colors.blacks,\r\n contrastScore: colors.contrast,\r\n clarityScore: colors.clarity,\r\n sharpnessScore: colors.sharpness\r\n }\r\n}\r\n\r\nexport function mapAdjustmentStateToColorAdjustment(state: AdjustmentState): ColorAdjustment {\r\n return {\r\n temperature: state.tempScore,\r\n tint: state.tintScore,\r\n vibrance: state.vibranceScore,\r\n saturation: state.saturationScore,\r\n exposure: state.exposureScore,\r\n contrast: state.contrastScore,\r\n highlights: state.highlightsScore,\r\n shadows: state.shadowsScore,\r\n whites: state.whitesScore,\r\n blacks: state.blacksScore,\r\n clarity: state.clarityScore,\r\n sharpness: state.sharpnessScore\r\n }\r\n}","import { useState, useCallback, useEffect, useRef, useMemo } from 'react';\r\nimport { Gallery } from './editor/type';\r\nimport { Controller } from \"./editor/type\";\r\n\r\n/**\r\n * Configuration options for the paging hook\r\n */\r\nexport interface PagingOptions {\r\n /** Enable development warnings for debugging */\r\n devWarnings?: boolean;\r\n /** Auto-load first page on hook initialization */\r\n autoLoad?: boolean;\r\n /** Reset pagination when dependencies change */\r\n autoReset?: boolean;\r\n}\r\n\r\n/**\r\n * Information about the current paging state\r\n */\r\nexport interface PagingInfo {\r\n /** Whether images are currently being loaded */\r\n isLoading: boolean;\r\n /** Whether more pages are being loaded */\r\n isLoadingMore: boolean;\r\n /** Error message if any operation failed */\r\n error: string | null;\r\n /** Current page number */\r\n currentPage: number;\r\n /** Whether there are more pages to load */\r\n hasMore: boolean;\r\n /** Total number of images loaded */\r\n totalImages: number;\r\n /** Whether the hook has been initialized */\r\n isInitialized: boolean;\r\n}\r\n\r\n/**\r\n * Actions available for paging management\r\n */\r\nexport interface PagingActions {\r\n /** Load more images (next page) - only one instance can run at a time */\r\n loadMore: () => Promise<void>;\r\n /** Refresh/reload from first page */\r\n refresh: () => Promise<void>;\r\n /** Reset pagination state */\r\n reset: () => void;\r\n}\r\n\r\n/**\r\n * Return type for the usePaging hook\r\n */\r\nexport interface UsePagingReturn {\r\n /** Current list of images */\r\n images: Gallery[];\r\n /** Information about paging state */\r\n info: PagingInfo;\r\n /** Available paging actions */\r\n actions: PagingActions;\r\n}\r\n\r\n/**\r\n * Hook for managing paginated image loading with ControllerBulk.\r\n * \r\n * **Key Features:**\r\n * - **Paginated Loading**: Handles page-by-page image loading\r\n * - **State Management**: Maintains image list and pagination state\r\n * - **Load More**: Seamlessly loads and appends next pages\r\n * - **Mutation**: Update specific images without full reload\r\n * - **Error Handling**: Provides error states for failed operations\r\n * - **Auto-loading**: Optional automatic first page loading\r\n * \r\n * **Typical Usage:**\r\n * ```typescript\r\n * const { images, info, actions } = usePaging(controller, firebaseUid, eventId, {\r\n * autoLoad: true,\r\n * autoReset: true\r\n * });\r\n * \r\n * // Load more images\r\n * await actions.loadMore();\r\n * \r\n * // Refresh from beginning\r\n * await actions.refresh();\r\n * \r\n * // Update specific image\r\n * actions.mutateImage(imageId, (img) => ({ ...img, isSelected: true }));\r\n * ```\r\n * \r\n * @param controller - Backend controller for API communication\r\n * @param firebaseUid - User identifier for backend operations\r\n * @param eventId - Event identifier for image list\r\n * @param options - Configuration options\r\n * @returns Object with images, info, and actions\r\n */\r\nexport function usePaging(\r\n controller: Controller | null,\r\n firebaseUid: string,\r\n eventId: string,\r\n options: PagingOptions = {}\r\n): UsePagingReturn {\r\n // Memoize options to prevent re-renders when object is recreated with same values\r\n const memoizedOptions = useMemo(() => ({\r\n devWarnings: options.devWarnings ?? false,\r\n autoLoad: options.autoLoad ?? false,\r\n autoReset: options.autoReset ?? true\r\n }), [options.devWarnings, options.autoLoad, options.autoReset]);\r\n\r\n // Core state\r\n const [images, setImages] = useState<Gallery[]>([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [isLoadingMore, setIsLoadingMore] = useState(false);\r\n const [error, setError] = useState<string | null>(null);\r\n const [currentPage, setCurrentPage] = useState(1);\r\n const [hasMore, setHasMore] = useState(true);\r\n const [isInitialized, setIsInitialized] = useState(false);\r\n\r\n // Track if loadMore is currently running to prevent spam\r\n const isLoadMoreRunningRef = useRef(false);\r\n\r\n // Track dependencies with stable refs\r\n const controllerRef = useRef(controller);\r\n const firebaseUidRef = useRef(firebaseUid);\r\n const eventIdRef = useRef(eventId);\r\n \r\n // Only update refs when values actually change\r\n if (controllerRef.current !== controller) {\r\n controllerRef.current = controller;\r\n }\r\n if (firebaseUidRef.current !== firebaseUid) {\r\n firebaseUidRef.current = firebaseUid;\r\n }\r\n if (eventIdRef.current !== eventId) {\r\n eventIdRef.current = eventId;\r\n }\r\n\r\n // Helper function to log debug messages\r\n const debugLog = useCallback((message: string, data?: unknown) => {\r\n if (memoizedOptions.devWarnings) {\r\n console.log(`[usePaging] ${message}`, data || '');\r\n }\r\n }, [memoizedOptions.devWarnings]);\r\n\r\n // Helper function to handle errors\r\n const handleError = useCallback((operation: string, error: unknown) => {\r\n const errorMessage = `Failed to ${operation}: ${error instanceof Error ? error.message : String(error)}`;\r\n setError(errorMessage);\r\n debugLog(`Error in ${operation}`, error);\r\n }, [debugLog]);\r\n\r\n // Load images for a specific page\r\n const loadPage = useCallback(async (pageNum: number, isLoadMore = false) => {\r\n if (!controllerRef.current || !firebaseUidRef.current || !eventIdRef.current) {\r\n debugLog('Load skipped: missing controller, firebaseUid, or eventId');\r\n return;\r\n }\r\n\r\n // Set appropriate loading state\r\n if (isLoadMore) {\r\n setIsLoadingMore(true);\r\n } else {\r\n setIsLoading(true);\r\n }\r\n setError(null);\r\n\r\n try {\r\n debugLog(`Loading page ${pageNum}...`, { isLoadMore });\r\n \r\n const response = await controllerRef.current.getImageList(\r\n firebaseUidRef.current,\r\n eventIdRef.current,\r\n pageNum\r\n );\r\n\r\n debugLog('Page loaded successfully', { \r\n page: response.current_page,\r\n imageCount: response.gallery.length,\r\n hasNext: response.next_page > 0\r\n });\r\n\r\n // Update images list\r\n setImages(prev => {\r\n if (isLoadMore) {\r\n // Append new images for load more\r\n return [...prev, ...response.gallery];\r\n } else {\r\n // Replace all images for initial load or refresh\r\n return response.gallery;\r\n }\r\n });\r\n\r\n // Update pagination state\r\n setCurrentPage(response.current_page);\r\n setHasMore(response.next_page > 0 && response.gallery.length > 0);\r\n \r\n if (!isInitialized) {\r\n setIsInitialized(true);\r\n }\r\n\r\n } catch (err) {\r\n handleError(`load page ${pageNum}`, err);\r\n \r\n // On error, don't change images if it's load more\r\n if (!isLoadMore) {\r\n setImages([]);\r\n }\r\n } finally {\r\n if (isLoadMore) {\r\n setIsLoadingMore(false);\r\n } else {\r\n setIsLoading(false);\r\n }\r\n }\r\n }, [debugLog, handleError, isInitialized]);\r\n\r\n // Load more images (next page) - spam-protected\r\n const loadMore = useCallback(async () => {\r\n // Prevent multiple concurrent loadMore calls\r\n if (isLoadMoreRunningRef.current || isLoadingMore || !hasMore) {\r\n debugLog('Load more skipped', { \r\n isLoadMoreRunning: isLoadMoreRunningRef.current,\r\n isLoadingMore, \r\n hasMore \r\n });\r\n return;\r\n }\r\n\r\n // Mark as running to prevent spam\r\n isLoadMoreRunningRef.current = true;\r\n \r\n try {\r\n debugLog('Loading more images...', { nextPage: currentPage + 1 });\r\n await loadPage(currentPage + 1, true);\r\n } finally {\r\n // Always reset the running flag\r\n isLoadMoreRunningRef.current = false;\r\n }\r\n }, [isLoadingMore, hasMore, currentPage, loadPage, debugLog]);\r\n\r\n // Refresh from first page\r\n const refresh = useCallback(async () => {\r\n debugLog('Refreshing from first page...');\r\n setCurrentPage(1);\r\n setHasMore(true);\r\n await loadPage(1, false);\r\n }, [loadPage, debugLog]);\r\n\r\n // Reset pagination state\r\n const reset = useCallback(() => {\r\n debugLog('Resetting pagination state');\r\n setImages([]);\r\n setCurrentPage(1);\r\n setHasMore(true);\r\n setError(null);\r\n setIsInitialized(false);\r\n // Reset loadMore running flag when page changes\r\n isLoadMoreRunningRef.current = false;\r\n }, [debugLog]);\r\n\r\n // Auto-load first page on initialization\r\n useEffect(() => {\r\n if (memoizedOptions.autoLoad && controller && firebaseUid && eventId && !isInitialized) {\r\n debugLog('Auto-loading first page...');\r\n loadPage(1, false);\r\n }\r\n }, [memoizedOptions.autoLoad, controller, firebaseUid, eventId, isInitialized, loadPage, debugLog]);\r\n\r\n // Reset when dependencies change (if autoReset is enabled)\r\n useEffect(() => {\r\n if (memoizedOptions.autoReset && isInitialized) {\r\n debugLog('Dependencies changed, resetting state');\r\n reset();\r\n }\r\n }, [controller, firebaseUid, eventId, memoizedOptions.autoReset, isInitialized, reset, debugLog]);\r\n\r\n // Paging info object - memoized to prevent re-renders\r\n const info: PagingInfo = useMemo(() => ({\r\n isLoading,\r\n isLoadingMore,\r\n error,\r\n currentPage,\r\n hasMore,\r\n totalImages: images.length,\r\n isInitialized\r\n }), [isLoading, isLoadingMore, error, currentPage, hasMore, images.length, isInitialized]);\r\n\r\n // Actions object - memoized to prevent re-renders\r\n const actions: PagingActions = useMemo(() => ({\r\n loadMore,\r\n refresh,\r\n reset\r\n }), [loadMore, refresh, reset]);\r\n\r\n // Return object - memoized to prevent re-renders\r\n return useMemo(() => ({\r\n images,\r\n info,\r\n actions\r\n }), [images, info, actions]);\r\n}\r\n","import React from \"react\";\r\nimport { Stack, IconButton, CardMedia, MenuItem, ListItemText , ListItemIcon, Menu, Button, Typography } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport useIsMobile from \"../../utils/isMobile\";\r\n\r\ninterface Props {\r\n anchorEl?: null | HTMLElement;\r\n valueSelect?: string;\r\n isPasteEnabled?: boolean;\r\n canUndo: boolean;\r\n canRedo: boolean;\r\n onBack?: () => void;\r\n onUndo?: () => void;\r\n onRedo?: () => void;\r\n onRevert?: () => void;\r\n onCopyEdit?: () => void;\r\n onPasteEdit?: () => void;\r\n onMenuClick?: (event: React.MouseEvent<HTMLElement>) => void;\r\n onMenuClose?: () => void;\r\n onSelectButton?: () => void;\r\n}\r\n\r\nexport default function HHeaderEditor(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n const open = Boolean(props.anchorEl);\r\n const isMobile = useIsMobile();\r\n\r\n return (\r\n <>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" width=\"100%\" \r\n sx={{ \r\n id: 'HHeaderEditor',\r\n pr: !isMobile ? \"24px\" : \"6px\", \r\n position: isMobile ? 'fixed' : 'relative',\r\n top: isMobile ? 0 : 'auto',\r\n left: isMobile ? 0 : 'auto',\r\n right: isMobile ? 0 : 'auto',\r\n zIndex: 1300,\r\n backgroundColor: 'transparent',\r\n }}> \r\n <Stack direction=\"row\" justifyContent=\"flex-start\" sx={{ pl: !isMobile ? \"0px\" : \"14px\" }}>\r\n <IconButton aria-label=\"back\" onClick={props.onBack} \r\n sx={{ \r\n '&:active': {\r\n transform: 'scale(0.92)',\r\n },\r\n transition: 'transform 0.1s ease-in-out',\r\n }}>\r\n <CardMedia title=\"back\" src=\"svg/Back.svg\" component=\"img\" />\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"flex-end\" alignItems=\"center\" sx={{ pt: \"20px\", pb: \"12px\"}} spacing={0.1}>\r\n <IconButton aria-label=\"undo\" onClick={props.onUndo} sx={{ color: colors.outlineVariant, opacity: props.canUndo ? 1 : 0.5 }} disabled={!props.canUndo}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/undo-editor.svg\" />\r\n </IconButton>\r\n <IconButton aria-label=\"redo\" onClick={props.onRedo} sx={{ color: colors.outlineVariant, opacity: props.canRedo ? 1 : 0.5 }} disabled={!props.canRedo}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/redo-editor.svg\" />\r\n </IconButton>\r\n <IconButton \r\n aria-label=\"option\" \r\n onClick={props.onMenuClick}\r\n aria-controls={open ? 'options-menu' : undefined}\r\n aria-haspopup=\"true\"\r\n aria-expanded={open ? 'true' : undefined}\r\n >\r\n <CardMedia component=\"img\" image=\"/v1/svg/dots-editor.svg\" />\r\n </IconButton>\r\n <Menu\r\n id=\"options-menu\"\r\n anchorEl={props.anchorEl}\r\n open={open}\r\n onClose={props.onMenuClose}\r\n transformOrigin={{ horizontal: 'right', vertical: 'top' }}\r\n anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}\r\n slotProps={{\r\n paper: {\r\n sx: {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n border: `1px solid ${colors.outlineVariant}`,\r\n },\r\n },\r\n }}\r\n >\r\n <MenuItem onClick={props.onRevert}>\r\n <ListItemIcon sx={{ minWidth: 0, mr: \"0px\", px: \"0px\" }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/revert-editor.svg\" sx={{ width: \"20px\", height: \"20px\" }} />\r\n </ListItemIcon>\r\n <ListItemText>\r\n <Typography sx={{ fontSize: \"14px\", color: colors.surface }}>Revert to original</Typography>\r\n </ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={props.onCopyEdit}>\r\n {/* Should be align left and more closer with ListItemText*/}\r\n <ListItemIcon sx={{ minWidth: 0, mr: \"0px\", px: \"0px\" }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/copy-editor.svg\" sx={{ width: \"20px\", height: \"20px\" }} />\r\n </ListItemIcon>\r\n <ListItemText>\r\n <Typography sx={{ fontSize: \"14px\", color: colors.surface }}>Copy edits</Typography>\r\n </ListItemText>\r\n {/* Should be align right */}\r\n {!isMobile && \r\n <ListItemIcon sx={{ marginLeft: 'auto' }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/shortcut-copy-editor.svg\" sx={{ width: \"25px\", height: \"20px\" }} />\r\n </ListItemIcon>\r\n }\r\n </MenuItem>\r\n <MenuItem onClick={props.onPasteEdit} disabled={!props.isPasteEnabled}>\r\n <ListItemIcon sx={{ minWidth: 0, mr: \"0px\", px: \"0px\" }}>\r\n <CardMedia component=\"img\" image={!props.isPasteEnabled ? \"/v1/svg/paste-editor.svg\" : \"/v1/svg/paste-white.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />\r\n </ListItemIcon>\r\n <ListItemText>\r\n <Typography sx={{ fontSize: \"14px\", color: !props.isPasteEnabled ? colors.onSurfaceVariant1 : colors.surface }}>Paste edits</Typography>\r\n </ListItemText>\r\n { !isMobile && \r\n <ListItemIcon sx={{ marginLeft: '30px' }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/shortcut-paste-editor.svg\" sx={{ width: \"25px\", height: \"20px\" }} />\r\n </ListItemIcon>\r\n }\r\n \r\n </MenuItem>\r\n </Menu>\r\n </Stack>\r\n </Stack>\r\n </>\r\n );\r\n}\r\n","interface HonchoTypography {\r\n displayLarge: FontStyle;\r\n displayMedium: FontStyle;\r\n displaySmall: FontStyle;\r\n headlineLarge: FontStyle;\r\n headlineMedium: FontStyle;\r\n headlineSmall: FontStyle;\r\n titleLarge: FontStyle;\r\n titleMedium: FontStyle;\r\n titleSmall: FontStyle;\r\n bodyLarge: FontStyle;\r\n bodyMedium: FontStyle;\r\n bodySmall: FontStyle;\r\n labelLarge: FontStyle;\r\n labelMedium: FontStyle;\r\n labelSmall: FontStyle;\r\n}\r\n\r\ninterface FontStyle {\r\n fontSize: number;\r\n lineHeight: string;\r\n fontWeight: number;\r\n letterSpacing: string;\r\n}\r\n\r\n\r\nexport default function useHonchoTypography(): HonchoTypography{\r\n return {\r\n displayLarge: {\r\n fontSize: 57,\r\n lineHeight: \"64px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n displayMedium: {\r\n fontSize: 45,\r\n lineHeight: \"52px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n displaySmall: {\r\n fontSize: 36,\r\n lineHeight: \"44px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n headlineLarge: {\r\n fontSize: 32,\r\n lineHeight: \"40px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n headlineMedium: {\r\n fontSize: 28,\r\n lineHeight: \"36px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n headlineSmall: {\r\n fontSize: 24,\r\n lineHeight: \"32px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n titleLarge: {\r\n fontSize: 18,\r\n lineHeight: \"24px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0px\"\r\n },\r\n titleMedium: {\r\n fontSize: 16,\r\n lineHeight: \"24px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0.15px\"\r\n },\r\n titleSmall: {\r\n fontSize: 14,\r\n lineHeight: \"20px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0.1px\"\r\n },\r\n bodyLarge: {\r\n fontSize: 16,\r\n lineHeight: \"24px\",\r\n fontWeight: 400,\r\n letterSpacing: \"0.5px\"\r\n },\r\n bodyMedium: {\r\n fontSize: 14,\r\n lineHeight: \"20px\",\r\n fontWeight: 400,\r\n letterSpacing: \"0.25px\"\r\n },\r\n bodySmall: {\r\n fontSize: 12,\r\n lineHeight: \"16px\",\r\n fontWeight: 400,\r\n letterSpacing: \"0.4px\"\r\n },\r\n labelLarge: {\r\n fontSize: 16,\r\n lineHeight: \"24px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0.1px\"\r\n },\r\n labelMedium: {\r\n fontSize: 14,\r\n lineHeight: \"20px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0.1px\"\r\n },\r\n labelSmall: {\r\n fontSize: 12,\r\n lineHeight: \"16px\",\r\n fontWeight: 500,\r\n letterSpacing: \"0.1px\"\r\n },\r\n }\r\n}","\r\ninterface Colors {\r\n onSurface: string;\r\n surface: string;\r\n onSurfaceVariant: string;\r\n onSurfaceVariant1: string;\r\n outlineVariant: string;\r\n error: string;\r\n onBackground: string;\r\n background: string;\r\n}\r\n\r\nexport default function useColors(): Colors {\r\n return {\r\n onSurface: \"#1C1B1F\",\r\n surface: \"#FFFFFF\",\r\n onSurfaceVariant: \"#949494\",\r\n onSurfaceVariant1: \"#656369\",\r\n outlineVariant: \"#EDEDED\",\r\n error: \"#DC362E\",\r\n onBackground: \"#000000\",\r\n background: \"#FFFFFF\"\r\n }\r\n}","import {useMediaQuery, useTheme} from \"@mui/material\";\r\n\r\nexport default function useIsMobile() {\r\n const theme = useTheme();\r\n return useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n}","import { Button, Stack, IconButton, CardMedia, MenuItem, ListItemText , ListItemIcon, Typography, Menu } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport React, { useState } from \"react\";\r\n\r\ninterface Props {\r\n anchorElZoom: null | HTMLElement;\r\n onScale: (event: React.MouseEvent<HTMLElement>) => void;\r\n onZoomMenuClose: () => void;\r\n zoomLevelText: string;\r\n onZoomAction: (zoomLevel: string) => void;\r\n onShowOriginal?: () => void;\r\n onShowEdited?: () => void;\r\n}\r\n\r\nexport default function HFooter(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n const isZoomMenuOpen = Boolean(props.anchorElZoom);\r\n\r\n return (\r\n <>\r\n <Stack direction=\"row\" alignItems=\"center\" spacing={0.5}>\r\n <Button \r\n id=\"zoom-button\"\r\n onClick={props.onScale}\r\n aria-controls={isZoomMenuOpen ? 'zoom-options-menu' : undefined}\r\n aria-haspopup=\"true\"\r\n aria-expanded={isZoomMenuOpen ? 'true' : undefined}\r\n sx={{\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n '&.MuiButton-outlined': {\r\n color: colors.surface,\r\n },\r\n }}\r\n endIcon={<CardMedia component=\"img\" image={isZoomMenuOpen ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"} sx={{ width: \"11.67px\", height: \"5.83px\" }} />}\r\n >\r\n {props.zoomLevelText}\r\n </Button>\r\n <IconButton\r\n aria-label=\"before-after\"\r\n onMouseDown={props.onShowOriginal} // Mouse button down\r\n onMouseUp={props.onShowEdited} // Mouse button release\r\n onMouseLeave={props.onShowEdited} // In case mouse leaves while pressed\r\n onTouchStart={props.onShowOriginal} // Finger touch down\r\n onTouchEnd={props.onShowEdited} // Finger touch release\r\n sx={{ color: colors.outlineVariant }}\r\n >\r\n <CardMedia component=\"img\" title=\"before-after\" image=\"/v1/svg/before-after-editor.svg\" sx={{ width: \"20px\", height: \"20px\" }} />\r\n </IconButton>\r\n <Menu\r\n id=\"zoom-options-menu\"\r\n anchorEl={props.anchorElZoom}\r\n open={isZoomMenuOpen}\r\n onClose={props.onZoomMenuClose}\r\n anchorOrigin={{ vertical: 'top', horizontal: 'center' }}\r\n transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}\r\n slotProps={{\r\n paper: {\r\n sx: {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n border: `1px solid ${colors.outlineVariant}`,\r\n },\r\n },\r\n }}\r\n >\r\n <MenuItem onClick={() => props.onZoomAction('in')}>\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.surface }}>Zoom in</ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={() => props.onZoomAction('out')}>\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.surface }}>Zoom out</ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={() => props.onZoomAction('fit')}>\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.surface }}>Zoom to fit</ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={() => props.onZoomAction('50%')}>\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.surface }}>Zoom to 50%</ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={() => props.onZoomAction('100%')}>\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.surface }}>Zoom to 100%</ListItemText>\r\n </MenuItem>\r\n <MenuItem onClick={() => props.onZoomAction('200%')}>\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.surface }}>Zoom to 200%</ListItemText>\r\n </MenuItem>\r\n </Menu>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Accordion, AccordionDetails , AccordionSummary, CardMedia, Stack, Typography } from \"@mui/material\";\r\nimport HAccordionColor from \"./HAccordionColor\";\r\nimport HAccordionLight from \"./HAccordionLight\";\r\nimport HAccordionDetails from \"./HAccordionDetails\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n // Getters get values\r\n tempScore: number;\r\n tintScore: number;\r\n vibranceScore: number;\r\n saturationScore: number;\r\n exposureScore: number;\r\n HighlightsScore: number;\r\n shadowsScore: number;\r\n whitesScore: number;\r\n blacksScore: number;\r\n contrastScore: number;\r\n clarityScore: number;\r\n sharpnessScore: number;\r\n expandedPanels: string[];\r\n // Setters get values update\r\n setTempScore: (field: keyof AdjustmentState, value: number) => void;\r\n setTintScore: (field: keyof AdjustmentState, value: number) => void;\r\n setExposureScore: (field: keyof AdjustmentState, value: number) => void;\r\n setVibranceScore: (field: keyof AdjustmentState, value: number) => void;\r\n setSaturationScore:(field: keyof AdjustmentState, value: number) => void;\r\n setHighlightsScore: (field: keyof AdjustmentState, value: number) => void;\r\n setShadowsScore: (field: keyof AdjustmentState, value: number) => void;\r\n setWhitesScore: (field: keyof AdjustmentState, value: number) => void;\r\n setBlacksScore: (field: keyof AdjustmentState, value: number) => void;\r\n setContrastScore: (field: keyof AdjustmentState, value: number) => void;\r\n setClarityScore: (field: keyof AdjustmentState, value: number) => void;\r\n setSharpnessScore: (field: keyof AdjustmentState, value: number) => void;\r\n onPanelChange: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;\r\n isBatchMode: boolean;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HAccordionColorAdjustment(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const accordionStyle = {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n '& .MuiAccordionSummary-root': {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n },\r\n '& .MuiAccordionDetails-root': {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n },\r\n '& .MuiTypography-root': {\r\n color: colors.surface,\r\n },\r\n '& .MuiSvgIcon-root': {\r\n color: colors.surface,\r\n }\r\n };\r\n\r\n const isPanelExpanded = (panelName: string) => props.expandedPanels.includes(panelName);\r\n\r\n return (\r\n <>\r\n <Stack direction=\"column\" sx={{ accordionStyle }}>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('whiteBalance')}\r\n onChange={props.onPanelChange('whiteBalance')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium }}>Color</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('whiteBalance') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <HAccordionColor\r\n TempScore = {props.tempScore}\r\n TintScore = {props.tintScore}\r\n VibranceScore = {props.vibranceScore}\r\n SaturationScore={props.saturationScore}\r\n onTempChange={props.setTempScore}\r\n onTintChange={props.setTintScore}\r\n onVibranceChange={props.setVibranceScore}\r\n onSaturationChange={props.setSaturationScore}\r\n isBatchMode={props.isBatchMode}\r\n onDragStart={props.onDragStart}\r\n onDragEnd={props.onDragEnd}\r\n />\r\n </AccordionDetails>\r\n </Accordion>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('light')}\r\n onChange={props.onPanelChange('light')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium }}>Light</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('light') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <HAccordionLight\r\n ExposureScore = {props.exposureScore}\r\n ContrastScore = {props.contrastScore}\r\n HighlightsScore = {props.HighlightsScore}\r\n ShadowsScore = {props.shadowsScore}\r\n WhitesScore = {props.whitesScore}\r\n BlacksScore = {props.blacksScore}\r\n onExposureChange={props.setExposureScore}\r\n onContrastChange={props.setContrastScore}\r\n onHighlightsChange={props.setHighlightsScore}\r\n onShadowsChange={props.setShadowsScore}\r\n onWhitesChange={props.setWhitesScore}\r\n onBlacksChange={props.setBlacksScore}\r\n isBatchMode={props.isBatchMode}\r\n onDragStart={props.onDragStart}\r\n onDragEnd={props.onDragEnd}\r\n />\r\n </AccordionDetails>\r\n </Accordion>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('details')}\r\n onChange={props.onPanelChange('details')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium }}>Details</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('details') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <HAccordionDetails\r\n ClarityScore = {props.clarityScore}\r\n SharpnessScore = {props.sharpnessScore}\r\n onClarityChange={props.setClarityScore}\r\n onSharpnessChange={props.setSharpnessScore}\r\n isBatchMode={props.isBatchMode}\r\n onDragStart={props.onDragStart}\r\n onDragEnd={props.onDragEnd}\r\n />\r\n </AccordionDetails>\r\n </Accordion>\r\n </Stack>\r\n </>\r\n )\r\n}\r\n","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n TempScore: number;\r\n TintScore: number;\r\n SaturationScore: number;\r\n VibranceScore: number;\r\n isBatchMode: boolean;\r\n onTempChange: (field: keyof AdjustmentState, value: number) => void;\r\n onTintChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSaturationChange: (field: keyof AdjustmentState, value: number) => void;\r\n onVibranceChange: (field: keyof AdjustmentState, value: number) => void;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HAccordionColor(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n \r\n const blueScale = '#292bc0'; // Blue color on left\r\n const yellowScale = '#dfdc28'; // Yellow color on right\r\n\r\n const greenScale = '#00ff04';\r\n const purpleScale = '#b700ff';\r\n \r\n // The gradient for the *entire* background of the slider bar\r\n const tempGradient = `linear-gradient(to right, ${blueScale} 35%, ${yellowScale} 75%)`;\r\n const tintGradient = `linear-gradient(to right, ${greenScale} 20%, ${purpleScale} 75%)`;\r\n\r\n const spectrumColorsSaturation = ['yellow', 'lime', 'deepskyblue', 'magenta', 'red'];\r\n const greyScaleStart = '#000000'; // Black at -100\r\n const greyScaleEnd = '#ffffff'; // White at 0 (or a very light grey)\r\n\r\n const colorStops = spectrumColorsSaturation.map((color, index) => {\r\n const position = 50 + (index / (spectrumColorsSaturation.length - 1)) * 50;\r\n return `${color} ${position}%`;\r\n }).join(', ');\r\n\r\n // The gradient for the *entire* background of the slider bar\r\n const fullTrackGradient = `linear-gradient(to right, ${greyScaleStart} 0%, ${greyScaleEnd} 50%, ${colorStops})`;\r\n\r\n const focusedInputStyle = {\r\n backgroundColor: \"#1C1B1FB2\",\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n };\r\n\r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n \r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n\r\n return(\r\n <>\r\n <Stack>\r\n <Stack direction=\"column\" gap=\"4px\" sx={{pt: '6px', pb: '2px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography\r\n component=\"label\"\r\n htmlFor=\"temperature-input\"\r\n onDoubleClick={() => props.onTempChange(\"tempScore\", 0)}\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Temperature</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"temperature-input\"\r\n value={formatValue(props.TempScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onTempChange(\"tempScore\", val))}\r\n className=\"control-label\"\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: tempGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none',\r\n },\r\n }}\r\n size=\"small\"\r\n value={props.TempScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onTempChange(\"tempScore\", newValue as number)}\r\n onDoubleClick={() => props.onTempChange(\"tempScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography\r\n component=\"label\"\r\n htmlFor=\"tint-input\"\r\n onDoubleClick={() => props.onTintChange(\"tintScore\", 0)}\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Tint</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"tint-input\"\r\n value={formatValue(props.TintScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onTintChange(\"tintScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: tintGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none',\r\n },\r\n }}\r\n size=\"small\"\r\n value={props.TintScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onTintChange(\"tintScore\", newValue as number)}\r\n onDoubleClick={() => props.onTintChange(\"tintScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"vibrance-input\"\r\n onDoubleClick={() => props.onVibranceChange(\"vibranceScore\", 0)}\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Vibrance</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"vibrance-input\"\r\n value={formatValue(props.VibranceScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onVibranceChange(\"vibranceScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: fullTrackGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none',\r\n },\r\n }}\r\n size=\"small\"\r\n value={props.VibranceScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onVibranceChange(\"vibranceScore\", newValue as number)}\r\n onDoubleClick={() => props.onVibranceChange (\"vibranceScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography\r\n component=\"label\"\r\n htmlFor=\"saturation-input\"\r\n onDoubleClick={() => props.onSaturationChange(\"saturationScore\", 0)}\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Saturation</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"saturation-input\"\r\n value={formatValue(props.SaturationScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onSaturationChange(\"saturationScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: fullTrackGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .': {\r\n boxShadow: 'none', \r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none',\r\n },\r\n }}\r\n size=\"small\"\r\n value={props.SaturationScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onSaturationChange(\"saturationScore\", newValue as number)}\r\n onDoubleClick={() => props.onSaturationChange(\"saturationScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n ExposureScore: number;\r\n ContrastScore: number;\r\n HighlightsScore: number;\r\n ShadowsScore: number;\r\n WhitesScore: number;\r\n BlacksScore: number;\r\n isBatchMode: boolean;\r\n // Add onChange handlers for each score\r\n onExposureChange: (field: keyof AdjustmentState, value: number) => void;\r\n onContrastChange: (field: keyof AdjustmentState, value: number) => void;\r\n onHighlightsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onShadowsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onWhitesChange: (field: keyof AdjustmentState, value: number) => void;\r\n onBlacksChange: (field: keyof AdjustmentState, value: number) => void;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HAccordionLight(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n\r\n const focusedInputStyle = {\r\n backgroundColor: \"#1C1B1FB2\",\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n };\r\n \r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n\r\n return (\r\n <>\r\n <Stack>\r\n <Stack direction=\"column\" gap=\"4px\" sx={{pt: '6px', pb: '2px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography\r\n component=\"label\"\r\n htmlFor=\"exposure-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Exposure</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"exposure-input\"\r\n value={formatValue(props.ExposureScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onExposureChange(\"exposureScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none',\r\n }\r\n }}\r\n size=\"small\"\r\n value={props.ExposureScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) =>\r\n props.onExposureChange(\"exposureScore\", newValue as number)\r\n }\r\n onDoubleClick={() => props.onExposureChange(\"exposureScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"contrast-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Contrast</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"contrast-input\"\r\n value={formatValue(props.ContrastScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onContrastChange(\"contrastScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none',\r\n }\r\n }}\r\n size=\"small\"\r\n value={props.ContrastScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) =>\r\n props.onContrastChange(\"contrastScore\", newValue as number)\r\n }\r\n onDoubleClick={() => props.onContrastChange(\"contrastScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"highlights-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Highlights</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"highlights-input\"\r\n value={formatValue(props.HighlightsScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onHighlightsChange(\"highlightsScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none',\r\n }\r\n }}\r\n size=\"small\"\r\n value={props.HighlightsScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) =>\r\n props.onHighlightsChange(\"highlightsScore\", newValue as number)\r\n }\r\n onDoubleClick={() => props.onHighlightsChange(\"highlightsScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"shadows-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Shadows</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"shadows-input\"\r\n value={formatValue(props.ShadowsScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onShadowsChange(\"shadowsScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none',\r\n }\r\n }}\r\n size=\"small\"\r\n value={props.ShadowsScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => \r\n props.onShadowsChange( \"shadowsScore\" ,newValue as number)\r\n }\r\n onDoubleClick={() => props.onShadowsChange(\"shadowsScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"whites-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Whites</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"whites-input\"\r\n value={formatValue(props.WhitesScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onWhitesChange(\"whitesScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none',\r\n }\r\n }}\r\n size=\"small\"\r\n value={props.WhitesScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => \r\n props.onWhitesChange(\"whitesScore\", newValue as number)\r\n }\r\n onDoubleClick={() => props.onWhitesChange(\"whitesScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"blacks-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none' }}>Blacks</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"blacks-input\"\r\n value={formatValue(props.BlacksScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onBlacksChange(\"blacksScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none',\r\n }\r\n }}\r\n size=\"small\"\r\n value={props.BlacksScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onBlacksChange(\"blacksScore\", newValue as number)}\r\n onDoubleClick={() => props.onBlacksChange(\"blacksScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n ClarityScore: number;\r\n SharpnessScore: number;\r\n onClarityChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSharpnessChange: (field: keyof AdjustmentState, value: number) => void;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n isBatchMode: boolean;\r\n}\r\n\r\nexport default function HAccordionDetails(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n \r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n\r\n const [clarityInput, setClarityInput] = React.useState(formatValue(props.ClarityScore));\r\n const [sharpnessInput, setSharpnessInput] = React.useState(formatValue(props.SharpnessScore));\r\n\r\n\r\n const focusedInputStyle = {\r\n backgroundColor: \"#1C1B1FB2\",\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n };\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n\r\n const commitInput = (rawValue: string, min: number, max: number, onChange: (val: number) => void) => {\r\n let numericValue = parseInt(rawValue, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clamped = Math.max(min, Math.min(max, numericValue));\r\n onChange(clamped);\r\n };\r\n\r\n React.useEffect(() => {\r\n setClarityInput(formatValue(props.ClarityScore));\r\n }, [props.ClarityScore]);\r\n\r\n React.useEffect(() => {\r\n setSharpnessInput(formatValue(props.SharpnessScore));\r\n }, [props.SharpnessScore]);\r\n \r\n return(\r\n <>\r\n <Stack>\r\n <Stack direction=\"column\" gap=\"4px\" sx={{pt: '6px', pb: '2px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"clarity-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none'}}>Clarity</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"clarity-input\"\r\n value={clarityInput}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onClarityChange(\"clarityScore\", val))}\r\n onBlur={() => commitInput(clarityInput, -100, 100, (val) => props.onClarityChange(\"clarityScore\", val))}\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n commitInput(clarityInput, -100, 100, (val) => props.onClarityChange(\"clarityScore\", val));\r\n e.currentTarget.blur(); // blur so it formats\r\n }\r\n }}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n // backgroundColor: 'transparent',\r\n // border: '',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none', \r\n },\r\n }}\r\n size=\"small\"\r\n value={props.ClarityScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onClarityChange(\"clarityScore\", newValue as number)}\r\n onDoubleClick={() => props.onClarityChange(\"clarityScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n <Stack direction=\"column\" gap=\"3px\" sx={{pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle,}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\">\r\n <Typography \r\n component=\"label\"\r\n htmlFor=\"sharpness-input\"\r\n sx={{...typography.bodyMedium, userSelect: 'none'}}>Sharpness</Typography>\r\n <TextField\r\n hiddenLabel\r\n id=\"sharpness-input\"\r\n value={sharpnessInput}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onSharpnessChange(\"sharpnessScore\", val))}\r\n onBlur={() => commitInput(sharpnessInput, -100, 100, (val) => props.onSharpnessChange(\"sharpnessScore\", val))}\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n commitInput(sharpnessInput, -100, 100, (val) => props.onSharpnessChange(\"sharpnessScore\", val));\r\n e.currentTarget.blur(); // blur so it formats\r\n }\r\n }}\r\n sx={{\r\n width: \"40px\", \r\n height: \"10px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n // pr: '8px',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"200px\", \r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n boxShadow: 'none', \r\n },\r\n }}\r\n size=\"small\"\r\n value={props.SharpnessScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onSharpnessChange(\"sharpnessScore\", newValue as number)}\r\n onDoubleClick={() => props.onSharpnessChange(\"sharpnessScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Box, Accordion, AccordionDetails , AccordionSummary, Button, Stack, Typography, CardMedia, IconButton, MenuItem, ListItemText , ListItemIcon, Menu } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ntype Preset = {\r\n id: string;\r\n name: string;\r\n};\r\n\r\ninterface Props {\r\n presets: Preset[]; // --- Updated to accept presets as a prop ---\r\n expandedPanels: string[];\r\n selectedPreset: string | null;\r\n presetMenuAnchorEl: null | HTMLElement;\r\n activePresetMenuId: string | null;\r\n onChange: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;\r\n onOpenPresetModal: () => void;\r\n onOpenWatermarkView: () => void;\r\n onSelectPreset: (id: string) => void;\r\n onPresetMenuClick: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;\r\n onPresetMenuClose: () => void;\r\n onRemovePreset: () => void;\r\n onRenamePreset: () => void;\r\n onDeletePreset: () => void;\r\n}\r\n\r\n// --- The static presets array has been REMOVED from this component ---\r\n\r\nexport default function HAccordionPreset(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n const isMenuOpen = Boolean(props.presetMenuAnchorEl);\r\n\r\n const accordionStyle = {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n '& .MuiAccordionSummary-root': {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n },\r\n '& .MuiAccordionDetails-root': {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n },\r\n '& .MuiTypography-root': {\r\n color: colors.surface,\r\n },\r\n '& .MuiSvgIcon-root': {\r\n color: colors.surface,\r\n }\r\n };\r\n\r\n const isPanelExpanded = (panelName: string) => props.expandedPanels.includes(panelName);\r\n\r\n return(\r\n <>\r\n <Box>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('preset')}\r\n onChange={props.onChange('preset')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium, color: colors.surface }}>Preset</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('preset') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <Stack direction=\"column\" gap=\"8px\" sx={{pt: '0px', pb: '0px', mx: '0px', width: '100%'}}>\r\n {props.presets.map((preset) => (\r\n <Stack\r\n key={preset.id}\r\n direction=\"row\"\r\n alignItems=\"center\"\r\n sx={{ width: \"100%\" }}\r\n >\r\n {/* Text Button */}\r\n <Box sx={{ width: 100, flexShrink: 0 }}>\r\n <Button\r\n sx={{\r\n width: '100px',\r\n textWrap: 'nowrap',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n display: 'block',\r\n textTransform: 'none',\r\n color: colors.surface,\r\n // pr: \"120px\", // No longer needed since the button is full width\r\n pl: \"0px\",\r\n ml: \"0px\",\r\n justifyContent: 'flex-start',\r\n ...typography.bodyMedium\r\n }}\r\n onClick={() => props.onSelectPreset(preset.id)}\r\n >\r\n <Box\r\n component=\"span\"\r\n sx={{\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n minWidth: 0,\r\n }}\r\n >\r\n {preset.name}\r\n </Box>\r\n </Button>\r\n </Box>\r\n\r\n {/* Icons group */}\r\n <Stack direction=\"row\" alignItems=\"center\" spacing={1} sx={{ ml: \"auto\" }}>\r\n {props.selectedPreset === preset.id && (\r\n <CardMedia\r\n component=\"img\"\r\n image=\"v1/svg/check-ratio-editor.svg\"\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n )}\r\n <IconButton\r\n aria-label={preset.name}\r\n onClick={(event) => props.onPresetMenuClick(event, preset.id)}\r\n sx={{ p: 0, m: 0 }}\r\n >\r\n <CardMedia\r\n component=\"img\"\r\n image=\"/v1/svg/dots-editor.svg\"\r\n alt=\"Options\"\r\n />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n ))}\r\n <Button\r\n variant=\"text\"\r\n sx={{ color: colors.surface, border: \"1px solid\",\r\n borderColor: colors.surface,\r\n borderRadius: \"40px\",\r\n textTransform: 'none',\r\n }}\r\n onClick={props.onOpenPresetModal}\r\n >\r\n Create Preset\r\n </Button>\r\n </Stack>\r\n </AccordionDetails>\r\n </Accordion>\r\n {/* <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('watermark')}\r\n onChange={props.onChange('watermark')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium, color: colors.surface }}>Watermark</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('watermark') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails>\r\n <Stack direction=\"column\">\r\n <Stack\r\n direction=\"row\"\r\n justifyContent=\"space-between\"\r\n alignItems=\"center\"\r\n sx={{ width: '100%' }}\r\n >\r\n <Typography color=\"initial\">Jonathan</Typography>\r\n <IconButton\r\n aria-label=\"options\"\r\n // onClick={handleMenuClick}\r\n >\r\n <CardMedia\r\n component=\"img\"\r\n image=\"/v1/svg/dots-editor.svg\"\r\n alt=\"Options\"\r\n />\r\n </IconButton>\r\n </Stack>\r\n <Stack\r\n direction=\"row\"\r\n justifyContent=\"space-between\"\r\n alignItems=\"center\"\r\n sx={{ width: '100%' }}\r\n >\r\n <Typography color=\"initial\">Jonathan</Typography>\r\n <IconButton\r\n aria-label=\"options\"\r\n // onClick={handleMenuClick}\r\n >\r\n <CardMedia\r\n component=\"img\"\r\n image=\"/v1/svg/dots-editor.svg\"\r\n alt=\"Options\"\r\n />\r\n </IconButton>\r\n </Stack>\r\n <Button\r\n variant=\"text\"\r\n sx={{ color: colors.surface, border: \"1px solid\" ,borderColor: colors.surface, borderRadius: \"40px\", textTransform: 'none', }}\r\n onClick={props.onOpenWatermarkView}\r\n >\r\n Create Watermark\r\n </Button>\r\n </Stack>\r\n </AccordionDetails>\r\n </Accordion> */}\r\n </Box>\r\n </>\r\n )\r\n}","import {\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogContent, IconButton,\r\n Stack,\r\n Typography,\r\n} from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport React, {ReactElement} from \"react\";\r\nimport {CloseOutlined} from \"@mui/icons-material\";\r\n\r\ninterface Props {\r\n open: boolean;\r\n title: React.ReactNode\r\n description?: React.ReactNode | ReactElement;\r\n onClose?: () => void;\r\n action?: React.ReactNode\r\n //Preset only\r\n actionAdjust?: React.ReactNode\r\n}\r\n\r\nexport function HBaseDialog(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n\r\n return (\r\n <Dialog\r\n disableScrollLock\r\n open={props.open}\r\n onClose={props.onClose}\r\n aria-labelledby=\"responsive-dialog-title\"\r\n PaperProps={{\r\n sx: {\r\n borderRadius: \"28px\",\r\n width: { xs: \"328px\", sm: \"456px\", md: \"456px\" },\r\n // maxWidth: { xs: 328, sm: \"456px\", md: \"456px\" },\r\n //maxHeight: 306,\r\n // margin: { xs: 0, sm: \"auto\" },\r\n },\r\n }}>\r\n <DialogContent\r\n sx={{ pb: \"16px\", mb: \"0px\" }}\r\n >\r\n <Stack direction=\"column\">\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <Typography></Typography>\r\n <Typography\r\n color={colors.onSurface}\r\n sx={{ ...typography.titleMedium }}>\r\n {props.title}\r\n </Typography>\r\n <CloseButton onClick={props.onClose}/>\r\n </Stack>\r\n <Typography\r\n variant=\"bodyMedium\"\r\n color={colors.onSurface}>\r\n {props.description}\r\n </Typography>\r\n </Stack>\r\n </DialogContent>\r\n {props.action && (\r\n <DialogContent\r\n sx={{ pt: \"0px\", mt: \"0px\" }}\r\n >\r\n <Stack alignItems=\"center\" width=\"100%\">\r\n {props.action}\r\n </Stack>\r\n </DialogContent>\r\n )}\r\n </Dialog>\r\n );\r\n}\r\n\r\nexport function HDialogForPreset(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n\r\n return (\r\n <Dialog\r\n disableScrollLock\r\n open={props.open}\r\n onClose={props.onClose}\r\n aria-labelledby=\"responsive-dialog-title\"\r\n PaperProps={{\r\n sx: {\r\n borderRadius: \"28px\",\r\n maxWidth: { xs: 328, sm: \"456px\", md: \"456px\" },\r\n //maxHeight: 306,\r\n margin: { xs: 0, sm: \"auto\" },\r\n },\r\n }}>\r\n <DialogContent\r\n sx={{ padding: { xs: \"24px 24px 0 24px\", sm: \"24 24px 0 24px\" } }}>\r\n <Stack spacing={0} direction=\"column\">\r\n <Stack direction={\"row\"} alignItems=\"center\" justifyContent=\"space-between\">\r\n <Typography\r\n color={colors.onSurface}\r\n sx={{ ...typography.labelLarge }}>\r\n {props.title}\r\n </Typography>\r\n {/* <CloseButton onClick={props.onClose}/> */}\r\n </Stack>\r\n <Stack direction=\"column\" sx={{ pt: \"12px\" }}>\r\n <Stack sx={{ pt: \"20px\", pb: \"20px\" }}>\r\n {props.action}\r\n </Stack>\r\n <Stack>\r\n <Typography\r\n variant=\"bodyMedium\"\r\n color={colors.onSurface}>\r\n {props.description}\r\n </Typography>\r\n {props.actionAdjust}\r\n </Stack>\r\n </Stack>\r\n </Stack>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n\r\ninterface ButtonProps {\r\n text: string\r\n onClick: () => void;\r\n}\r\n\r\nexport function PositiveButton(props: ButtonProps) {\r\n const colors = useColors();\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n sx={{\r\n \":hover\": {\r\n backgroundColor: \"transparent\",\r\n },\r\n }}\r\n onClick={props.onClick}>\r\n <Typography\r\n variant=\"buttonMedium\"\r\n color={colors.onSurface}>\r\n {props.text}\r\n </Typography>\r\n </Button>\r\n )\r\n}\r\n\r\nexport function NegativeButton(props: ButtonProps) {\r\n const colors = useColors();\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n sx={{\r\n borderRadius: 100,\r\n color: colors.error,\r\n \":hover\": {\r\n backgroundColor: \"transparent\",\r\n },\r\n }}\r\n disabled={false}\r\n onClick={props.onClick}>\r\n {props.text}\r\n </Button>\r\n )\r\n}\r\n\r\ninterface CloseButtonProps {\r\n onClick?: () => void;\r\n}\r\n\r\nfunction CloseButton(props: CloseButtonProps) {\r\n return (\r\n <IconButton onClick={props.onClick}>\r\n <CloseOutlined htmlColor=\"black\" />\r\n </IconButton>\r\n )\r\n}","import React from \"react\";\r\nimport {\r\n Button,\r\n Stack,\r\n Typography,\r\n Checkbox,\r\n Collapse,\r\n FormControlLabel,\r\n IconButton\r\n} from \"@mui/material\";\r\nimport ExpandMoreIcon from '@mui/icons-material/ExpandMore';\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ntype CheckState = { [key: string]: boolean };\r\n\r\ninterface Props {\r\n // State for each category's checkboxes\r\n colorChecks: CheckState;\r\n lightChecks: CheckState;\r\n detailsChecks: CheckState;\r\n // State for accordion expansion\r\n expanded: { color: boolean; light: boolean; details: boolean; };\r\n // Handlers\r\n onCopyEdit: () => void;\r\n onParentChange: (event: React.ChangeEvent<HTMLInputElement>, setter: React.Dispatch<React.SetStateAction<any>>) => void;\r\n onChildChange: (event: React.ChangeEvent<HTMLInputElement>, setter: React.Dispatch<React.SetStateAction<any>>) => void;\r\n onToggleExpand: (section: 'color' | 'light' | 'details') => void;\r\n // Setters passed directly for children to update state in the hook\r\n setColorChecks: React.Dispatch<React.SetStateAction<any>>;\r\n setLightChecks: React.Dispatch<React.SetStateAction<any>>;\r\n setDetailsChecks: React.Dispatch<React.SetStateAction<any>>;\r\n}\r\n\r\nexport function HDialogCopy(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n // --- Derived state is now calculated from props ---\r\n const colorValues = Object.values(props.colorChecks);\r\n const colorCheckedCount = colorValues.filter(Boolean).length;\r\n const isColorParentChecked = colorCheckedCount === colorValues.length;\r\n const isColorParentIndeterminate = colorCheckedCount > 0 && !isColorParentChecked;\r\n\r\n const lightValues = Object.values(props.lightChecks);\r\n const lightCheckedCount = lightValues.filter(Boolean).length;\r\n const isLightParentChecked = lightCheckedCount === lightValues.length;\r\n const isLightParentIndeterminate = lightCheckedCount > 0 && !isLightParentChecked;\r\n \r\n const detailsValues = Object.values(props.detailsChecks);\r\n const detailsCheckedCount = detailsValues.filter(Boolean).length;\r\n const isDetailsParentChecked = detailsCheckedCount === detailsValues.length;\r\n const isDetailsParentIndeterminate = detailsCheckedCount > 0 && !isDetailsParentChecked;\r\n\r\n const checkboxStyle = {\r\n // pt: \"5px\",\r\n color: colors.onSurface,\r\n '&.Mui-checked, &.Mui-indeterminate': { color: colors.onSurface },\r\n };\r\n\r\n return (\r\n <Stack direction=\"column\" spacing={1} sx={{ padding: 0, margin: 0, width: '100%' }}>\r\n <Stack>\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <FormControlLabel\r\n label={\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>\r\n Color\r\n </Typography>\r\n }\r\n control={ \r\n <Checkbox \r\n color=\"default\" \r\n icon={<RoundedSquareIcon color={colors.onSurface} />}\r\n checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>}\r\n indeterminateIcon={<RoundedSquareIndeterminateIcon color={colors.onSurface} />}\r\n checked={isColorParentChecked} \r\n indeterminate={isColorParentIndeterminate} \r\n onChange={(e) => props.onParentChange(e, props.setColorChecks)} \r\n sx={checkboxStyle} /> }\r\n />\r\n <Stack direction=\"row\" alignItems=\"center\">\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface }}>{`${colorCheckedCount}/${colorValues.length}`}</Typography>\r\n <IconButton onClick={() => props.onToggleExpand('color')} size=\"small\" sx={{ pt: \"3px\" }}>\r\n <ExpandMoreIcon sx={{ colors: colors.background, transition: 'transform 0.3s', transform: props.expanded.color ? 'rotate(0deg)' : 'rotate(180deg)' }} />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n <Collapse in={props.expanded.color} timeout=\"auto\" unmountOnExit>\r\n <Stack direction=\"column\" sx={{ ml: 2, pl: 1.5 }}>\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Temperature</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"temperature\" checked={props.colorChecks.temperature} onChange={(e) => props.onChildChange(e, props.setColorChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Tint</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"tint\" checked={props.colorChecks.tint} onChange={(e) => props.onChildChange(e, props.setColorChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Vibrance</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"vibrance\" checked={props.colorChecks.vibrance} onChange={(e) => props.onChildChange(e, props.setColorChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Saturation</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"saturation\" checked={props.colorChecks.saturation} onChange={(e) => props.onChildChange(e, props.setColorChecks)} sx={checkboxStyle} />} />\r\n </Stack>\r\n </Collapse>\r\n </Stack>\r\n <Stack>\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <FormControlLabel \r\n label={\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>\r\n Light\r\n </Typography>\r\n }\r\n control={ \r\n <Checkbox \r\n color=\"default\" \r\n icon={<RoundedSquareIcon color={colors.onSurface} />}\r\n checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} \r\n indeterminateIcon={<RoundedSquareIndeterminateIcon color={colors.onSurface} />}\r\n checked={isLightParentChecked} \r\n indeterminate={isLightParentIndeterminate} \r\n onChange={(e) => props.onParentChange(e, props.setLightChecks)} \r\n sx={checkboxStyle} /> } />\r\n <Stack direction=\"row\" alignItems=\"center\">\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface }}>{`${lightCheckedCount}/${lightValues.length}`}</Typography>\r\n <IconButton onClick={() => props.onToggleExpand('light')} size=\"small\" sx={{ pt: \"3px\" }}>\r\n <ExpandMoreIcon sx={{ transition: 'transform 0.3s', transform: props.expanded.light ? 'rotate(0deg)' : 'rotate(180deg)' }} />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n <Collapse in={props.expanded.light} timeout=\"auto\" unmountOnExit>\r\n <Stack direction=\"column\" sx={{ ml: 2, pl: 1.5 }}>\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Exposure</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"exposure\" checked={props.lightChecks.exposure} onChange={(e) => props.onChildChange(e, props.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Contrast</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"contrast\" checked={props.lightChecks.contrast} onChange={(e) => props.onChildChange(e, props.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Highlights</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"highlights\" checked={props.lightChecks.highlights} onChange={(e) => props.onChildChange(e, props.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Shadows</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"shadows\" checked={props.lightChecks.shadows} onChange={(e) => props.onChildChange(e, props.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Whites</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"whites\" checked={props.lightChecks.whites} onChange={(e) => props.onChildChange(e, props.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Blacks</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"blacks\" checked={props.lightChecks.blacks} onChange={(e) => props.onChildChange(e, props.setLightChecks)} sx={checkboxStyle} />} />\r\n </Stack>\r\n </Collapse>\r\n </Stack>\r\n {/* <Stack>\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <FormControlLabel \r\n label={\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>\r\n Details\r\n </Typography>\r\n }\r\n control={ \r\n <Checkbox \r\n color=\"default\" \r\n icon={<RoundedSquareIcon color={colors.onSurface} />}\r\n checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} \r\n indeterminateIcon={<RoundedSquareIndeterminateIcon color={colors.onSurface} />}\r\n checked={isDetailsParentChecked} \r\n indeterminate={isDetailsParentIndeterminate} \r\n onChange={(e) => props.onParentChange(e, props.setDetailsChecks)} \r\n sx={checkboxStyle} /> }/>\r\n <Stack direction=\"row\" alignItems=\"center\">\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface }}>{`${detailsCheckedCount}/${detailsValues.length}`}</Typography>\r\n <IconButton onClick={() => props.onToggleExpand('details')} size=\"small\" sx={{ pt: \"3px\" }}>\r\n <ExpandMoreIcon sx={{ transition: 'transform 0.3s', transform: props.expanded.details ? 'rotate(0deg)' : 'rotate(180deg)' }} />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n <Collapse in={props.expanded.details} timeout=\"auto\" unmountOnExit>\r\n <Stack direction=\"column\" sx={{ ml: 2, pl: 1.5 }}>\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Clarity</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"clarity\" checked={props.detailsChecks.clarity} onChange={(e) => props.onChildChange(e, props.setDetailsChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Sharpness</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"sharpness\" checked={props.detailsChecks.sharpness} onChange={(e) => props.onChildChange(e, props.setDetailsChecks)} sx={checkboxStyle} />} />\r\n </Stack>\r\n </Collapse>\r\n </Stack> */}\r\n <Button onClick={props.onCopyEdit} sx={{...typography.labelMedium, mt: '20px', height: '40px', color: colors.surface, backgroundColor: colors.onSurface, borderRadius: '100px', textTransform: 'none'}}>\r\n Copy\r\n </Button>\r\n </Stack>\r\n );\r\n}\r\n\r\ninterface IconProps {\r\n color: string;\r\n}\r\n\r\n// A component for the UNCHECKED box\r\nconst RoundedSquareIcon = ({ color }: IconProps) => (\r\n <div\r\n style={{\r\n width: 18,\r\n height: 18,\r\n border: `2px solid ${color}`, // Example color for the border\r\n borderRadius: '5px',\r\n backgroundColor: 'transparent',\r\n }}\r\n />\r\n);\r\n\r\n// A component for the CHECKED box\r\nconst RoundedSquareCheckedIcon = ({ color }: IconProps) => (\r\n <div\r\n style={{\r\n width: 18,\r\n height: 18,\r\n border: `2px solid ${color}`, // Example color for the border\r\n backgroundColor: `${color}`,\r\n borderRadius: '5px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n }}\r\n >\r\n {/* You can put a checkmark SVG or character here if you want */}\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#FFFFFF\" strokeWidth=\"3\">\r\n <path d=\"M20 6L9 17L4 12\" />\r\n </svg>\r\n </div>\r\n);\r\n\r\nconst RoundedSquareIndeterminateIcon = ({ color }: IconProps) => (\r\n <div\r\n style={{\r\n // These styles MUST match your checked icon's container\r\n width: 18,\r\n height: 18,\r\n border: `2px solid ${color}`,\r\n backgroundColor: `${color}`,\r\n borderRadius: '5px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n }}\r\n >\r\n {/* A simple horizontal line for the indeterminate state */}\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#FFFFFF\" strokeWidth=\"3\">\r\n <path d=\"M5 12L19 12\" />\r\n </svg>\r\n </div>\r\n);\r\n\r\ninterface PropsPreset {\r\n // State for each category's checkboxes\r\n colorChecks: CheckState;\r\n lightChecks: CheckState;\r\n detailsChecks: CheckState;\r\n // State for accordion expansion\r\n expanded: { color: boolean; light: boolean; details: boolean; };\r\n // Handlers\r\n onParentChange: (event: React.ChangeEvent<HTMLInputElement>, setter: React.Dispatch<React.SetStateAction<any>>) => void;\r\n onChildChange: (event: React.ChangeEvent<HTMLInputElement>, setter: React.Dispatch<React.SetStateAction<any>>) => void;\r\n onToggleExpand: (section: 'color' | 'light' | 'details') => void;\r\n // Setters passed directly for children to update state in the hook\r\n setColorChecks: React.Dispatch<React.SetStateAction<any>>;\r\n setLightChecks: React.Dispatch<React.SetStateAction<any>>;\r\n setDetailsChecks: React.Dispatch<React.SetStateAction<any>>;\r\n descriptionOnCopy?: string;\r\n}\r\n\r\nexport function HDialogPreset(propsPreset: PropsPreset) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n // --- Derived state is now calculated from propsPreset ---\r\n const colorValues = Object.values(propsPreset.colorChecks);\r\n const colorCheckedCount = colorValues.filter(Boolean).length;\r\n const isColorParentChecked = colorCheckedCount === colorValues.length;\r\n const isColorParentIndeterminate = colorCheckedCount > 0 && !isColorParentChecked;\r\n\r\n const lightValues = Object.values(propsPreset.lightChecks);\r\n const lightCheckedCount = lightValues.filter(Boolean).length;\r\n const isLightParentChecked = lightCheckedCount === lightValues.length;\r\n const isLightParentIndeterminate = lightCheckedCount > 0 && !isLightParentChecked;\r\n \r\n const detailsValues = Object.values(propsPreset.detailsChecks);\r\n const detailsCheckedCount = detailsValues.filter(Boolean).length;\r\n const isDetailsParentChecked = detailsCheckedCount === detailsValues.length;\r\n const isDetailsParentIndeterminate = detailsCheckedCount > 0 && !isDetailsParentChecked;\r\n\r\n const checkboxStyle = {\r\n color: colors.onSurface,\r\n '&.Mui-checked, &.Mui-indeterminate': { color: colors.onSurface },\r\n };\r\n\r\n return (\r\n <Stack direction=\"column\" spacing={1} sx={{ padding: 0, margin: 0, width: '100%' }}>\r\n <Stack>\r\n <Stack direction=\"column\" alignItems=\"flex-start\">\r\n <Typography variant=\"inherit\" color=\"initial\">{propsPreset.descriptionOnCopy}</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <FormControlLabel\r\n label={\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>\r\n Color\r\n </Typography>\r\n }\r\n control={ \r\n <Checkbox \r\n color=\"default\" \r\n icon={<RoundedSquareIcon color={colors.onSurface} />}\r\n checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>}\r\n indeterminateIcon={<RoundedSquareIndeterminateIcon color={colors.onSurface} />}\r\n checked={isColorParentChecked} \r\n indeterminate={isColorParentIndeterminate} \r\n onChange={(e) => propsPreset.onParentChange(e, propsPreset.setColorChecks)} \r\n sx={checkboxStyle} /> }\r\n />\r\n <Stack direction=\"row\" alignItems=\"center\">\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface }}>{`${colorCheckedCount}/${colorValues.length}`}</Typography>\r\n <IconButton onClick={() => propsPreset.onToggleExpand('color')} size=\"small\" sx={{ pt: \"3px\" }}>\r\n <ExpandMoreIcon sx={{ colors: colors.background, transition: 'transform 0.3s', transform: propsPreset.expanded.color ? 'rotate(0deg)' : 'rotate(180deg)' }} />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n <Collapse in={propsPreset.expanded.color} timeout=\"auto\" unmountOnExit>\r\n <Stack direction=\"column\" sx={{ ml: 2, pl: 1.5 }}>\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Temperature</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"temperature\" checked={propsPreset.colorChecks.temperature} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setColorChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Tint</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"tint\" checked={propsPreset.colorChecks.tint} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setColorChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Vibrance</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"vibrance\" checked={propsPreset.colorChecks.vibrance} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setColorChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Saturation</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} name=\"saturation\" checked={propsPreset.colorChecks.saturation} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setColorChecks)} sx={checkboxStyle} />} />\r\n </Stack>\r\n </Collapse>\r\n </Stack>\r\n <Stack>\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <FormControlLabel \r\n label={\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>\r\n Light\r\n </Typography>\r\n }\r\n control={ \r\n <Checkbox \r\n color=\"default\" \r\n icon={<RoundedSquareIcon color={colors.onSurface} />}\r\n checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} \r\n indeterminateIcon={<RoundedSquareIndeterminateIcon color={colors.onSurface} />}\r\n checked={isLightParentChecked} \r\n indeterminate={isLightParentIndeterminate} \r\n onChange={(e) => propsPreset.onParentChange(e, propsPreset.setLightChecks)} \r\n sx={checkboxStyle} /> } />\r\n <Stack direction=\"row\" alignItems=\"center\">\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface }}>{`${lightCheckedCount}/${lightValues.length}`}</Typography>\r\n <IconButton onClick={() => propsPreset.onToggleExpand('light')} size=\"small\" sx={{ pt: \"3px\" }}>\r\n <ExpandMoreIcon sx={{ transition: 'transform 0.3s', transform: propsPreset.expanded.light ? 'rotate(0deg)' : 'rotate(180deg)' }} />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n <Collapse in={propsPreset.expanded.light} timeout=\"auto\" unmountOnExit>\r\n <Stack direction=\"column\" sx={{ ml: 2, pl: 1.5 }}>\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Exposure</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"exposure\" checked={propsPreset.lightChecks.exposure} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Contrast</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"contrast\" checked={propsPreset.lightChecks.contrast} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Highlights</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"highlights\" checked={propsPreset.lightChecks.highlights} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Shadows</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"shadows\" checked={propsPreset.lightChecks.shadows} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Whites</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"whites\" checked={propsPreset.lightChecks.whites} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setLightChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Blacks</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"blacks\" checked={propsPreset.lightChecks.blacks} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setLightChecks)} sx={checkboxStyle} />} />\r\n </Stack>\r\n </Collapse>\r\n </Stack>\r\n {/* <Stack>\r\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <FormControlLabel \r\n label={\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>\r\n Details\r\n </Typography>\r\n }\r\n control={ \r\n <Checkbox \r\n color=\"default\" \r\n icon={<RoundedSquareIcon color={colors.onSurface} />}\r\n checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} \r\n indeterminateIcon={<RoundedSquareIndeterminateIcon color={colors.onSurface} />}\r\n checked={isDetailsParentChecked} \r\n indeterminate={isDetailsParentIndeterminate} \r\n onChange={(e) => propsPreset.onParentChange(e, propsPreset.setDetailsChecks)} \r\n sx={checkboxStyle} /> }/>\r\n <Stack direction=\"row\" alignItems=\"center\">\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface }}>{`${detailsCheckedCount}/${detailsValues.length}`}</Typography>\r\n <IconButton onClick={() => propsPreset.onToggleExpand('details')} size=\"small\" sx={{ pt: \"3px\" }}>\r\n <ExpandMoreIcon sx={{ transition: 'transform 0.3s', transform: propsPreset.expanded.details ? 'rotate(0deg)' : 'rotate(180deg)' }} />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n <Collapse in={propsPreset.expanded.details} timeout=\"auto\" unmountOnExit>\r\n <Stack direction=\"column\" sx={{ ml: 2, pl: 1.5 }}>\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Clarity</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"clarity\" checked={propsPreset.detailsChecks.clarity} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setDetailsChecks)} sx={checkboxStyle} />} />\r\n <FormControlLabel label={ <Typography sx={{ ...typography.bodyMedium, color: colors.onSurface, pt: \"2px\" }}>Sharpness</Typography> } control={<Checkbox icon={<RoundedSquareIcon color={colors.onSurface} />} checkedIcon={<RoundedSquareCheckedIcon color={colors.onSurface}/>} color=\"default\" name=\"sharpness\" checked={propsPreset.detailsChecks.sharpness} onChange={(e) => propsPreset.onChildChange(e, propsPreset.setDetailsChecks)} sx={checkboxStyle} />} />\r\n </Stack>\r\n </Collapse>\r\n </Stack> */}\r\n </Stack>\r\n );\r\n}","import React from \"react\";\r\nimport { BottomNavigation, BottomNavigationAction, Box, CardMedia, Paper, Stack } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport HTabColorAdjustmentMobile from \"./HTabColorAdjustmentMobile\";\r\nimport HTabPresetMobile from \"./HTabPresetMobile\";\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ntype Preset = {\r\n id: string;\r\n name: string;\r\n};\r\n\r\ninterface Props {\r\n // EachPanel\r\n presets: Preset[];\r\n activePanel: string;\r\n activeSubPanel: string;\r\n setActivePanel: (tab: string) => void;\r\n setActiveSubPanel: (subTab: string) => void;\r\n activeTab: string;\r\n innerRef?: React.Ref<HTMLDivElement>;\r\n\r\n // Dragging effect mobile\r\n panelRef: React.RefObject<HTMLDivElement>;\r\n contentRef: React.RefObject<HTMLDivElement | null>;\r\n panelHeight: number;\r\n handleDragStart: (e: React.MouseEvent | React.TouchEvent) => void;\r\n onContentHeightChange: (height: number) => void;\r\n\r\n // Color Adjustment Mobile\r\n tempScore: number;\r\n tintScore: number;\r\n vibranceScore: number;\r\n saturationScore: number;\r\n exposureScore: number;\r\n highlightsScore: number;\r\n shadowScore: number;\r\n whiteScore: number;\r\n blackScore: number;\r\n contrastScore: number;\r\n clarityScore: number;\r\n sharpnessScore: number;\r\n onTempChange: (field: keyof AdjustmentState, value: number) => void;\r\n onTintChange: (field: keyof AdjustmentState, value: number) => void;\r\n onVibranceChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSaturationChange: (field: keyof AdjustmentState, value: number) => void;\r\n onExposureChange: (field: keyof AdjustmentState, value: number) => void;\r\n onHighlightsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onShadowsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onWhitesChange: (field: keyof AdjustmentState, value: number) => void;\r\n onBlacksChange: (field: keyof AdjustmentState, value: number) => void;\r\n onContrastChange: (field: keyof AdjustmentState, value: number) => void;\r\n onClarityChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSharpnessChange: (field: keyof AdjustmentState, value: number) => void;\r\n isBatchMode: boolean;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n\r\n selectedPreset: string | null;\r\n onSelectPreset: (id: string) => void;\r\n\r\n // Preset Mobile (For now)\r\n onOpenPresetModal: () => void;\r\n presetOptionModal: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;\r\n}\r\n\r\n// Data structure for the sub-navigation tabs\r\nconst subTabs: { [key: string]: { value: string; label: string, inactiveIcon?: string, activeIcon?: string }[] } = {\r\n colorAdjustment: [\r\n { value: \"color\", label: \"Color\", inactiveIcon: \"/v1/svg/new-mobile-coloAdjustment-notpress.svg\", activeIcon: \"/v1/svg/new-mobile-coloAdjustment-presssvg.svg\" },\r\n { value: \"light\", label: \"Light\", inactiveIcon: \"/v1/svg/light-inactive-mobile.svg\", activeIcon: \"/v1/svg/light-active-mobile.svg\" },\r\n // { value: \"details\", label: \"Details\", inactiveIcon: \"/v1/svg/details-inactive-mobile.svg\", activeIcon: \"/v1/svg/details-active-mobile.svg\"},\r\n ],\r\n aspectRatio: [\r\n { value: \"portrait\", label: \"Portrait\" },\r\n { value: \"square\", label: \"Square\" },\r\n { value: \"wide\", label: \"Wide\" },\r\n ],\r\n preset: [\r\n { value: \"Preset\", label: \"Preset\", inactiveIcon: \"/v1/svg/preset-inactive-mobile.svg\", activeIcon: \"/v1/svg/preset-active-mobile.svg\" },\r\n ],\r\n};\r\n\r\nexport default function HImageEditorMobile(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const handleChange = (event: React.SyntheticEvent, newValue: string) => {\r\n props.setActivePanel(newValue);\r\n };\r\n\r\n const currentSubTabs = subTabs[props.activePanel];\r\n\r\n // Helper function to render the correct content inside the draggable panel\r\n const renderPanelContent = () => {\r\n switch(props.activePanel) {\r\n case 'colorAdjustment':\r\n return <HTabColorAdjustmentMobile {...props} />;\r\n case 'preset':\r\n return <HTabPresetMobile {...props} />;\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n return (\r\n <Paper \r\n elevation={0}\r\n sx={{ \r\n id: 'HImageEditorMobile',\r\n position: 'fixed', \r\n bottom: 0, \r\n left: 0, \r\n right: 0, \r\n zIndex: 1300,\r\n backgroundColor: 'transparent',\r\n }}\r\n >\r\n <Stack direction=\"column\">\r\n {props.activeSubPanel && (\r\n <Paper\r\n ref={props.panelRef}\r\n elevation={3}\r\n className=\"draggable-panel MuiPaper-transition\"\r\n sx={{\r\n height: `${props.panelHeight}px`,\r\n maxHeight: '80vh',\r\n backgroundColor: 'rgba(40, 40, 40, 0.85)',\r\n overflow: 'hidden',\r\n borderRadius: \"0px\",\r\n '&.MuiPaper-transition': {\r\n transition: 'height 0.5s ease-in-out',\r\n },\r\n }}\r\n >\r\n <Box\r\n onMouseDown={props.handleDragStart}\r\n onTouchStart={props.handleDragStart}\r\n sx={{\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n pt: '5px',\r\n pb: '12px',\r\n cursor: 'ns-resize',\r\n touchAction: 'none',\r\n }}\r\n >\r\n <Box sx={{ width: 40, height: 5, borderRadius: '2.5px', backgroundColor: 'rgba(255, 255, 255, 0.5)' }} />\r\n </Box>\r\n <Box\r\n ref={props.contentRef} \r\n sx={{\r\n paddingX: \"8px\",\r\n paddingBottom: 3,\r\n height: 'calc(100% - 30px)',\r\n overflowY: 'auto',\r\n scrollbarWidth: 'none',\r\n '&::-webkit-scrollbar': { display: 'none' },\r\n }}\r\n >\r\n {renderPanelContent()}\r\n </Box>\r\n </Paper>\r\n )}\r\n {currentSubTabs && (\r\n <Paper \r\n sx={{\r\n backgroundColor: colors.onBackground,\r\n paddingTop: \"10px\",\r\n pb: \"0px\",\r\n mb: \"0px\",\r\n px: \"44px\",\r\n borderRadius: \"0px\",\r\n }} \r\n elevation={3}\r\n >\r\n <BottomNavigation showLabels sx={{ backgroundColor: colors.onBackground, gap: '10px' }}>\r\n {currentSubTabs.map((tab) => {\r\n const isActive = props.activeSubPanel === tab.value;\r\n const iconSrc = isActive ? tab.activeIcon : tab.inactiveIcon;\r\n return (\r\n <BottomNavigationAction\r\n key={tab.value}\r\n label={tab.label}\r\n value={tab.value}\r\n onClick={() => props.setActiveSubPanel(isActive ? '' : tab.value)}\r\n icon={iconSrc && <CardMedia component=\"img\" image={iconSrc} sx={{ width: \"20px\", height: \"20px\", mb: \"5px\" }} />}\r\n sx={{\r\n color: isActive ? colors.surface : colors.onSurfaceVariant1,\r\n minWidth: 'auto', p: 0,\r\n '& .MuiBottomNavigationAction-label': {\r\n ...typography.labelSmall,\r\n color: isActive ? colors.surface : colors.onSurfaceVariant1,\r\n }\r\n }}\r\n />\r\n );\r\n })}\r\n </BottomNavigation>\r\n </Paper>\r\n )}\r\n <Paper sx={{ backgroundColor: colors.onBackground, borderRadius: \"0px\" }} elevation={3}>\r\n <Stack direction=\"row\" justifyContent=\"center\" alignItems=\"center\" sx={{ pt: \"0px\", pb: \"0px\", mb: \"0px\", mr: \"0px\", ml: \"0px\" }}>\r\n <BottomNavigation value={props.activePanel} onChange={handleChange} sx={{ backgroundColor: colors.onBackground }}>\r\n <BottomNavigationAction\r\n value=\"colorAdjustment\"\r\n sx={{ px: '12px', py: '0px', minWidth: 'auto' }}\r\n icon={<CardMedia component=\"img\" image={props.activePanel === 'colorAdjustment' ? \"/v1/svg/color-adjustment-active-mobile.svg\" : \"/v1/svg/color-adjustment-inactive-mobile.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />}\r\n />\r\n {/* <BottomNavigationAction\r\n value=\"aspectRatio\"\r\n sx={{ px: '12px', py: '0px', minWidth: 'auto' }}\r\n icon={<CardMedia component=\"img\" image={props.activePanel === 'aspectRatio' ? \"/v1/svg/aspect-ratio-inactive-mobile.svg\" : \"/v1/svg/aspect-ratio-inactive-mobile.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />}\r\n /> */}\r\n <BottomNavigationAction\r\n value=\"preset\"\r\n sx={{ px: '12px', py: '0px', minWidth: 'auto' }}\r\n icon={<CardMedia component=\"img\" image={props.activePanel === 'preset' ? \"/v1/svg/preset-and-watermark-active-mobile.svg\" : \"/v1/svg/preset-and-watermark-inactive-mobile.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />}\r\n />\r\n </BottomNavigation>\r\n </Stack>\r\n </Paper>\r\n </Stack>\r\n </Paper>\r\n );\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n tempScore: number;\r\n tintScore: number;\r\n saturationScore: number;\r\n vibranceScore: number;\r\n isBatchMode: boolean;\r\n onTempChange: (field: keyof AdjustmentState, value: number) => void;\r\n onTintChange: (field: keyof AdjustmentState, value: number) => void;\r\n onVibranceChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSaturationChange: (field: keyof AdjustmentState, value: number) => void;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HSliderColorMobile(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n \r\n const blueScale = '#292bc0'; // Blue color on left\r\n const yellowScale = '#dfdc28'; // Yellow color on right\r\n\r\n const greenScale = '#00ff04';\r\n const purpleScale = '#b700ff';\r\n \r\n // The gradient for the *entire* background of the slider bar\r\n const tempGradient = `linear-gradient(to right, ${blueScale} 35%, ${yellowScale} 75%)`;\r\n const tintGradient = `linear-gradient(to right, ${greenScale} 20%, ${purpleScale} 75%)`;\r\n\r\n const saturationColors = ['yellow', 'lime', 'deepskyblue', 'magenta', 'red'];\r\n const greyScaleStart = '#000000'; // Black at -100\r\n const greyScaleEnd = '#ffffff'; // White at 0 (or a very light grey)\r\n\r\n const colorStops = saturationColors.map((color, index) => {\r\n const position = 50 + (index / (saturationColors.length - 1)) * 50;\r\n return `${color} ${position}%`;\r\n }).join(', ');\r\n\r\n // The gradient for the *entire* background of the slider bar\r\n const fullTrackGradient = `linear-gradient(to right, ${greyScaleStart} 0%, ${greyScaleEnd} 50%, ${colorStops})`;\r\n\r\n const focusedInputStyle = {\r\n backgroundColor: \"#1C1B1FB2\",\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n };\r\n\r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n \r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n\r\n return(\r\n <>\r\n <Stack spacing={0} direction=\"column\" sx={{ width: '100%', paddingX: 1, m: \"0px\"}}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onTempChange(\"tempScore\", 0)}\r\n >\r\n Temperature\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"temperature-input\"\r\n value={formatValue(props.tempScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onTempChange(\"tempScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: tempGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.tempScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onTempChange(\"tempScore\", newValue as number)}\r\n onDoubleClick={() => props.onTempChange(\"tempScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onTintChange(\"tintScore\", 0)}\r\n >\r\n Tint\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.tintScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onTintChange(\"tintScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: tintGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.tintScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onTintChange(\"tintScore\", newValue as number)}\r\n onDoubleClick={() => props.onTintChange(\"tintScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }}>\r\n <Typography \r\n sx={{ ...typography.bodyMedium, color: colors.surface }}\r\n onDoubleClick={() => props.onVibranceChange(\"vibranceScore\", 0)}\r\n >\r\n Vibrance\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.vibranceScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onVibranceChange(\"vibranceScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: fullTrackGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.vibranceScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onVibranceChange(\"vibranceScore\", newValue as number)}\r\n onDoubleClick={() => props.onVibranceChange(\"vibranceScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }}>\r\n <Typography \r\n sx={{ ...typography.bodyMedium, color: colors.surface }}\r\n onDoubleClick={() => props.onSaturationChange(\"saturationScore\", 0)}\r\n >\r\n Saturation\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.saturationScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onSaturationChange(\"saturationScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.surface,\r\n '& .MuiSlider-rail': {\r\n background: fullTrackGradient,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-track': {\r\n background: 'transparent',\r\n border: 'none',\r\n },\r\n '& .MuiSlider-thumb': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.saturationScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onSaturationChange(\"saturationScore\", newValue as number)}\r\n onDoubleClick={() => props.onSaturationChange(\"saturationScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField} from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n exposureScore: number;\r\n contrastScore: number;\r\n highlightsScore: number;\r\n shadowScore: number;\r\n whiteScore: number;\r\n blackScore: number;\r\n isBatchMode: boolean;\r\n // Add onChange handlers for each score\r\n onExposureChange: (field: keyof AdjustmentState, value: number) => void;\r\n onContrastChange: (field: keyof AdjustmentState, value: number) => void;\r\n onHighlightsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onShadowsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onWhitesChange: (field: keyof AdjustmentState, value: number) => void;\r\n onBlacksChange: (field: keyof AdjustmentState, value: number) => void;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HSliderLightMobile (props: Props){\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n \r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n\r\n return (\r\n <>\r\n <Stack spacing={0} direction=\"column\" sx={{ width: '100%', paddingX: 1 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onExposureChange(\"exposureScore\", 0)}\r\n >\r\n Exposure\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.exposureScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onExposureChange(\"exposureScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n boxShadow: 'none', \r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.exposureScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onExposureChange(\"exposureScore\", newValue as number)}\r\n onDoubleClick={() => props.onExposureChange(\"exposureScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography \r\n sx={{ ...typography.bodyMedium, color: colors.surface }}\r\n >\r\n Contrast\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.contrastScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onContrastChange(\"contrastScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n boxShadow: 'none', \r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.contrastScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onContrastChange(\"contrastScore\", newValue as number)}\r\n onDoubleClick={() => props.onContrastChange(\"contrastScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onHighlightsChange(\"highlightsScore\", 0)}\r\n >\r\n Highlights\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.highlightsScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onHighlightsChange(\"highlightsScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n boxShadow: 'none', \r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.highlightsScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onHighlightsChange(\"highlightsScore\", newValue as number)}\r\n onDoubleClick={() => props.onHighlightsChange(\"highlightsScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onShadowsChange(\"shadowsScore\", 0)}\r\n >\r\n Shadows\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.shadowScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onShadowsChange(\"shadowsScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n boxShadow: 'none', \r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.shadowScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onShadowsChange(\"shadowsScore\", newValue as number)}\r\n onDoubleClick={() => props.onShadowsChange(\"shadowsScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onWhitesChange(\"whitesScore\", 0)}\r\n >\r\n Whites\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.whiteScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onWhitesChange(\"whitesScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n boxShadow: 'none', \r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.whiteScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onWhitesChange(\"whitesScore\", newValue as number)}\r\n onDoubleClick={() => props.onWhitesChange(\"whitesScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography \r\n sx={{...typography.bodyMedium, color: colors.surface}}\r\n onDoubleClick={() => props.onBlacksChange(\"blacksScore\", 0)}\r\n >\r\n Blacks\r\n </Typography>\r\n <TextField\r\n InputProps={{ readOnly: true }}\r\n hiddenLabel\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.blackScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onBlacksChange(\"blacksScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n },\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n boxShadow: 'none', \r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.blackScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onBlacksChange(\"blacksScore\", newValue as number)}\r\n onDoubleClick={() => props.onBlacksChange(\"blacksScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n </>\r\n )\r\n\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\n\r\ninterface Props {\r\n clarityScore: number;\r\n sharpnessScore: number;\r\n isBatchMode: boolean;\r\n onClarityChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSharpnessChange: (field: keyof AdjustmentState, value: number) => void;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HSliderDetailsMobile(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n \r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n return (\r\n <>\r\n <Stack spacing={0} direction=\"column\" sx={{ width: '100%', paddingX: 1 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Clarity</Typography>\r\n <TextField\r\n hiddenLabel\r\n InputProps={{ readOnly: true }}\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.clarityScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onClarityChange(\"clarityScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.clarityScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onClarityChange(\"clarityScore\", newValue as number)}\r\n onDoubleClick={() => props.onClarityChange(\"clarityScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ pt: '10px', pb: '0px' }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Sharpness</Typography>\r\n <TextField\r\n hiddenLabel\r\n InputProps={{ readOnly: true }}\r\n id=\"filled-hidden-label-small\"\r\n value={formatValue(props.sharpnessScore)}\r\n variant=\"filled\"\r\n onChange={(e) => handleInputChange(e, -100, 100, (val) => props.onSharpnessChange(\"sharpnessScore\", val))}\r\n sx={{\r\n width: \"40px\", \r\n alignItems: \"center\", \r\n textAlign: \"right\", \r\n pr: \"4px\",\r\n display: \"flex\",\r\n '& .MuiFilledInput-root': {\r\n backgroundColor: 'transparent',\r\n borderRadius: \"0px\",\r\n border: 'none',\r\n '&:before': {\r\n borderBottom: 'none',\r\n },\r\n '&:after': {\r\n borderBottom: 'none',\r\n },\r\n '&:hover:not(.Mui-disabled):before': {\r\n borderBottom: 'none',\r\n },\r\n '&.Mui-focused:after': {\r\n borderBottom: 'none',\r\n },\r\n },\r\n '& .MuiFilledInput-input': {\r\n textAlign: 'right',\r\n padding: 0,\r\n pr: '4px',\r\n color: colors.surface,\r\n fontSize: \"14px\",\r\n },\r\n '& .Mui-focused' : {\r\n '& .MuiFilledInput-input': {\r\n backgroundColor: \"#1C1B1FB2\",\r\n textAlign: 'right',\r\n borderRadius: '5px 5px 0px 0px',\r\n borderBottom: 'none',\r\n pl: '2px',\r\n }\r\n }\r\n }}/>\r\n </Stack>\r\n <Slider\r\n sx={{\r\n width: \"100%\",\r\n color: colors.onSurfaceVariant,\r\n '& .MuiSlider-rail': {\r\n background: colors.onSurfaceVariant,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb': {\r\n background: colors.surface,\r\n opacity: 1,\r\n },\r\n '& .MuiSlider-thumb:hover': {\r\n boxShadow: 'none', \r\n }\r\n }}\r\n size=\"small\"\r\n value={props.sharpnessScore}\r\n step={1}\r\n min={-100}\r\n max={100}\r\n onChange={(_event, newValue) => props.onSharpnessChange(\"sharpnessScore\", newValue as number)}\r\n onDoubleClick={() => props.onSharpnessChange(\"sharpnessScore\", 0)}\r\n onMouseDown={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onMouseUp={() => {\r\n props.onDragEnd();\r\n }}\r\n onTouchStart={() => {\r\n if (!props.isBatchMode) {\r\n props.onDragStart();\r\n }\r\n }}\r\n onTouchEnd={() => {\r\n props.onDragEnd();\r\n }}\r\n />\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport HSliderColorMobile from \"./HSliderColorMobile\";\r\nimport HSliderLightMobile from \"./HSliderLightMobile\";\r\nimport HSliderDetailsMobile from \"./HSliderDetailsMobile\";\r\nimport { AdjustmentState} from '../../hooks/editor/type'\r\nimport { Box } from \"@mui/material\";\r\n\r\n\r\ninterface Props {\r\n activeTab: string;\r\n innerRef?: React.Ref<HTMLDivElement>;\r\n tempScore: number;\r\n tintScore: number;\r\n vibranceScore: number;\r\n saturationScore: number;\r\n exposureScore: number;\r\n highlightsScore: number;\r\n shadowScore: number;\r\n whiteScore: number;\r\n blackScore: number;\r\n contrastScore: number;\r\n clarityScore: number;\r\n sharpnessScore: number;\r\n onTempChange: (field: keyof AdjustmentState, value: number) => void;\r\n onTintChange: (field: keyof AdjustmentState, value: number) => void;\r\n onVibranceChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSaturationChange: (field: keyof AdjustmentState, value: number) => void;\r\n onExposureChange: (field: keyof AdjustmentState, value: number) => void;\r\n onHighlightsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onShadowsChange: (field: keyof AdjustmentState, value: number) => void;\r\n onWhitesChange: (field: keyof AdjustmentState, value: number) => void;\r\n onBlacksChange: (field: keyof AdjustmentState, value: number) => void;\r\n onContrastChange: (field: keyof AdjustmentState, value: number) => void;\r\n onClarityChange: (field: keyof AdjustmentState, value: number) => void;\r\n onSharpnessChange: (field: keyof AdjustmentState, value: number) => void;\r\n isBatchMode: boolean;\r\n onDragStart: () => void;\r\n onDragEnd: () => void;\r\n}\r\n\r\nexport default function HTabColorAdjustmentMobile(props: Props) {\r\n return (\r\n <Box ref={props.innerRef}>\r\n {props.activeTab === \"light\" && <HSliderLightMobile {...props} />}\r\n {props.activeTab === \"color\" && <HSliderColorMobile {...props} />}\r\n {props.activeTab === \"details\" && <HSliderDetailsMobile {...props} />}\r\n </Box>\r\n );\r\n}","import React from \"react\";\r\nimport {Typography, Stack, IconButton, CardMedia, Button} from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ntype Preset = {\r\n id: string;\r\n name: string;\r\n};\r\n\r\ninterface Props {\r\n presets: Preset[]; // Prop to receive presets from the hook\r\n selectedPreset: string | null;\r\n presetOptionModal: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;\r\n onOpenPresetModal: () => void;\r\n onSelectPreset: (id: string) => void;\r\n}\r\n\r\n// Static `presets` array has been removed.\r\n\r\nexport default function HTabPresetMobile (props: Props){\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n return(\r\n <>\r\n <Stack direction=\"column\" spacing={0} sx={{ px: \"0px\", mx: \"0px\" }}>\r\n {/* Maps over props.presets */}\r\n {props.presets.map((preset) => (\r\n <Stack key={preset.id} direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\r\n <Button\r\n sx={{ ...typography.bodyMedium, color: colors.surface, justifyContent: 'flex-start', flexGrow: 1, textTransform: 'none' }}\r\n onClick={() => props.onSelectPreset(preset.id)}\r\n >\r\n {preset.name}\r\n </Button>\r\n <Stack direction=\"row\" alignItems=\"center\" spacing={1}>\r\n {props.selectedPreset === preset.id && (\r\n <CardMedia\r\n component=\"img\"\r\n image=\"v1/svg/check-ratio-editor.svg\"\r\n sx={{ width: \"20px\", height: \"20px\", px: \"2px\" }}\r\n />\r\n )}\r\n <IconButton aria-label={preset.name} sx={{ px: \"8px\" }} onClick={(event) => props.presetOptionModal(event, preset.id)}>\r\n <CardMedia\r\n component=\"img\"\r\n image=\"/v1/svg/dots-editor.svg\"\r\n alt=\"Options\"\r\n />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n ))}\r\n <Button\r\n variant=\"text\"\r\n sx={{ color: colors.surface, border: \"1px solid\" ,borderColor: colors.surface, borderRadius: \"40px\", mt: \"12px\", textTransform: 'none' }}\r\n onClick={props.onOpenPresetModal}\r\n >\r\n Create Preset\r\n </Button>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, IconButton, CardMedia, Paper, Slide } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n activePanel: string;\r\n isPanelOpen: boolean;\r\n anchorElZoom: null | HTMLElement;\r\n children: React.ReactNode;\r\n footer: React.ReactNode;\r\n setActivePanel: (accordion: string) => void;\r\n onScale: (event: React.MouseEvent<HTMLElement>) => void;\r\n onBeforeAfter: () => void;\r\n onZoomMenuClose: () => void;\r\n onZoomAction: (zoomLevel: string) => void;\r\n}\r\n\r\nexport default function HImageEditorDesktop(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n const isZoomMenuOpen = Boolean(props.anchorElZoom);\r\n\r\n return (\r\n <>\r\n <Slide direction=\"left\" in={props.isPanelOpen} mountOnEnter unmountOnExit>\r\n <Stack sx={{ }}>\r\n <Paper\r\n elevation={3}\r\n sx={{\r\n position: 'inherit',\r\n right: '40px',\r\n top: '55px',\r\n width: '320px',\r\n height: 'calc(100vh - 70px)',\r\n // pb: '10px',\r\n zIndex: 1200,\r\n backgroundColor: '#000000',\r\n overflow: 'hidden',\r\n // pl: \"20px\"\r\n }}\r\n >\r\n <Stack direction=\"row\" sx={{ height: '100%', pl: \"10px\", }}>\r\n <Stack direction=\"column\" sx={{ width: 'calc(100% - 60px)', height: '95%' }}>\r\n <Stack sx={{ flexGrow: 1, overflowY: 'auto', px: 2, msOverflowStyle: 'none', scrollbarWidth: 'none', '&::-webkit-scrollbar': { display: 'none' } }}>\r\n {props.children}\r\n </Stack>\r\n <Stack sx={{\r\n flexShrink: 0,\r\n p: '0px 25px',\r\n }}>\r\n {props.footer}\r\n </Stack>\r\n </Stack>\r\n <Stack\r\n justifyContent=\"flex-start\"\r\n spacing={\"15px\"}\r\n sx={{\r\n width: '10px',\r\n flexShrink: 0,\r\n pt: 1,\r\n pl: \"10px\",\r\n }}\r\n >\r\n <IconButton onClick={() => props.setActivePanel('colorAdjustment')}>\r\n <CardMedia\r\n component=\"img\"\r\n image={props.activePanel === 'colorAdjustment' ? \"/v1/svg/color-adjustment-active.svg\" : \"/v1/svg/color-adjustment-inactive.svg\"}\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n </IconButton>\r\n {/* <IconButton onClick={() => props.setActivePanel('aspectRatio')}>\r\n <CardMedia\r\n component=\"img\"\r\n image={props.activePanel === 'aspectRatio' ? \"/v1/svg/crop-editor-active.svg\" : \"/v1/svg/crop-editor-inactive.svg\"}\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n </IconButton> */}\r\n <IconButton onClick={() => props.setActivePanel('preset')}>\r\n <CardMedia\r\n component=\"img\"\r\n image={props.activePanel === 'preset' ? \"/v1/svg/watermark-editor-active.svg\" : \"/v1/svg/watermark-editor-inactive.svg\"}\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </Paper>\r\n </Stack>\r\n </Slide>\r\n </>\r\n );\r\n}","import React from \"react\";\r\nimport { Button, Stack, IconButton, CardMedia, MenuItem, ListItemText, Menu, ListItemIcon, Paper, Slide } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from \"../../themes/colors\";\r\n\r\ninterface Props {\r\n activePanel: string;\r\n isPanelOpen: boolean;\r\n anchorElZoom: null | HTMLElement;\r\n children: React.ReactNode;\r\n footer: React.ReactNode;\r\n setActivePanel: (accordion: string) => void;\r\n onScale: (event: React.MouseEvent<HTMLElement>) => void;\r\n onBeforeAfter: () => void;\r\n onZoomMenuClose: () => void;\r\n onZoomAction: (zoomLevel: string) => void;\r\n}\r\n\r\nexport default function HImageEditorBulkDekstop(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n const isZoomMenuOpen = Boolean(props.anchorElZoom);\r\n\r\n return (\r\n <>\r\n <Slide direction=\"left\" in={props.isPanelOpen} mountOnEnter unmountOnExit>\r\n <Paper\r\n elevation={3}\r\n sx={{\r\n position: 'inherit',\r\n right: '40px',\r\n top: '55px',\r\n width: '320px',\r\n height: 'calc(100vh - 70px)',\r\n // pb: '10px',\r\n zIndex: 1200,\r\n backgroundColor: '#000000',\r\n overflow: 'hidden',\r\n // pl: \"20px\"\r\n }}\r\n >\r\n <Stack direction=\"row\" sx={{ height: '100%', pl: \"0px\" }}>\r\n <Stack direction=\"column\" sx={{ width: 'calc(100% - 60px)', height: '95%' }}>\r\n <Stack sx={{ flexGrow: 1, overflowY: 'auto', pl:'0px', pr: '16px', msOverflowStyle: 'none', scrollbarWidth: 'none', '&::-webkit-scrollbar': { display: 'none' } }}>\r\n {props.children}\r\n </Stack>\r\n <Stack sx={{\r\n flexShrink: 0,\r\n p: '0px 12px',\r\n }}>\r\n {props.footer}\r\n </Stack>\r\n </Stack>\r\n <Stack\r\n justifyContent=\"flex-start\"\r\n spacing={\"15px\"}\r\n sx={{\r\n width: '10px',\r\n flexShrink: 0,\r\n pt: 1,\r\n pl: \"10px\",\r\n }}\r\n >\r\n <IconButton onClick={() => props.setActivePanel('colorAdjustment')}>\r\n <CardMedia\r\n component=\"img\"\r\n image={props.activePanel === 'colorAdjustment' ? \"/v1/svg/color-adjustment-active.svg\" : \"/v1/svg/color-adjustment-inactive.svg\"}\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n </IconButton>\r\n {/* <IconButton onClick={() => props.setActivePanel('aspectRatio')}>\r\n <CardMedia\r\n component=\"img\"\r\n image={props.activePanel === 'aspectRatio' ? \"/v1/svg/crop-editor-active.svg\" : \"/v1/svg/crop-editor-inactive.svg\"}\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n </IconButton> */}\r\n <IconButton onClick={() => props.setActivePanel('preset')}>\r\n <CardMedia\r\n component=\"img\"\r\n image={props.activePanel === 'preset' ? \"/v1/svg/watermark-editor-active.svg\" : \"/v1/svg/watermark-editor-inactive.svg\"}\r\n sx={{ width: \"20px\", height: \"20px\" }}\r\n />\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </Paper>\r\n </Slide>\r\n </>\r\n );\r\n}","import React from \"react\";\r\nimport { BottomNavigation, BottomNavigationAction, Box, CardMedia, Paper, Stack, SelectChangeEvent } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\nimport HBulkColorAdjustmentMobile from \"./HBulkColorAdjustmentMobile\";\r\nimport HBulkPresetMobile from \"./HBulkPresetMobile\";\r\n\r\ntype Preset = {\r\n id: string;\r\n name: string;\r\n};\r\n\r\ninterface Props {\r\n // EachPanel\r\n presets: Preset[];\r\n activePanel: string;\r\n activeSubPanel: string;\r\n setActivePanel: (tab: string) => void;\r\n setActiveSubPanel: (subTab: string) => void;\r\n\r\n // Draging effect mobile\r\n panelRef: React.RefObject<HTMLDivElement>;\r\n contentRef: React.RefObject<HTMLDivElement | null>;\r\n panelHeight: number;\r\n handleDragStart: (e: React.MouseEvent | React.TouchEvent) => void;\r\n onContentHeightChange: (height: number) => void;\r\n\r\n // Color Adjustments\r\n // Adjustments Colors\r\n onTempDecreaseMax: () => void;\r\n onTempDecrease: () => void;\r\n onTempIncrease: () => void;\r\n onTempIncreaseMax: () => void;\r\n onTintDecreaseMax: () => void;\r\n onTintDecrease: () => void;\r\n onTintIncrease: () => void;\r\n onTintIncreaseMax: () => void;\r\n onVibranceDecreaseMax: () => void;\r\n onVibranceDecrease: () => void;\r\n onVibranceIncrease: () => void;\r\n onVibranceIncreaseMax: () => void;\r\n onSaturationDecreaseMax: () => void;\r\n onSaturationDecrease: () => void;\r\n onSaturationIncrease: () => void;\r\n onSaturationIncreaseMax: () => void;\r\n\r\n // Adjustments Light\r\n onExposureDecreaseMax: () => void;\r\n onExposureDecrease: () => void;\r\n onExposureIncrease: () => void;\r\n onExposureIncreaseMax: () => void;\r\n onContrastDecreaseMax: () => void;\r\n onContrastDecrease: () => void;\r\n onContrastIncrease: () => void;\r\n onContrastIncreaseMax: () => void;\r\n onHighlightsDecreaseMax: () => void;\r\n onHighlightsDecrease: () => void;\r\n onHighlightsIncrease: () => void;\r\n onHighlightsIncreaseMax: () => void;\r\n onShadowsDecreaseMax: () => void;\r\n onShadowsDecrease: () => void;\r\n onShadowsIncrease: () => void;\r\n onShadowsIncreaseMax: () => void;\r\n onWhitesDecreaseMax: () => void;\r\n onWhitesDecrease: () => void;\r\n onWhitesIncrease: () => void;\r\n onWhitesIncreaseMax: () => void;\r\n onBlacksDecreaseMax: () => void;\r\n onBlacksDecrease: () => void;\r\n onBlacksIncrease: () => void;\r\n onBlacksIncreaseMax: () => void;\r\n\r\n // Adjustments Details\r\n onClarityDecreaseMax: () => void;\r\n onClarityDecrease: () => void;\r\n onClarityIncrease: () => void;\r\n onClarityIncreaseMax: () => void;\r\n onSharpnessDecreaseMax: () => void;\r\n onSharpnessDecrease: () => void;\r\n onSharpnessIncrease: () => void;\r\n onSharpnessIncreaseMax: () => void;\r\n\r\n // Preset Mobile (For now)\r\n selectedPresetBulk: string;\r\n onSelectPresetBulk: (event: SelectChangeEvent<string>) => void;\r\n onPresetMenuClickBulk: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;\r\n onOpenPresetModalBulk: () => void;\r\n}\r\n\r\n// Data structure for the sub-navigation tabs\r\nconst subTabs: { [key: string]: { value: string; label: string, inactiveIcon?: string, activeIcon?: string }[] } = {\r\n colorAdjustment: [\r\n { value: \"color\", label: \"Color\", inactiveIcon: \"/v1/svg/white-balance-inactive-mobile.svg\", activeIcon: \"/v1/svg/white-balance-active-mobile.svg\" },\r\n { value: \"light\", label: \"Light\", inactiveIcon: \"/v1/svg/light-inactive-mobile.svg\", activeIcon: \"/v1/svg/light-active-mobile.svg\" },\r\n // { value: \"details\", label: \"Details\", inactiveIcon: \"/v1/svg/details-inactive-mobile.svg\", activeIcon: \"/v1/svg/details-active-mobile.svg\"},\r\n ],\r\n aspectRatio: [\r\n { value: \"portrait\", label: \"Portrait\" },\r\n { value: \"square\", label: \"Square\" },\r\n { value: \"wide\", label: \"Wide\" },\r\n ],\r\n preset: [\r\n { value: \"Preset\", label: \"Preset\", inactiveIcon: \"/v1/svg/preset-inactive-mobile.svg\", activeIcon: \"/v1/svg/preset-active-mobile.svg\" },\r\n ],\r\n};\r\n\r\nexport default function HImageEditorBulkMobile(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const handleChange = (event: React.SyntheticEvent, newValue: string) => {\r\n props.setActivePanel(newValue);\r\n };\r\n\r\n const currentSubTabs = subTabs[props.activePanel];\r\n\r\n\r\n return (\r\n <Paper \r\n elevation={0}\r\n sx={{ \r\n position: 'fixed', \r\n bottom: 0, \r\n left: 0, \r\n right: 0, \r\n zIndex: 1300,\r\n backgroundColor: 'transparent',\r\n }}\r\n >\r\n <Stack direction=\"column\">\r\n {props.activeSubPanel && (\r\n <Paper\r\n ref={props.panelRef}\r\n elevation={3}\r\n className=\"draggable-panel MuiPaper-transition\"\r\n sx={{\r\n height: `${props.panelHeight}px`,\r\n maxHeight: '60vh',\r\n backgroundColor: 'rgba(40, 40, 40, 0.85)',\r\n overflow: 'hidden',\r\n borderRadius: \"0px\",\r\n '&.MuiPaper-transition': {\r\n transition: 'height 0.5s ease-in-out',\r\n },\r\n }}\r\n >\r\n <Box\r\n onMouseDown={props.handleDragStart}\r\n onTouchStart={props.handleDragStart}\r\n sx={{\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n pt: '5px',\r\n pb: '12px',\r\n cursor: 'ns-resize',\r\n touchAction: 'none',\r\n }}\r\n >\r\n <Box sx={{ width: 40, height: 5, borderRadius: '2.5px', backgroundColor: 'rgba(255, 255, 255, 0.5)' }} />\r\n </Box>\r\n <Box\r\n ref={props.contentRef} \r\n sx={{\r\n paddingX: \"8px\",\r\n paddingBottom: 3,\r\n height: 'calc(100% - 30px)',\r\n overflowY: 'auto',\r\n scrollbarWidth: 'none',\r\n '&::-webkit-scrollbar': { display: 'none' },\r\n }}\r\n >\r\n {props.activePanel === 'colorAdjustment' && <HBulkColorAdjustmentMobile {...props} />}\r\n {props.activePanel === 'preset' && <HBulkPresetMobile {...props} />}\r\n </Box>\r\n </Paper>\r\n )}\r\n {currentSubTabs && (\r\n <Paper \r\n sx={{\r\n backgroundColor: colors.onBackground,\r\n paddingTop: \"10px\",\r\n pb: \"0px\",\r\n mb: \"0px\",\r\n px: \"44px\",\r\n borderRadius: \"0px\",\r\n }} \r\n elevation={3}\r\n >\r\n <BottomNavigation showLabels sx={{ backgroundColor: colors.onBackground, gap: '10px' }}>\r\n {currentSubTabs.map((tab) => {\r\n const isActive = props.activeSubPanel === tab.value;\r\n const iconSrc = isActive ? tab.activeIcon : tab.inactiveIcon;\r\n return (\r\n <BottomNavigationAction\r\n key={tab.value}\r\n label={tab.label}\r\n value={tab.value}\r\n onClick={() => props.setActiveSubPanel(isActive ? '' : tab.value)}\r\n icon={iconSrc && <CardMedia component=\"img\" image={iconSrc} sx={{ width: \"20px\", height: \"20px\", mb: \"5px\" }} />}\r\n sx={{\r\n color: isActive ? colors.surface : colors.onSurfaceVariant1,\r\n minWidth: 'auto',\r\n p: 0,\r\n '& .MuiBottomNavigationAction-label': {\r\n ...typography.labelSmall,\r\n color: isActive ? colors.surface : colors.onSurfaceVariant1,\r\n }\r\n }}\r\n />\r\n );\r\n })}\r\n </BottomNavigation>\r\n </Paper>\r\n )}\r\n <Paper sx={{ backgroundColor: colors.onBackground, borderRadius: \"0px\", pb: \"0px\", mb: \"0px\" }} elevation={3}>\r\n <Stack direction=\"row\" justifyContent=\"center\" alignItems=\"center\" sx={{ pt: \"0px\", mb: \"0px\", mr: \"0px\", ml: \"0px\" }}>\r\n <BottomNavigation value={props.activePanel} onChange={handleChange} sx={{ backgroundColor: colors.onBackground }}>\r\n <BottomNavigationAction\r\n value=\"colorAdjustment\"\r\n sx={{ px: '12px', py: '0px', minWidth: 'auto' }}\r\n icon={<CardMedia component=\"img\" image={props.activePanel === 'colorAdjustment' ? \"/v1/svg/color-adjustment-active-mobile.svg\" : \"/v1/svg/color-adjustment-inactive-mobile.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />}\r\n />\r\n {/* <BottomNavigationAction\r\n value=\"aspectRatio\"\r\n sx={{ px: '12px', py: '0px', minWidth: 'auto' }}\r\n icon={<CardMedia component=\"img\" image={props.activePanel === 'aspectRatio' ? \"/v1/svg/aspect-ratio-inactive-mobile.svg\" : \"/v1/svg/aspect-ratio-inactive-mobile.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />}\r\n /> */}\r\n <BottomNavigationAction\r\n value=\"preset\"\r\n sx={{ px: '12px', py: '0px', minWidth: 'auto' }}\r\n icon={<CardMedia component=\"img\" image={props.activePanel === 'preset' ? \"/v1/svg/preset-and-watermark-active-mobile.svg\" : \"/v1/svg/preset-and-watermark-inactive-mobile.svg\"} sx={{ width: \"20px\", height: \"20px\" }} />}\r\n />\r\n </BottomNavigation>\r\n </Stack>\r\n </Paper>\r\n\r\n </Stack>\r\n </Paper>\r\n );\r\n}","import React from \"react\";\r\nimport { Box, Stack, Slider, Typography, TextField, CardMedia, IconButton } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onTempDecreaseMax: () => void;\r\n onTempDecrease: () => void;\r\n onTempIncrease: () => void;\r\n onTempIncreaseMax: () => void;\r\n onTintDecreaseMax: () => void;\r\n onTintDecrease: () => void;\r\n onTintIncrease: () => void;\r\n onTintIncreaseMax: () => void;\r\n onVibranceDecreaseMax: () => void;\r\n onVibranceDecrease: () => void;\r\n onVibranceIncrease: () => void;\r\n onVibranceIncreaseMax: () => void;\r\n onSaturationDecreaseMax: () => void;\r\n onSaturationDecrease: () => void;\r\n onSaturationIncrease: () => void;\r\n onSaturationIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkColorMobile(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n return(\r\n <>\r\n <Stack spacing={0} direction=\"column\" sx={{ width: '100%', pl: \"10px\", m: \"0px\" }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Temperature</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onTempDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onTempDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onTempIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onTempIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Tint</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onTintDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onTintDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onTintIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onTintIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Vibrance</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onVibranceDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onVibranceDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onVibranceIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onVibranceIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Saturation</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onSaturationDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSaturationDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSaturationIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSaturationIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField, CardMedia, IconButton} from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onExposureDecreaseMax: () => void;\r\n onExposureDecrease: () => void;\r\n onExposureIncrease: () => void;\r\n onExposureIncreaseMax: () => void;\r\n onContrastDecreaseMax: () => void;\r\n onContrastDecrease: () => void;\r\n onContrastIncrease: () => void;\r\n onContrastIncreaseMax: () => void;\r\n onHighlightsDecreaseMax: () => void;\r\n onHighlightsDecrease: () => void;\r\n onHighlightsIncrease: () => void;\r\n onHighlightsIncreaseMax: () => void;\r\n onShadowsDecreaseMax: () => void;\r\n onShadowsDecrease: () => void;\r\n onShadowsIncrease: () => void;\r\n onShadowsIncreaseMax: () => void;\r\n onWhitesDecreaseMax: () => void;\r\n onWhitesDecrease: () => void;\r\n onWhitesIncrease: () => void;\r\n onWhitesIncreaseMax: () => void;\r\n onBlacksDecreaseMax: () => void;\r\n onBlacksDecrease: () => void;\r\n onBlacksIncrease: () => void;\r\n onBlacksIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkLightMobile (props: Props){\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const formatValue = (value: number) => {\r\n if (value > 0) return `+${value}`;\r\n return value.toString();\r\n };\r\n \r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>, min: number, max: number, onChange: (value: number) => void) => {\r\n const value = event.target.value;\r\n if (value === '+' || value === '-') return;\r\n let numericValue = parseInt(value, 10);\r\n if (isNaN(numericValue)) numericValue = 0;\r\n const clampedValue = Math.max(min, Math.min(max, numericValue));\r\n onChange(clampedValue);\r\n };\r\n\r\n return (\r\n <>\r\n <Stack spacing={0} direction=\"column\" sx={{ width: '100%', pl: \"10px\", m: \"0px\" }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{...typography.bodyMedium, color: colors.surface}}>Exposure</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onExposureDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onExposureDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onExposureIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onExposureIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Contrast</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onContrastDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onContrastDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onContrastIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onContrastIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{...typography.bodyMedium, color: colors.surface}}>Highlights</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onHighlightsDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onHighlightsDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onHighlightsIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onHighlightsIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{...typography.bodyMedium, color: colors.surface}}>Shadows</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onShadowsDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onShadowsDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onShadowsIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onShadowsIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{...typography.bodyMedium, color: colors.surface}}>Whites</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onWhitesDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onWhitesDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onWhitesIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onWhitesIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{...typography.bodyMedium, color: colors.surface}}>Blacks</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onBlacksDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onBlacksDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onBlacksIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onBlacksIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n\r\n}","import React from \"react\";\r\nimport { Stack, Slider, Typography, TextField, CardMedia, IconButton } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onClarityDecreaseMax: () => void;\r\n onClarityDecrease: () => void;\r\n onClarityIncrease: () => void;\r\n onClarityIncreaseMax: () => void;\r\n onSharpnessDecreaseMax: () => void;\r\n onSharpnessDecrease: () => void;\r\n onSharpnessIncrease: () => void;\r\n onSharpnessIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkDetailsMobile(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n return (\r\n <>\r\n <Stack spacing={0} direction=\"column\" sx={{ width: '100%', pl: \"10px\", m: \"0px\" }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Clarity</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"16px\" }}>\r\n <IconButton onClick={props.onClarityDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onClarityDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onClarityIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onClarityIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ mb: \"6px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Sharpness</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onSharpnessDecreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSharpnessDecrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ width: \"20px\", height: \"20px\", mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSharpnessIncrease}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSharpnessIncreaseMax}\r\n sx={{\r\n width: \"76px\",\r\n height: \"28px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ width: \"20px\", height: \"20px\", ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport HBulkColorMobile from \"./HBulkColorMobile\";\r\nimport HBulkLightMobile from \"./HBulkLightMobile\";\r\nimport HBulkDetailsMobile from \"./HBulkDetailsMobile\";\r\n\r\ninterface Props {\r\n activeSubPanel: string;\r\n\r\n // Adjustments Colors\r\n onTempDecreaseMax: () => void;\r\n onTempDecrease: () => void;\r\n onTempIncrease: () => void;\r\n onTempIncreaseMax: () => void;\r\n onTintDecreaseMax: () => void;\r\n onTintDecrease: () => void;\r\n onTintIncrease: () => void;\r\n onTintIncreaseMax: () => void;\r\n onVibranceDecreaseMax: () => void;\r\n onVibranceDecrease: () => void;\r\n onVibranceIncrease: () => void;\r\n onVibranceIncreaseMax: () => void;\r\n onSaturationDecreaseMax: () => void;\r\n onSaturationDecrease: () => void;\r\n onSaturationIncrease: () => void;\r\n onSaturationIncreaseMax: () => void;\r\n \r\n // Adjustments Light\r\n onExposureDecreaseMax: () => void;\r\n onExposureDecrease: () => void;\r\n onExposureIncrease: () => void;\r\n onExposureIncreaseMax: () => void;\r\n onContrastDecreaseMax: () => void;\r\n onContrastDecrease: () => void;\r\n onContrastIncrease: () => void;\r\n onContrastIncreaseMax: () => void;\r\n onHighlightsDecreaseMax: () => void;\r\n onHighlightsDecrease: () => void;\r\n onHighlightsIncrease: () => void;\r\n onHighlightsIncreaseMax: () => void;\r\n onShadowsDecreaseMax: () => void;\r\n onShadowsDecrease: () => void;\r\n onShadowsIncrease: () => void;\r\n onShadowsIncreaseMax: () => void;\r\n onWhitesDecreaseMax: () => void;\r\n onWhitesDecrease: () => void;\r\n onWhitesIncrease: () => void;\r\n onWhitesIncreaseMax: () => void;\r\n onBlacksDecreaseMax: () => void;\r\n onBlacksDecrease: () => void;\r\n onBlacksIncrease: () => void;\r\n onBlacksIncreaseMax: () => void;\r\n\r\n // Adjustments Details\r\n onClarityDecreaseMax: () => void;\r\n onClarityDecrease: () => void;\r\n onClarityIncrease: () => void;\r\n onClarityIncreaseMax: () => void;\r\n onSharpnessDecreaseMax: () => void;\r\n onSharpnessDecrease: () => void;\r\n onSharpnessIncrease: () => void;\r\n onSharpnessIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkColorAdjustmentMobile(props: Props) {\r\n switch (props.activeSubPanel) {\r\n case 'color':\r\n return (\r\n <HBulkColorMobile\r\n onTempDecreaseMax={props.onTempDecreaseMax}\r\n onTempDecrease={props.onTempDecrease}\r\n onTempIncrease={props.onTempIncrease}\r\n onTempIncreaseMax={props.onTempIncreaseMax}\r\n onTintDecreaseMax={props.onTintDecreaseMax}\r\n onTintDecrease={props.onTintDecrease}\r\n onTintIncrease={props.onTintIncrease}\r\n onTintIncreaseMax={props.onTintIncreaseMax}\r\n onVibranceDecreaseMax={props.onVibranceDecreaseMax}\r\n onVibranceDecrease={props.onVibranceDecrease}\r\n onVibranceIncrease={props.onVibranceIncrease}\r\n onVibranceIncreaseMax={props.onVibranceIncreaseMax}\r\n onSaturationDecreaseMax={props.onSaturationDecreaseMax}\r\n onSaturationDecrease={props.onSaturationDecrease}\r\n onSaturationIncrease={props.onSaturationIncrease}\r\n onSaturationIncreaseMax={props.onSaturationIncreaseMax}\r\n />\r\n );\r\n case 'light':\r\n return (\r\n <HBulkLightMobile\r\n onExposureDecreaseMax= {props.onExposureDecreaseMax}\r\n onExposureDecrease= {props.onExposureDecrease}\r\n onExposureIncrease= {props.onExposureIncrease}\r\n onExposureIncreaseMax= {props.onExposureIncreaseMax}\r\n onContrastDecreaseMax= {props.onContrastDecreaseMax}\r\n onContrastDecrease= {props.onContrastDecrease}\r\n onContrastIncrease= {props.onContrastIncrease}\r\n onContrastIncreaseMax= {props.onContrastIncreaseMax}\r\n onHighlightsDecreaseMax= {props.onHighlightsDecreaseMax}\r\n onHighlightsDecrease= {props.onHighlightsDecrease}\r\n onHighlightsIncrease= {props.onHighlightsIncrease}\r\n onHighlightsIncreaseMax= {props.onHighlightsIncreaseMax}\r\n onShadowsDecreaseMax= {props.onShadowsDecreaseMax}\r\n onShadowsDecrease= {props.onShadowsDecrease}\r\n onShadowsIncrease= {props.onShadowsIncrease}\r\n onShadowsIncreaseMax= {props.onShadowsIncreaseMax}\r\n onWhitesDecreaseMax= {props.onWhitesDecreaseMax}\r\n onWhitesDecrease= {props.onWhitesDecrease}\r\n onWhitesIncrease= {props.onWhitesIncrease}\r\n onWhitesIncreaseMax= {props.onWhitesIncreaseMax}\r\n onBlacksDecreaseMax= {props.onBlacksDecreaseMax}\r\n onBlacksDecrease= {props.onBlacksDecrease}\r\n onBlacksIncrease= {props.onBlacksIncrease}\r\n onBlacksIncreaseMax= {props.onBlacksIncreaseMax}\r\n />\r\n );\r\n case 'details':\r\n return (\r\n <HBulkDetailsMobile\r\n onClarityDecreaseMax={props.onClarityDecreaseMax}\r\n onClarityDecrease={props.onClarityDecrease}\r\n onClarityIncrease={props.onClarityIncrease}\r\n onClarityIncreaseMax={props.onClarityIncreaseMax}\r\n onSharpnessDecreaseMax={props.onSharpnessDecreaseMax}\r\n onSharpnessDecrease={props.onSharpnessDecrease}\r\n onSharpnessIncrease={props.onSharpnessIncrease}\r\n onSharpnessIncreaseMax={props.onSharpnessIncreaseMax}\r\n />\r\n );\r\n default:\r\n return null;\r\n }\r\n}","import React from \"react\";\r\nimport {Typography, Stack, IconButton, CardMedia, Button, MenuItem, Box, FormControl, Select, SelectChangeEvent} from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ntype Preset = {\r\n id: string;\r\n name: string;\r\n};\r\n\r\ninterface Props {\r\n presets: Preset[]; // Prop to receive presets from the hook\r\n selectedPresetBulk: string;\r\n onOpenPresetModalBulk: () => void;\r\n onSelectPresetBulk: (event: SelectChangeEvent<string>) => void;\r\n onPresetMenuClickBulk: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;\r\n}\r\n\r\n// Static `presets` array has been removed.\r\n\r\nexport default function HBulkPresetMobile (props: Props){\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const CustomSelectIcon = (iconProps: { className?: string }) => {\r\n const isExpanded = iconProps.className?.includes('MuiSelect-iconOpen');\r\n return (\r\n <CardMedia\r\n component=\"img\"\r\n image={isExpanded ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\", right: '14px', position: 'absolute', pointerEvents: 'none' }}\r\n />\r\n );\r\n };\r\n\r\n return(\r\n <>\r\n <Stack direction=\"column\" sx={{ px: \"0px\", mx: \"16px\", mt: \"6px\", mb: \"0px\" }}>\r\n <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Preset</Typography>\r\n <FormControl fullWidth>\r\n <Select\r\n fullWidth\r\n value={props.selectedPresetBulk}\r\n onChange={props.onSelectPresetBulk}\r\n IconComponent={CustomSelectIcon}\r\n renderValue={(selectedId) => {\r\n // Uses props.presets to find the name\r\n const selectedPresetBulkObject = props.presets.find(p => p.id === selectedId);\r\n if (!selectedPresetBulkObject) {\r\n return <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>Select</Typography>;\r\n }\r\n return <Typography sx={{ ...typography.bodyMedium, color: colors.surface }}>{selectedPresetBulkObject.name}</Typography>;\r\n }}\r\n MenuProps={{\r\n anchorOrigin: { vertical: 'top', horizontal: 'left' },\r\n transformOrigin: { vertical: 'bottom', horizontal: 'left' },\r\n sx: { marginTop: '-10px' },\r\n slotProps: { paper: { sx: { backgroundColor: colors.onBackground, color: colors.surface, border: `1px solid ${colors.onSurfaceVariant1}`, borderRadius: '4px', width: '328px' } } }\r\n }}\r\n sx={{ border: `1px solid ${colors.outlineVariant}`, height: '44px', width: '328px', mt: '6px' }}\r\n >\r\n {/* Maps over props.presets */}\r\n {props.presets.map((preset) => (\r\n <MenuItem\r\n key={preset.id}\r\n value={preset.id}\r\n sx={{ padding: '8px 10px', minHeight: 'auto', mb: '4px' }}\r\n >\r\n <Stack direction=\"row\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <CardMedia\r\n component=\"img\"\r\n image=\"v1/svg/check-ratio-editor.svg\"\r\n sx={{ width: \"20px\", height: \"20px\", mr: '12px', px: '0px', visibility: props.selectedPresetBulk === preset.id ? 'visible' : 'hidden' }}\r\n />\r\n <Typography sx={{ width: '24px', textWrap: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'block', color: colors.surface, pr: \"82px\", pl: \"0px\", mr: \"165px\", justifyContent: 'flex-start', ...typography.bodyMedium }}>\r\n {preset.name}\r\n </Typography>\r\n <IconButton\r\n aria-label={`Options for ${preset.name}`}\r\n onClick={(event) => props.onPresetMenuClickBulk(event, preset.id)}\r\n sx={{ padding: \"0px\", margin: \"0px\", mr: \"0px\" }}\r\n >\r\n <CardMedia component=\"img\" image=\"/v1/svg/dots-editor.svg\" alt=\"Options\" sx={{ width: '20px', height: '20px' }}/>\r\n </IconButton>\r\n </Stack>\r\n </MenuItem>\r\n ))}\r\n <Box sx={{ px: '16px', my: '8px'}}>\r\n <Button\r\n fullWidth\r\n variant=\"outlined\"\r\n sx={{ ...typography.labelMedium, height: '40px', pt: '5px', color: colors.onBackground, backgroundColor: colors.surface, borderRadius: '100px', borderColor: colors.surface, textTransform: 'none', '&:hover': { backgroundColor: '#e0e0e0', borderColor: colors.surface } }}\r\n onClick={props.onOpenPresetModalBulk}\r\n >\r\n Create Preset\r\n </Button>\r\n </Box>\r\n </Select>\r\n </FormControl>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Accordion, AccordionDetails , AccordionSummary, CardMedia, Stack, Typography } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from \"../../themes/colors\";\r\nimport HBulkAccordionColorAdjustmentColors from \"./HBulkAccordionColorAdjustmentColors\";\r\nimport HBulkAccordionColorAdjustmentLight from \"./HBulkAccordionColorAdjustmentLight\";\r\nimport HBulkAccordionColorAdjustmentDetails from \"./HBulkAccordionColorAdjustmentDetails\";\r\n\r\ninterface Props {\r\n // Getters get values\r\n // Adjustments Colors\r\n onTempDecreaseMax: () => void;\r\n onTempDecrease: () => void;\r\n onTempIncrease: () => void;\r\n onTempIncreaseMax: () => void;\r\n onTintDecreaseMax: () => void;\r\n onTintDecrease: () => void;\r\n onTintIncrease: () => void;\r\n onTintIncreaseMax: () => void;\r\n onVibranceDecreaseMax: () => void;\r\n onVibranceDecrease: () => void;\r\n onVibranceIncrease: () => void;\r\n onVibranceIncreaseMax: () => void;\r\n onSaturationDecreaseMax: () => void;\r\n onSaturationDecrease: () => void;\r\n onSaturationIncrease: () => void;\r\n onSaturationIncreaseMax: () => void;\r\n\r\n // Adjustments Light\r\n onExposureDecreaseMax: () => void;\r\n onExposureDecrease: () => void;\r\n onExposureIncrease: () => void;\r\n onExposureIncreaseMax: () => void;\r\n onContrastDecreaseMax: () => void;\r\n onContrastDecrease: () => void;\r\n onContrastIncrease: () => void;\r\n onContrastIncreaseMax: () => void;\r\n onHighlightsDecreaseMax: () => void;\r\n onHighlightsDecrease: () => void;\r\n onHighlightsIncrease: () => void;\r\n onHighlightsIncreaseMax: () => void;\r\n onShadowsDecreaseMax: () => void;\r\n onShadowsDecrease: () => void;\r\n onShadowsIncrease: () => void;\r\n onShadowsIncreaseMax: () => void;\r\n onWhitesDecreaseMax: () => void;\r\n onWhitesDecrease: () => void;\r\n onWhitesIncrease: () => void;\r\n onWhitesIncreaseMax: () => void;\r\n onBlacksDecreaseMax: () => void;\r\n onBlacksDecrease: () => void;\r\n onBlacksIncrease: () => void;\r\n onBlacksIncreaseMax: () => void;\r\n\r\n // Adjustments Details\r\n onClarityDecreaseMax: () => void;\r\n onClarityDecrease: () => void;\r\n onClarityIncrease: () => void;\r\n onClarityIncreaseMax: () => void;\r\n onSharpnessDecreaseMax: () => void;\r\n onSharpnessDecrease: () => void;\r\n onSharpnessIncrease: () => void;\r\n onSharpnessIncreaseMax: () => void;\r\n\r\n expandedPanels: string[];\r\n onPanelChange: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;\r\n}\r\n\r\nexport default function HBulkAccordionColorAdjustment(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n const accordionStyle = {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n '& .MuiAccordionSummary-root': {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n },\r\n '& .MuiAccordionDetails-root': {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n },\r\n '& .MuiTypography-root': {\r\n color: colors.surface,\r\n },\r\n '& .MuiSvgIcon-root': {\r\n color: colors.surface,\r\n }\r\n };\r\n\r\n const isPanelExpanded = (panelName: string) => props.expandedPanels.includes(panelName);\r\n\r\n return (\r\n <>\r\n <Stack direction=\"column\" sx={{ accordionStyle }}>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('whiteBalance')}\r\n onChange={props.onPanelChange('whiteBalance')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%'}}>\r\n <Typography sx={{ ...typography.titleMedium }}>Color</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('whiteBalance') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <HBulkAccordionColorAdjustmentColors\r\n onTempDecreaseMax={props.onTempDecreaseMax}\r\n onTempDecrease={props.onTempDecrease}\r\n onTempIncrease={props.onTempIncrease}\r\n onTempIncreaseMax={props.onTempIncreaseMax}\r\n onTintDecreaseMax={props.onTintDecreaseMax}\r\n onTintDecrease={props.onTintDecrease}\r\n onTintIncrease={props.onTintIncrease}\r\n onTintIncreaseMax={props.onTintIncreaseMax}\r\n onVibranceDecreaseMax={props.onVibranceDecreaseMax}\r\n onVibranceDecrease={props.onVibranceDecrease}\r\n onVibranceIncrease={props.onVibranceIncrease}\r\n onVibranceIncreaseMax={props.onVibranceIncreaseMax}\r\n onSaturationDecreaseMax={props.onSaturationDecreaseMax}\r\n onSaturationDecrease={props.onSaturationDecrease}\r\n onSaturationIncrease={props.onSaturationIncrease}\r\n onSaturationIncreaseMax={props.onSaturationIncreaseMax}\r\n />\r\n </AccordionDetails>\r\n </Accordion>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('light')}\r\n onChange={props.onPanelChange('light')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium }}>Light</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('light') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <HBulkAccordionColorAdjustmentLight\r\n onExposureDecreaseMax= {props.onExposureDecreaseMax}\r\n onExposureDecrease= {props.onExposureDecrease}\r\n onExposureIncrease= {props.onExposureIncrease}\r\n onExposureIncreaseMax= {props.onExposureIncreaseMax}\r\n onContrastDecreaseMax= {props.onContrastDecreaseMax}\r\n onContrastDecrease= {props.onContrastDecrease}\r\n onContrastIncrease= {props.onContrastIncrease}\r\n onContrastIncreaseMax= {props.onContrastIncreaseMax}\r\n onHighlightsDecreaseMax= {props.onHighlightsDecreaseMax}\r\n onHighlightsDecrease= {props.onHighlightsDecrease}\r\n onHighlightsIncrease= {props.onHighlightsIncrease}\r\n onHighlightsIncreaseMax= {props.onHighlightsIncreaseMax}\r\n onShadowsDecreaseMax= {props.onShadowsDecreaseMax}\r\n onShadowsDecrease= {props.onShadowsDecrease}\r\n onShadowsIncrease= {props.onShadowsIncrease}\r\n onShadowsIncreaseMax= {props.onShadowsIncreaseMax}\r\n onWhitesDecreaseMax= {props.onWhitesDecreaseMax}\r\n onWhitesDecrease= {props.onWhitesDecrease}\r\n onWhitesIncrease= {props.onWhitesIncrease}\r\n onWhitesIncreaseMax= {props.onWhitesIncreaseMax}\r\n onBlacksDecreaseMax= {props.onBlacksDecreaseMax}\r\n onBlacksDecrease= {props.onBlacksDecrease}\r\n onBlacksIncrease= {props.onBlacksIncrease}\r\n onBlacksIncreaseMax= {props.onBlacksIncreaseMax}\r\n />\r\n </AccordionDetails>\r\n </Accordion>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('details')}\r\n onChange={props.onPanelChange('details')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium }}>Details</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('details') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <HBulkAccordionColorAdjustmentDetails\r\n onClarityDecreaseMax={props.onClarityDecreaseMax}\r\n onClarityDecrease={props.onClarityDecrease}\r\n onClarityIncrease={props.onClarityIncrease}\r\n onClarityIncreaseMax={props.onClarityIncreaseMax}\r\n onSharpnessDecreaseMax={props.onSharpnessDecreaseMax}\r\n onSharpnessDecrease={props.onSharpnessDecrease}\r\n onSharpnessIncrease={props.onSharpnessIncrease}\r\n onSharpnessIncreaseMax={props.onSharpnessIncreaseMax}\r\n />\r\n </AccordionDetails>\r\n </Accordion>\r\n </Stack>\r\n </>\r\n )\r\n}\r\n","import React from \"react\";\r\nimport { Stack, Typography, IconButton, CardMedia } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onTempDecreaseMax: () => void;\r\n onTempDecrease: () => void;\r\n onTempIncrease: () => void;\r\n onTempIncreaseMax: () => void;\r\n onTintDecreaseMax: () => void;\r\n onTintDecrease: () => void;\r\n onTintIncrease: () => void;\r\n onTintIncreaseMax: () => void;\r\n onVibranceDecreaseMax: () => void;\r\n onVibranceDecrease: () => void;\r\n onVibranceIncrease: () => void;\r\n onVibranceIncreaseMax: () => void;\r\n onSaturationDecreaseMax: () => void;\r\n onSaturationDecrease: () => void;\r\n onSaturationIncrease: () => void;\r\n onSaturationIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkAccordionColorAdjustmentColors(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n \r\n return(\r\n <>\r\n <Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Temperature</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton\r\n onClick={props.onTempDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onTempDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"20px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onTempIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onTempIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Tint</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton \r\n onClick={props.onTintDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onTintDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onTintIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onTintIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Vibrance</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton \r\n onClick={props.onVibranceDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onVibranceDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onVibranceIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onVibranceIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Saturation</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton \r\n onClick={props.onSaturationDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onSaturationDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onSaturationIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton \r\n onClick={props.onSaturationIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"26px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, Typography, IconButton, CardMedia } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onExposureDecreaseMax: () => void;\r\n onExposureDecrease: () => void;\r\n onExposureIncrease: () => void;\r\n onExposureIncreaseMax: () => void;\r\n onContrastDecreaseMax: () => void;\r\n onContrastDecrease: () => void;\r\n onContrastIncrease: () => void;\r\n onContrastIncreaseMax: () => void;\r\n onHighlightsDecreaseMax: () => void;\r\n onHighlightsDecrease: () => void;\r\n onHighlightsIncrease: () => void;\r\n onHighlightsIncreaseMax: () => void;\r\n onShadowsDecreaseMax: () => void;\r\n onShadowsDecrease: () => void;\r\n onShadowsIncrease: () => void;\r\n onShadowsIncreaseMax: () => void;\r\n onWhitesDecreaseMax: () => void;\r\n onWhitesDecrease: () => void;\r\n onWhitesIncrease: () => void;\r\n onWhitesIncreaseMax: () => void;\r\n onBlacksDecreaseMax: () => void;\r\n onBlacksDecrease: () => void;\r\n onBlacksIncrease: () => void;\r\n onBlacksIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkAccordionColorAdjustmentLight(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n \r\n return(\r\n <>\r\n <Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Exposure</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onExposureDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onExposureDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onExposureIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onExposureIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Contrast</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onContrastDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onContrastDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onContrastIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onContrastIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Highlights</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onHighlightsDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onHighlightsDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onHighlightsIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onHighlightsIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }} />\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ py: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Shadows</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onShadowsDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onShadowsDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onShadowsIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onShadowsIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ py: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Whites</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onWhitesDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onWhitesDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onWhitesIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onWhitesIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ py: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Blacks</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onBlacksDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onBlacksDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }} />\r\n </IconButton>\r\n <IconButton onClick={props.onBlacksIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onBlacksIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Stack, Typography, IconButton, CardMedia } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onClarityDecreaseMax: () => void;\r\n onClarityDecrease: () => void;\r\n onClarityIncrease: () => void;\r\n onClarityIncreaseMax: () => void;\r\n onSharpnessDecreaseMax: () => void;\r\n onSharpnessDecrease: () => void;\r\n onSharpnessIncrease: () => void;\r\n onSharpnessIncreaseMax: () => void;\r\n}\r\n\r\nexport default function HBulkAccordionColorAdjustmentDetails(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n \r\n return(\r\n <>\r\n <Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Clarity</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onClarityDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onClarityDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onClarityIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onClarityIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ pb: \"8px\", pt: \"16px\" }}>\r\n <Typography sx={{...typography.bodyMedium}}>Sharpness</Typography>\r\n </Stack>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" sx={{ p: \"0px\", m: \"0px\", pt: \"2px\", pb: \"2px\" }}>\r\n <IconButton onClick={props.onSharpnessDecreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button.svg\" sx={{ mr: \"2px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSharpnessDecrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button.svg\" sx={{ mr: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSharpnessIncrease}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-increment-button-right.svg\" sx={{ ml: \"3px\" }}/>\r\n </IconButton>\r\n <IconButton onClick={props.onSharpnessIncreaseMax}\r\n sx={{\r\n width: \"38.5px\",\r\n height: \"24px\",\r\n py: \"2px\",\r\n mr: \"12px\",\r\n border: \"1px solid white\",\r\n borderRadius: \"100px\",\r\n }}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/bulk-editor-max-button-right.svg\" sx={{ ml: \"2px\" }}/>\r\n </IconButton>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Box, MenuItem, FormControl, Select, Stack, Accordion, AccordionSummary, AccordionDetails, CardMedia, Typography, IconButton, Button, SelectChangeEvent } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from \"../../themes/colors\";\r\n\r\ntype Preset = {\r\n id: string;\r\n name: string;\r\n};\r\n\r\ninterface Props {\r\n presets: Preset[];\r\n selectedPreset: string;\r\n expandedPanels: string[];\r\n presetMenuAnchorEl: null | HTMLElement;\r\n activePresetMenuId: string | null;\r\n isMenuOpen: boolean;\r\n onPanelChange: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;\r\n onSelectPreset: (event: SelectChangeEvent<string>) => void;\r\n onPresetMenuClick: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;\r\n onPresetMenuClose: () => void;\r\n onRemovePreset: () => void;\r\n onRenamePreset: () => void;\r\n onDeletePreset: () => void;\r\n onOpenPresetModal: () => void;\r\n}\r\n\r\n// Static `presets` array has been removed.\r\n\r\nexport default function HBulkPreset(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n const isMenuOpen = Boolean(props.presetMenuAnchorEl);\r\n\r\n const isPanelExpanded = (panelName: string) => props.expandedPanels.includes(panelName);\r\n\r\n const accordionStyle = {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n '& .MuiAccordionSummary-root': { backgroundColor: colors.onBackground, color: colors.surface },\r\n '& .MuiAccordionDetails-root': { backgroundColor: colors.onBackground, color: colors.surface },\r\n '& .MuiTypography-root': { color: colors.surface },\r\n '& .MuiSvgIcon-root': { color: colors.surface }\r\n };\r\n\r\n const CustomSelectIcon = (iconProps: { className?: string }) => {\r\n const isExpanded = iconProps.className?.includes('MuiSelect-iconOpen');\r\n return (\r\n <CardMedia\r\n component=\"img\"\r\n image={isExpanded ? \"/v1/svg/expand-editor.svg\" : \"/v1/svg/expanded-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\", right: '14px', position: 'absolute', pointerEvents: 'none' }}\r\n />\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n <Stack>\r\n <Accordion\r\n sx={accordionStyle}\r\n expanded={isPanelExpanded('preset')}\r\n onChange={props.onPanelChange('preset')}\r\n disableGutters\r\n >\r\n <AccordionSummary sx={{ pr: 0 }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" sx={{ width: '100%' }}>\r\n <Typography sx={{ ...typography.titleMedium, color: colors.surface }}>Preset</Typography>\r\n <CardMedia\r\n component=\"img\"\r\n image={isPanelExpanded('preset') ? \"/v1/svg/expanded-editor.svg\" : \"/v1/svg/expand-editor.svg\"}\r\n sx={{ width: \"11.67px\", height: \"5.83px\" }}\r\n />\r\n </Stack>\r\n </AccordionSummary>\r\n <AccordionDetails sx={{ pr: \"4px\" }}>\r\n <FormControl fullWidth>\r\n <Select\r\n fullWidth\r\n value={props.selectedPreset}\r\n onChange={props.onSelectPreset}\r\n IconComponent={CustomSelectIcon}\r\n renderValue={(selectedId) => {\r\n // Handle empty selection case\r\n if (!selectedId) {\r\n return <Typography sx={{ ...typography.bodyMedium, color: colors.surface, opacity: 0.7 }}>Select Preset</Typography>;\r\n }\r\n \r\n // Uses props.presets to find the name\r\n const selectedPresetObject = props.presets.find(p => p.id === selectedId);\r\n if (!selectedPresetObject) {\r\n return <Typography sx={{ ...typography.bodyMedium, color: colors.surface, opacity: 0.7 }}>Select Preset</Typography>;\r\n }\r\n return <Typography sx={{ ...typography.bodyMedium }}>{selectedPresetObject.name}</Typography>;\r\n }}\r\n MenuProps={{\r\n slotProps: { paper: { sx: { backgroundColor: colors.onBackground, color: colors.surface, border: `1px solid ${colors.onSurfaceVariant1}`, mt: '20px', width: '178px', boxShadow: 'none' }}}\r\n }}\r\n sx={{ border: `1px solid ${colors.outlineVariant}`, height: '44px', width: '215px', boxShadow: 'none' }}\r\n >\r\n {/* Add empty option for no preset selected */}\r\n <MenuItem value=\"\" sx={{ borderRadius: '4px', py: '4px', my: '0px', px: '0px', mx: '0px'}}>\r\n <Stack direction=\"row\" justifyContent=\"center\" alignItems=\"center\" sx={{ width: '100%', py: '0px', px: '0px', mx: '0px', my: '4px'}}>\r\n <Typography sx={{ \r\n width: '100%', \r\n textAlign: 'center',\r\n color: colors.surface, \r\n opacity: 0.7,\r\n ...typography.bodyMedium \r\n }}>\r\n No Preset\r\n </Typography>\r\n </Stack>\r\n </MenuItem>\r\n \r\n {/* Maps over props.presets */}\r\n {props.presets.map((preset) => (\r\n <MenuItem key={preset.id} value={preset.id} sx={{ borderRadius: '4px', py: '4px', my: '0px', px: '0px', mx: '0px'}}>\r\n <Stack direction=\"row\" justifyContent=\"space-around\" alignItems=\"center\" sx={{ width: '100%', py: '0px', px: '0px', mx: '0px', my: '4px'}}>\r\n <CardMedia\r\n component=\"img\"\r\n image=\"v1/svg/check-ratio-editor.svg\"\r\n sx={{ width: \"20px\", height: \"20px\", mr: '-16px', px: '0px', visibility: props.selectedPreset === preset.id ? 'visible' : 'hidden' }}\r\n />\r\n <Typography sx={{ width: '24px', textWrap: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'block', color: colors.surface, pr: \"82px\", pl: \"0px\", ml: \"0px\", justifyContent: 'flex-start', ...typography.bodyMedium }}>\r\n {preset.name}\r\n </Typography>\r\n <IconButton\r\n aria-label={`Options for ${preset.name}`}\r\n onClick={(event) => props.onPresetMenuClick(event, preset.id)}\r\n sx={{ padding: \"0px\", margin: \"0px\", mr: \"0px\" }}\r\n >\r\n <CardMedia component=\"img\" image=\"/v1/svg/dots-editor.svg\" alt=\"Options\" sx={{ width: '20px', height: '20px' }}/>\r\n </IconButton>\r\n </Stack>\r\n </MenuItem>\r\n ))}\r\n <Box sx={{ px: '16px', my: '8px'}}>\r\n <Button\r\n fullWidth\r\n variant=\"outlined\"\r\n sx={{ ...typography.labelMedium, height: '40px', color: colors.onBackground, backgroundColor: colors.surface, borderRadius: '100px', borderColor: colors.surface, textTransform: 'none', '&:hover': { backgroundColor: '#e0e0e0', borderColor: colors.surface } }}\r\n onClick={props.onOpenPresetModal}\r\n >\r\n Create Preset\r\n </Button>\r\n </Box>\r\n </Select>\r\n </FormControl>\r\n </AccordionDetails>\r\n </Accordion>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Modal, Box, Typography, Button, Stack } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n modalName: string;\r\n modalOpen: boolean;\r\n modalTitle: string;\r\n modalInformation: string;\r\n children: React.ReactNode;\r\n action?: React.ReactNode;\r\n modalClose: () => void;\r\n onConfirm: () => void;\r\n}\r\n\r\n// Create modal for any usage coverage\r\nexport default function HModalEditorDekstop(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n const style = {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n width: 500,\r\n bgcolor: 'background.paper',\r\n boxShadow: 24,\r\n p: 4,\r\n borderRadius: 6,\r\n spacing: 6,\r\n };\r\n return (\r\n <>\r\n <Modal\r\n open={props.modalOpen}\r\n onClose={props.modalClose}\r\n >\r\n <Box sx={style}>\r\n <Typography variant=\"h6\" color=\"initial\">\r\n {props.modalTitle}\r\n </Typography>\r\n <Box sx={{ mt: 2 }}>\r\n {props.children}\r\n </Box>\r\n <Typography color=\"initial\">\r\n {props.modalInformation}\r\n </Typography>\r\n <Stack>\r\n {props.action}\r\n </Stack>\r\n <Stack direction=\"row\" spacing={2} sx={{ mt: 3, justifyContent: 'flex-end' }}>\r\n <Button sx={{ ...typography.labelMedium, color: colors.onSurface, backgroundColor: colors.surface, }} onClick={props.modalClose}>\r\n Cancel\r\n </Button>\r\n <Button sx={{ ...typography.labelMedium, color: colors.onSurface, backgroundColor: colors.surface, }} onClick={props.onConfirm}>\r\n Save\r\n </Button>\r\n </Stack>\r\n </Box>\r\n </Modal>\r\n </>\r\n );\r\n}","import React from \"react\";\r\nimport { TextField, Stack, Button, Typography } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n valueName: string;\r\n setName: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n}\r\n\r\n\r\nexport function HTextField(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n \r\n return (\r\n <>\r\n <TextField\r\n autoFocus\r\n margin=\"dense\"\r\n id=\"name\"\r\n label=\"Preset Name\"\r\n type=\"text\"\r\n fullWidth\r\n variant=\"standard\"\r\n defaultValue={props.valueName}\r\n onChange={props.setName}\r\n sx={{ \r\n backgroundColor: \"#F6F6F6\", \r\n p: \"7px\",\r\n borderRadius: \"6px\",\r\n '& .MuiInputLabel-root': {\r\n color: colors.onSurfaceVariant, // A slightly dimmer color for the placeholder\r\n pt: '10px',\r\n pl: '10px',\r\n },\r\n '& .MuiInput-input': {\r\n color: colors.onSurface,\r\n },\r\n '& .MuiInputLabel-root.Mui-focused': {\r\n color: colors.onSurfaceVariant, // Or a different color if you prefer\r\n },\r\n }}\r\n />\r\n </>\r\n );\r\n}\r\n\r\ninterface PropsRename {\r\n valueName: string;\r\n setName: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n onSaveRenamePreset: () => void;\r\n onCancel: () => void;\r\n}\r\n\r\nexport function HTextFieldRename(props: PropsRename) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n \r\n return (\r\n <>\r\n <Stack direction=\"column\" spacing={2}>\r\n <TextField\r\n autoFocus\r\n type=\"text\"\r\n fullWidth\r\n variant=\"standard\"\r\n defaultValue={props.valueName}\r\n onChange={props.setName}\r\n sx={{ \r\n backgroundColor: \"#F6F6F6\", \r\n p: \"7px\",\r\n borderRadius: \"6px\",\r\n '& .MuiInputLabel-root': {\r\n pt: '10px',\r\n pl: '10px',\r\n },\r\n }}\r\n />\r\n <Stack direction=\"row\" justifyContent=\"end\" alignItems=\"center\">\r\n <Button\r\n color=\"primary\"\r\n onClick={props.onCancel}\r\n sx={{\r\n backgroundColor: colors.surface,\r\n color: colors.onSurface,\r\n '&:hover': {\r\n backgroundColor: colors.onSurfaceVariant1,\r\n },\r\n ...typography.titleMedium,\r\n }}\r\n >\r\n Cancel\r\n </Button>\r\n <Button\r\n color=\"primary\"\r\n onClick={props.onSaveRenamePreset}\r\n sx={{\r\n backgroundColor: colors.surface,\r\n color: colors.onSurface,\r\n '&:hover': {\r\n backgroundColor: colors.onSurfaceVariant1,\r\n },\r\n ...typography.titleMedium,\r\n }}\r\n >\r\n Save\r\n </Button>\r\n </Stack>\r\n </Stack>\r\n </>\r\n );\r\n}","import React from \"react\";\r\nimport { TextField, CardMedia, IconButton, Button, Typography, Stack } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n onSaveWatermark: () => void;\r\n onCancelWatermark: () => void;\r\n}\r\n\r\nexport default function HWatermarkView(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n\r\n return (\r\n <>\r\n <Stack direction=\"column\" alignItems=\"center\" spacing={5} sx={{ pt: \"20px\", color: colors.surface }}>\r\n <TextField\r\n id=\"watermark-name\"\r\n label=\"watermark name\"\r\n variant=\"standard\"\r\n sx={{\r\n '& .MuiInput-underline:before': {\r\n borderBottomColor: colors.surface\r\n },\r\n '& .MuiInputBase-input': {\r\n color: colors.surface\r\n }\r\n }}\r\n />\r\n <Stack direction=\"row\" spacing={0.5}>\r\n <Button variant=\"text\" sx={{ color: colors.surface }}>\r\n Landscape\r\n </Button>\r\n <Button variant=\"text\" sx={{ color: colors.surface }}>\r\n Portrait\r\n </Button>\r\n <Button variant=\"text\" sx={{ color: colors.surface }}>\r\n Square\r\n </Button>\r\n </Stack>\r\n </Stack>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Modal, Box, Typography, Button, Stack, IconButton, CardMedia } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n modalName: string;\r\n modalOpen: boolean;\r\n modalTitle: string;\r\n modalInformation?: string;\r\n children: React.ReactNode;\r\n action?: React.ReactNode;\r\n modalClose: () => void;\r\n onConfirm: () => void;\r\n}\r\n\r\nexport default function HModalMobile(props: Props) {\r\n const colors = useColors();\r\n const typography = useHonchoTypography();\r\n\r\n return (\r\n <>\r\n <Modal\r\n open={props.modalOpen}\r\n onClose={props.modalClose}\r\n >\r\n <Stack direction=\"column\" spacing={2} height=\"100%\" sx={{ p: \"10px\", backgroundColor: colors.surface }}>\r\n <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\">\r\n <Stack direction=\"row\" justifyContent=\"flex-start\" alignItems=\"center\" spacing={1}>\r\n <IconButton aria-label=\"close\" onClick={props.modalClose}>\r\n <CardMedia component=\"img\" image=\"/v1/svg/exit-button-modal-mobile.svg\" />\r\n </IconButton>\r\n <Typography variant=\"h6\" color=\"initial\">{props.modalTitle}</Typography>\r\n </Stack>\r\n <Button onClick={props.onConfirm} sx={{ textTransform: \"none\" }}>\r\n Save\r\n </Button>\r\n </Stack>\r\n <Typography variant=\"inherit\" color=\"initial\">{props.modalInformation}</Typography>\r\n <Box sx={{ mt: 2 }}>\r\n {props.children}\r\n </Box>\r\n <Stack sx={{ px: \"2px\" }}>\r\n {props.action}\r\n </Stack>\r\n </Stack>\r\n </Modal>\r\n </>\r\n )\r\n}","import React from \"react\";\r\nimport { Menu, MenuItem, ListItemText, CardMedia, Stack } from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface Props {\r\n anchorEl: null | HTMLElement;\r\n isOpen: boolean;\r\n onClose: () => void;\r\n onRename: () => void;\r\n onDelete: () => void;\r\n}\r\n\r\nexport default function HPresetOptionsMenu(props: Props) {\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n return (\r\n <Menu\r\n id=\"preset-options-menu\"\r\n anchorEl={props.anchorEl}\r\n open={props.isOpen}\r\n onClose={props.onClose}\r\n transformOrigin={{ horizontal: 'right', vertical: 'top' }}\r\n anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}\r\n slotProps={{\r\n paper: {\r\n sx: {\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface,\r\n border: `1px solid ${colors.onSurfaceVariant1}`,\r\n '& .MuiMenuItem-root:hover': {\r\n backgroundColor: 'rgba(255, 255, 255, 0.08)',\r\n },\r\n },\r\n },\r\n }}\r\n >\r\n <MenuItem onClick={props.onRename}>\r\n <Stack direction=\"row\" spacing=\"10px\">\r\n <CardMedia\r\n component=\"img\"\r\n image=\"/v1/svg/rename-menu-button.svg\"\r\n sx={{ width: '20px', height: '20px' }}\r\n />\r\n <ListItemText sx={{ ...typography.bodyMedium }}>Rename</ListItemText>\r\n </Stack>\r\n </MenuItem>\r\n <MenuItem onClick={props.onDelete}>\r\n <Stack direction=\"row\" spacing=\"10px\">\r\n <CardMedia\r\n component=\"img\"\r\n image=\"/v1/svg/delete-menu-button.svg\"\r\n sx={{ width: '20px', height: '20px' }}\r\n />\r\n <ListItemText sx={{ ...typography.bodyMedium, color: colors.error }}>Delete</ListItemText>\r\n </Stack>\r\n </MenuItem>\r\n </Menu>\r\n );\r\n}","import React from \"react\";\r\nimport { Alert, IconButton } from \"@mui/material\";\r\nimport CloseIcon from \"@mui/icons-material/Close\";\r\nimport useColors from '../../themes/colors';\r\n\r\nexport function HAlertInternetBox() {\r\n const colors = useColors();\r\n return (\r\n <Alert icon={<img src=\"v1/svg/check-ratio-editor.svg\"/>} \r\n sx={{ position: 'absolute',\r\n top: '10%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n\r\n width: { xs: '90%', sm: 'auto' },\r\n zIndex: 1300,\r\n\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface \r\n }}\r\n >\r\n No Internet Connection\r\n </Alert>\r\n );\r\n}\r\n\r\nexport function HAlertCopyBox() {\r\n const colors = useColors();\r\n return (\r\n <Alert \r\n icon={<img src=\"v1/svg/check-ratio-editor.svg\"/>} \r\n sx={{ position: 'absolute',\r\n top: '10%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n\r\n width: { xs: '90%', sm: 'auto' },\r\n zIndex: 1300,\r\n\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface \r\n }}\r\n >\r\n Copied!\r\n </Alert>\r\n );\r\n}\r\n\r\ninterface InternetConProps {\r\n onClose: () => void;\r\n}\r\n\r\nexport function HAlertInternetConnectionBox(props: InternetConProps) {\r\n const colors = useColors();\r\n return (\r\n <Alert\r\n icon={<img src=\"v1/svg/check-ratio-editor.svg\"/>} \r\n sx={{\r\n position: 'absolute',\r\n top: '10%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n width: { xs: '90%', sm: 'auto' },\r\n zIndex: 1300,\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface \r\n }}\r\n // Use the 'action' prop for the close button\r\n action={\r\n <IconButton\r\n aria-label=\"close\"\r\n color=\"inherit\"\r\n size=\"small\"\r\n onClick={props.onClose}\r\n >\r\n <CloseIcon fontSize=\"inherit\" />\r\n </IconButton>\r\n }\r\n >\r\n Connection Problem\r\n </Alert>\r\n );\r\n}\r\n\r\nexport function HAlertPresetSave() {\r\n const colors = useColors();\r\n return (\r\n <Alert icon={<img src=\"v1/svg/check-ratio-editor.svg\"/>} \r\n sx={{ position: 'absolute',\r\n top: '10%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n\r\n width: { xs: '90%', sm: 'auto' },\r\n zIndex: 1300,\r\n\r\n backgroundColor: colors.onBackground,\r\n color: colors.surface \r\n }}\r\n >\r\n Saved\r\n </Alert>\r\n );\r\n}","\"use client\";\r\n\r\nimport React from \"react\";\r\nimport { Box, Stack } from \"@mui/material\";\r\nimport Masonry, { ResponsiveMasonry } from \"react-responsive-masonry\";\r\nimport GalleryImageItem from \"./ImageItem\";\r\nimport type { PhotoData } from \"../../../hooks/editor/useHonchoEditorBulk\";\r\n\r\n// UPDATED: The main props interface for the gallery\r\ninterface ImageGalleryProps {\r\n\timageCollection: PhotoData[]; // Use the more specific type\r\n\tonToggleSelect: (photo: PhotoData) => void;\r\n}\r\n\r\nexport const AlbumImageGallery: React.FC<ImageGalleryProps> = (props) => {\r\n\tconst { imageCollection, onToggleSelect } = props;\r\n\r\n\treturn (\r\n\t\t<Stack sx={{ width: '100%', maxHeight: '100%', overflowY: 'auto'}}>\r\n\t\t\t<ResponsiveMasonry columnsCountBreakPoints={{ 750: 2, 900: 4 }}>\r\n\t\t\t\t<Masonry>\r\n\t\t\t\t\t{imageCollection.map((photo, index) => {\r\n\t\t\t\t\t\t// This guard clause is still important for runtime safety.\r\n\t\t\t\t\t\tif (!photo.key || !photo.src) {\r\n\t\t\t\t\t\t\tconsole.warn(\"Skipping item without a key or src:\", photo);\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// NEW: Create a new object that matches the 'PhotoProps' interface.\r\n\t\t\t\t\t\t// This explicitly tells TypeScript that all required fields are present.\r\n\t\t\t\t\t\tconst imageItemPhotoProps = {\r\n\t\t\t\t\t\t\tkey: photo.key,\r\n\t\t\t\t\t\t\tsrc: photo.src,\r\n\t\t\t\t\t\t\twidth: photo.width,\r\n\t\t\t\t\t\t\theight: photo.height,\r\n\t\t\t\t\t\t\talt: photo.alt,\r\n\t\t\t\t\t\t\t// We pass the original photo object in the generic 'photo' property\r\n\t\t\t\t\t\t\t// in case ImageItem needs it for other operations.\r\n\t\t\t\t\t\t\tphoto: photo, \r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<Box key={photo.key} sx={{ m: 0.5 }}>\r\n\t\t\t\t\t\t\t\t<GalleryImageItem\r\n\t\t\t\t\t\t\t\t\tmargin=\"0px\"\r\n\t\t\t\t\t\t\t\t\tindex={index}\r\n\t\t\t\t\t\t\t\t\tdirection=\"column\"\r\n\t\t\t\t\t\t\t\t\tonToggleSelect={() => { onToggleSelect(photo) }}\r\n data={photo}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t</Masonry>\r\n\t\t\t</ResponsiveMasonry>\r\n\t\t</Stack>\r\n\t);\r\n};","import { useMemo } from \"react\";\r\nimport { Box, CardMedia, useTheme } from \"@mui/material\";\r\nimport type { AdjustmentValues } from \"../../../lib/editor/honcho-editor\";\r\nimport { neutral } from \"../../../color\";\r\nimport { PhotoData } from \"../../../hooks/editor/useHonchoEditorBulk\";\r\n\r\nconst initialAdjustments: AdjustmentValues = {\r\n temperature: 0, tint: 0, saturation: 0, vibrance: 0, exposure: 0, contrast: 0, \r\n highlights: 0, shadows: 0, whites: 0, blacks: 0, clarity: 0, sharpness: 0,\r\n};\r\n\r\nconst imgStyle = {\r\n\ttransition: \"transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s\",\r\n\twidth: \"100%\",\r\n\t// objectFit: \"contain\",\r\n\t//height: \"100%\",\r\n};\r\nconst selectedImgStyle = {\r\n\tborderRadius: \"8px\",\r\n\ttransform: \"translateZ(0px) scale3d(1, 1, 1)\",\r\n\t// transition: \"transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s\"\r\n};\r\n\r\ninterface Props {\r\n\tmargin?: any;\r\n\tindex: number;\r\n\tdata: PhotoData;\r\n\t// onClick: renderImageClickHandler | null\r\n\tdirection: \"row\" | \"column\";\r\n\r\n\tonToggleSelect: () => void;\r\n}\r\n\r\nconst GalleryImageItem = (props: Props) => {\r\n\tconst { margin, data } = props;\r\n\tconst theme = useTheme();\r\n\tconst imageData = data;\r\n\r\n\tconst commonStyle = useMemo(() => {\r\n\t\treturn {\r\n\t\t\tbackgroundColor: neutral.white,\r\n\t\t\toverflow: \"hidden\",\r\n\t\t\tposition: \"relative\",\r\n\t\t\twidth: \"100%\",\r\n\t\t\taspectRatio: `${imageData.width}/${imageData.height}`,\r\n\t\t};\r\n\t}, [props.direction, imageData]);\r\n\r\n\tconst imageSx = useMemo(() => {\r\n\t\tconst baseStyles = imageData.isSelected ? {\r\n\t\t\t...imgStyle,\r\n\t\t\t...selectedImgStyle,\r\n\t\t\taspectRatio: `${imageData.width}/${imageData.height}`,\r\n\t\t} : {\r\n\t\t\t...imgStyle,\r\n\t\t};\r\n\t\t\r\n\t\treturn {\r\n\t\t\t...baseStyles,\r\n\t\t\topacity: 1, // Previously depended on isProcessingComplete\r\n\t\t\ttransition: 'opacity 0.3s ease-in-out',\r\n\t\t};\r\n\t}, [props.data.isSelected, imageData.width, imageData.height]);\r\n\r\n\tconst boxNotSelected = useMemo(\r\n\t\t() => ({\r\n\t\t\tmargin,\r\n\t\t\t// height: photo.height,\r\n\t\t\t...commonStyle,\r\n\t\t\ttransition: \".3s\",\r\n\t\t\t// \"&:hover\": { padding: \"12px\", backgroundColor: \"primary.light1\" },\r\n\t\t\t\"&:-webkit-transition\": { transition: \".3s\" },\r\n\t\t\t\"&:hover > .checkbox\": { display: \"block\" },\r\n\t\t\tcursor: \"pointer\",\r\n\t\t\tbackgroundColor: \"transparent\",\r\n\t\t}),\r\n\t\t[margin, commonStyle]\r\n\t);\r\n\r\n\tconst boxSelected = useMemo(\r\n\t\t() => ({\r\n\t\t\tmargin,\r\n\t\t\t// height: photo.height,\r\n\t\t\t...commonStyle,\r\n\t\t\tcursor: \"pointer\",\r\n\t\t\ttransition: \".3s\",\r\n\t\t\t\"&:-webkit-transition\": { transition: \".3s\" },\r\n\t\t\tpadding: { xs: \"13px 12px\", sm: \"21.31px 25.56px 21.32px 27.68px\" },\r\n\t\t}),\r\n\t\t[\r\n\t\t\tmargin,\r\n\t\t\tcommonStyle,\r\n\t\t\ttheme.palette.light,\r\n\t\t]\r\n\t);\r\n\r\n\tconst boxOuterSx = useMemo(() => {\r\n\t\tif (props.data.isSelected) {\r\n\t\t\treturn { ...boxSelected };\r\n\t\t} else {\r\n\t\t\treturn { ...boxNotSelected };\r\n\t\t}\r\n\t}, [imageData.height, imageData.width, commonStyle, boxSelected, boxNotSelected, margin]);\r\n\r\n\treturn (\r\n\t\t<Box id={\"Box_image\"} key={imageData.key} sx={boxOuterSx} className={\"image\"}>\r\n\t\t\t<CardMedia\r\n\t\t\t\tid=\"card_media\"\r\n\t\t\t\tcomponent=\"img\"\r\n\t\t\t\tclassName=\"image\"\r\n\t\t\t\tloading=\"lazy\"\r\n\t\t\t\talt={imageData.alt ?? \"Image\"}\r\n\t\t\t\tsx={imageSx}\r\n\t\t\t\tsrc={imageData.src}\r\n\t\t\t\twidth=\"100%\"\r\n\t\t\t\tonClick={props.onToggleSelect}\r\n\t\t\t/>\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default GalleryImageItem;\r\n","export const neutral = {\r\n white: \"#FFFFFF\",\r\n 10: \"#F9F9F9\",\r\n 25: \"#DBDBDB\",\r\n 50: \"#8D8D8D\",\r\n 75: \"#575757\",\r\n 100: \"#0A0A1C\",\r\n 200: \"#000000\",\r\n};","'use client';\r\n\r\nimport React, { createContext, useContext, useEffect, useState } from 'react';\r\nimport { useEditorHeadless } from '../hooks/useEditorHeadless';\r\nimport { EditorProcessingService } from '../context/EditorProcessingService';\r\nimport HonchoEditor from \"../editor/honcho-editor\";\r\n\r\ninterface EditorContextValue {\r\n isReady: boolean;\r\n error: Error | null;\r\n processingService: EditorProcessingService;\r\n queueStatus: {\r\n queueLength: number;\r\n isProcessing: boolean;\r\n hasProcessor: boolean;\r\n };\r\n editor: HonchoEditor | null;\r\n loadImageFromUrl: ((url: string) => Promise<{ width: number; height: number }>) | null;\r\n}\r\n\r\nconst EditorContext = createContext<EditorContextValue | null>(null);\r\n\r\ninterface EditorProviderProps {\r\n children: React.ReactNode;\r\n /** URL to the honcho-photo-editor.js script (defaults to '/honcho-photo-editor.js') */\r\n scriptUrl?: string;\r\n /** URL to the honcho-photo-editor.wasm file (defaults to '/honcho-photo-editor.wasm') */\r\n wasmUrl?: string;\r\n}\r\n\r\nexport const EditorProvider: React.FC<EditorProviderProps> = ({ \r\n children, \r\n scriptUrl = '/honcho-photo-editor.js',\r\n wasmUrl = '/honcho-photo-editor.wasm'\r\n}) => {\r\n // Single editor instance for the entire app\r\n const { editor, isReady, error, processImage, loadImageFromUrl } = useEditorHeadless({ scriptUrl, wasmUrl });\r\n \r\n // Single processing service instance\r\n const [processingService] = useState(() => new EditorProcessingService());\r\n const [queueStatus, setQueueStatus] = useState(processingService.getQueueStatus());\r\n\r\n // Connect the editor to the processing service when ready\r\n useEffect(() => {\r\n if (isReady && processImage) {\r\n console.debug('Connecting editor to processing service - editor ready:', isReady);\r\n processingService.setProcessor(processImage);\r\n } else {\r\n console.debug('Editor not ready yet - isReady:', isReady, 'processImage:', !!processImage);\r\n }\r\n }, [isReady, processImage, processingService]);\r\n\r\n // Update queue status periodically - now event-driven instead of polling\r\n useEffect(() => {\r\n const updateStatus = () => {\r\n setQueueStatus(processingService.getQueueStatus());\r\n };\r\n\r\n // Add listener for immediate updates\r\n processingService.addStatusChangeListener(updateStatus);\r\n\r\n // Optional: Keep a fallback interval for safety (much less frequent)\r\n const interval = setInterval(updateStatus, 5000); // 5 seconds instead of 1\r\n\r\n return () => {\r\n processingService.removeStatusChangeListener(updateStatus);\r\n clearInterval(interval);\r\n };\r\n }, [processingService]);\r\n\r\n // Cleanup on unmount\r\n useEffect(() => {\r\n return () => {\r\n processingService.cleanup(); // Use new cleanup method\r\n };\r\n }, [processingService]);\r\n\r\n const contextValue: EditorContextValue = {\r\n isReady,\r\n error,\r\n processingService,\r\n queueStatus,\r\n editor: editor,\r\n loadImageFromUrl\r\n };\r\n\r\n return (\r\n <EditorContext.Provider value={contextValue}>\r\n {children}\r\n </EditorContext.Provider>\r\n );\r\n};\r\n\r\n// Custom hook to use the editor context\r\nexport const useEditorContext = (): EditorContextValue => {\r\n const context = useContext(EditorContext);\r\n if (!context) {\r\n throw new Error('useEditorContext must be used within an EditorProvider');\r\n }\r\n return context;\r\n};\r\n","'use client';\r\n\r\nimport { useState, useEffect, useRef, useCallback } from 'react';\r\nimport type { AdjustmentValues, HonchoEditor } from '../editor/honcho-editor';\r\nimport { loadImageAsBlob, loadImageAsFile } from '../../utils/imageLoader';\r\n\r\n// Access HonchoEditor from global window object since it's not exported as ES module\r\ndeclare global {\r\n interface Window {\r\n HonchoEditor: new () => any;\r\n HonchoEditorUtils: {\r\n imageDataToBlob: (imageData: ImageData, format?: string, quality?: number) => Promise<Blob>;\r\n };\r\n }\r\n}\r\n\r\ninterface EditorTask {\r\n id: string;\r\n path: string;\r\n frame: string | null;\r\n adjustments?: Partial<AdjustmentValues>\r\n}\r\n\r\ninterface EditorResponse {\r\n id: string;\r\n path: string;\r\n}\r\n\r\ninterface UseEditorHeadlessOptions {\r\n scriptUrl?: string;\r\n wasmUrl?: string;\r\n}\r\n\r\nexport function useEditorHeadless(options: UseEditorHeadlessOptions = {}) {\r\n const { \r\n scriptUrl = '/honcho-photo-editor.js', \r\n wasmUrl = '/honcho-photo-editor.wasm' \r\n } = options;\r\n const editorRef = useRef<HonchoEditor | null>(null);\r\n const [isReady, setIsReady] = useState(false);\r\n const [error, setError] = useState<Error | null>(null);\r\n const [isScriptLoaded, setIsScriptLoaded] = useState(false);\r\n\r\n // Load script dynamically without component\r\n useEffect(() => {\r\n const loadScripts = async () => {\r\n // Check if HonchoEditor is already available\r\n if (window.HonchoEditor) {\r\n console.debug('HonchoEditor already available globally');\r\n setIsScriptLoaded(true);\r\n return;\r\n }\r\n\r\n // Load WASM module first\r\n const loadWasmModule = () => {\r\n return new Promise<void>((resolve, reject) => {\r\n // Check if WASM module is already loaded\r\n if (document.querySelector(`script[src=\"${scriptUrl}\"]`)) {\r\n console.debug('WASM module script already exists');\r\n resolve();\r\n return;\r\n }\r\n\r\n console.debug(`Loading WASM module from: ${scriptUrl}`);\r\n const wasmScript = document.createElement('script');\r\n wasmScript.src = scriptUrl;\r\n wasmScript.async = true;\r\n \r\n wasmScript.onload = () => {\r\n console.debug('WASM module script loaded');\r\n resolve();\r\n };\r\n \r\n wasmScript.onerror = () => {\r\n console.error(`Failed to load WASM module from: ${scriptUrl}`);\r\n reject(new Error('Failed to load WASM module'));\r\n };\r\n\r\n document.head.appendChild(wasmScript);\r\n });\r\n };\r\n\r\n // Load wrapper script that creates HonchoEditor constructor\r\n const loadWrapperScript = () => {\r\n return new Promise<void>((resolve, reject) => {\r\n const wrapperUrl = '/honcho-editor.js';\r\n \r\n // Check if wrapper script is already loaded\r\n if (document.querySelector(`script[src=\"${wrapperUrl}\"]`)) {\r\n console.debug('Wrapper script already exists');\r\n resolve();\r\n return;\r\n }\r\n\r\n console.debug(`Loading HonchoEditor wrapper from: ${wrapperUrl}`);\r\n const wrapperScript = document.createElement('script');\r\n wrapperScript.src = wrapperUrl;\r\n wrapperScript.async = true;\r\n \r\n wrapperScript.onload = () => {\r\n console.debug('Wrapper script loaded');\r\n resolve();\r\n };\r\n \r\n wrapperScript.onerror = () => {\r\n console.error(`Failed to load wrapper script from: ${wrapperUrl}`);\r\n reject(new Error('Failed to load wrapper script'));\r\n };\r\n\r\n document.head.appendChild(wrapperScript);\r\n });\r\n };\r\n\r\n try {\r\n // Load WASM module first\r\n await loadWasmModule();\r\n \r\n // Then load the wrapper that creates the constructor\r\n await loadWrapperScript();\r\n \r\n // Wait for HonchoEditor constructor to be available\r\n const waitForConstructor = () => {\r\n return new Promise<void>((resolve, reject) => {\r\n const checkInterval = setInterval(() => {\r\n if (window.HonchoEditor && typeof window.HonchoEditor === 'function') {\r\n console.debug('HonchoEditor constructor now available');\r\n clearInterval(checkInterval);\r\n resolve();\r\n }\r\n }, 100);\r\n \r\n // Timeout after 10 seconds\r\n setTimeout(() => {\r\n clearInterval(checkInterval);\r\n if (!window.HonchoEditor) {\r\n console.error('Timeout waiting for HonchoEditor constructor');\r\n reject(new Error('Timeout waiting for HonchoEditor constructor'));\r\n }\r\n }, 10000);\r\n });\r\n };\r\n\r\n await waitForConstructor();\r\n setIsScriptLoaded(true);\r\n\r\n } catch (error) {\r\n console.error('Failed to load HonchoEditor scripts:', error);\r\n setError(error instanceof Error ? error : new Error(String(error)));\r\n }\r\n };\r\n\r\n loadScripts();\r\n\r\n // Cleanup scripts on unmount (but be careful not to remove if other components need it)\r\n return () => {\r\n // Don't remove the scripts on unmount as other components might need them\r\n // The scripts should stay loaded for the lifetime of the app\r\n };\r\n }, [scriptUrl]);\r\n\r\n // Initialize editor when script is loaded\r\n useEffect(() => {\r\n if (!isScriptLoaded) return;\r\n\r\n const initialize = async () => {\r\n try {\r\n console.debug('Script loaded, initializing editor...');\r\n \r\n // Double-check that HonchoEditor is available\r\n if (!window.HonchoEditor) {\r\n throw new Error('window.HonchoEditor is not available');\r\n }\r\n\r\n if (typeof window.HonchoEditor !== 'function') {\r\n throw new Error(`window.HonchoEditor is not a constructor (type: ${typeof window.HonchoEditor})`);\r\n }\r\n \r\n if (!editorRef.current) {\r\n console.debug('Creating new HonchoEditor instance...');\r\n editorRef.current = new window.HonchoEditor();\r\n console.debug('HonchoEditor instance created successfully');\r\n }\r\n\r\n console.debug('Initializing HonchoEditor...');\r\n await editorRef.current!!.initialize(false);\r\n console.debug('HonchoEditor initialized successfully');\r\n setIsReady(true);\r\n } catch (e) {\r\n console.error(\"Failed to initialize editor:\", e);\r\n setError(e instanceof Error ? e : new Error(String(e)));\r\n }\r\n };\r\n\r\n initialize();\r\n\r\n return () => {\r\n if (editorRef.current) {\r\n console.debug('Cleaning up HonchoEditor...');\r\n editorRef.current?.cleanup();\r\n }\r\n };\r\n }, [isScriptLoaded]);\r\n\r\n // Process single image task\r\n const processImage = useCallback(async (task: EditorTask): Promise<EditorResponse> => {\r\n if (!editorRef.current || !isReady) {\r\n throw new Error('Editor not ready');\r\n }\r\n\r\n try {\r\n console.debug(`Processing image: ${task.id}`);\r\n \r\n // Load original image as File using the new utility\r\n const imageFile = await loadImageAsFile(task.path);\r\n \r\n // Load frame if provided\r\n let frameFile: File | null = null;\r\n if (task.frame) {\r\n frameFile = await loadImageAsFile(task.frame);\r\n }\r\n\r\n // Process image using HonchoEditor's one-shot method\r\n const processedImageData = await editorRef.current.processImageOneShot(\r\n imageFile,\r\n task.adjustments,\r\n frameFile\r\n );\r\n\r\n // Convert ImageData to Blob\r\n const processedBlob = await window.HonchoEditorUtils.imageDataToBlob(processedImageData);\r\n \r\n // Create blob URL for processed result\r\n const blobUrl = URL.createObjectURL(processedBlob);\r\n\r\n return { id: task.id, path: blobUrl };\r\n\r\n } catch (error) {\r\n console.error(`Failed to process image ${task.id}:`, error);\r\n throw new Error(`Failed to process image: ${error instanceof Error ? error.message : 'Unknown error'}`);\r\n }\r\n }, [isReady]);\r\n\r\n // Helper function to load image from URL with CORS handling\r\n const loadImageFromUrl = useCallback(async (url: string): Promise<{ width: number; height: number }> => {\r\n if (!editorRef.current || !isReady) {\r\n throw new Error('Editor not ready');\r\n }\r\n\r\n try {\r\n console.debug(`Loading image from URL: ${url}`);\r\n \r\n // First try direct load with CORS\r\n try {\r\n const size = await editorRef.current.loadImageFromUrl(url);\r\n console.debug('Image loaded successfully via direct URL');\r\n return size;\r\n } catch (directError) {\r\n console.warn('Direct URL load failed, trying blob approach:', directError);\r\n \r\n // Fallback: Load as File using the new utility\r\n const imageFile = await loadImageAsFile(url);\r\n \r\n // Load via file method\r\n const size = await editorRef.current.loadImageFromFile(imageFile);\r\n console.debug('Image loaded successfully via file fallback');\r\n return size;\r\n }\r\n } catch (error) {\r\n console.error(`Failed to load image from URL ${url}:`, error);\r\n throw new Error(`Failed to load image: ${error instanceof Error ? error.message : 'Unknown error'}`);\r\n }\r\n }, [isReady]);\r\n\r\n return {\r\n editor: editorRef.current,\r\n isReady,\r\n error,\r\n processImage,\r\n loadImageFromUrl\r\n };\r\n}","/**\r\n * Image loading utilities with CORS handling and fallback mechanisms\r\n */\r\n\r\n/**\r\n * Load image as blob with CORS handling and proxy fallback\r\n */\r\nexport async function loadImageAsBlob(url: string): Promise<Blob> {\r\n try {\r\n // Try direct fetch first (faster, no server load)\r\n const response = await fetch(url, {\r\n mode: 'cors',\r\n credentials: 'omit'\r\n });\r\n if (!response.ok) {\r\n throw new Error(`Direct fetch failed: ${response.statusText}`);\r\n }\r\n return response.blob();\r\n } catch (error) {\r\n // Fallback to proxy API if CORS or other fetch issues\r\n try {\r\n const proxyUrl = `/api/image?imageUrl=${encodeURIComponent(url)}`;\r\n const response = await fetch(proxyUrl);\r\n if (!response.ok) {\r\n throw new Error(`Proxy fetch failed: ${response.statusText}`);\r\n }\r\n return response.blob();\r\n } catch (proxyError) {\r\n console.error(`Both direct and proxy fetch failed for ${url}:`, proxyError);\r\n throw new Error(`Failed to load image: ${proxyError instanceof Error ? proxyError.message : 'Unknown error'}`);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Load image from URL and convert to File object with CORS handling and fallback mechanisms\r\n */\r\nexport async function loadImageAsFile(url: string): Promise<File> {\r\n try {\r\n // Load image as blob with CORS handling\r\n const imageBlob = await loadImageAsBlob(url);\r\n \r\n return new File([imageBlob], 'image', { type: imageBlob.type });\r\n } catch (error) {\r\n console.error(`Failed to load image from URL ${url}:`, error);\r\n throw new Error(`Failed to load image: ${error instanceof Error ? error.message : 'Unknown error'}`);\r\n }\r\n}\r\n","import type { AdjustmentValues } from '../editor/honcho-editor';\r\n\r\nexport interface EditorTask {\r\n id: string;\r\n path: string;\r\n frame: string | null;\r\n adjustments?: Partial<AdjustmentValues>;\r\n priority?: number; // Higher priority = processed first\r\n abortSignal?: AbortSignal; // Add abort signal support\r\n}\r\n\r\nexport interface EditorResponse {\r\n id: string;\r\n path: string;\r\n}\r\n\r\ninterface QueueItem extends EditorTask {\r\n resolve: (response: EditorResponse) => void;\r\n reject: (error: Error) => void;\r\n timestamp: number;\r\n abortSignal?: AbortSignal;\r\n}\r\n\r\n// Simple priority queue implementation using binary heap\r\nclass PriorityQueue {\r\n private heap: QueueItem[] = [];\r\n\r\n // Insert item maintaining priority order - O(log n)\r\n enqueue(item: QueueItem) {\r\n this.heap.push(item);\r\n this.heapifyUp(this.heap.length - 1);\r\n }\r\n\r\n // Remove highest priority item - O(log n)\r\n dequeue(): QueueItem | undefined {\r\n if (this.heap.length === 0) return undefined;\r\n if (this.heap.length === 1) return this.heap.pop();\r\n\r\n const root = this.heap[0];\r\n this.heap[0] = this.heap.pop()!;\r\n this.heapifyDown(0);\r\n return root;\r\n }\r\n\r\n get length() {\r\n return this.heap.length;\r\n }\r\n\r\n clear() {\r\n return this.heap.splice(0);\r\n }\r\n\r\n // Remove item by ID (for cancellation)\r\n removeById(id: string): boolean {\r\n const index = this.heap.findIndex(item => item.id === id);\r\n if (index === -1) return false;\r\n\r\n // Replace with last element and heapify\r\n const removed = this.heap[index];\r\n if (index === this.heap.length - 1) {\r\n this.heap.pop();\r\n } else {\r\n this.heap[index] = this.heap.pop()!;\r\n // Re-heapify from this position\r\n this.heapifyDown(index);\r\n this.heapifyUp(index);\r\n }\r\n \r\n console.debug(`Removed task ${id} from queue`);\r\n return true;\r\n }\r\n\r\n private heapifyUp(index: number) {\r\n while (index > 0) {\r\n const parentIndex = Math.floor((index - 1) / 2);\r\n if (this.compare(this.heap[index], this.heap[parentIndex]) <= 0) break;\r\n\r\n [this.heap[index], this.heap[parentIndex]] = [this.heap[parentIndex], this.heap[index]];\r\n index = parentIndex;\r\n }\r\n }\r\n\r\n private heapifyDown(index: number) {\r\n while (true) {\r\n let maxIndex = index;\r\n const leftChild = 2 * index + 1;\r\n const rightChild = 2 * index + 2;\r\n\r\n if (leftChild < this.heap.length && this.compare(this.heap[leftChild], this.heap[maxIndex]) > 0) {\r\n maxIndex = leftChild;\r\n }\r\n\r\n if (rightChild < this.heap.length && this.compare(this.heap[rightChild], this.heap[maxIndex]) > 0) {\r\n maxIndex = rightChild;\r\n }\r\n\r\n if (maxIndex === index) break;\r\n\r\n [this.heap[index], this.heap[maxIndex]] = [this.heap[maxIndex], this.heap[index]];\r\n index = maxIndex;\r\n }\r\n }\r\n\r\n // Compare function: higher priority first, then older timestamp\r\n private compare(a: QueueItem, b: QueueItem): number {\r\n if (a.priority !== b.priority) {\r\n return (a.priority || 0) - (b.priority || 0);\r\n }\r\n return b.timestamp - a.timestamp; // Older first (reversed for min-heap behavior)\r\n }\r\n}\r\n\r\nexport class EditorProcessingService {\r\n private processingQueue = new PriorityQueue();\r\n private isProcessing = false;\r\n private processImage?: (task: EditorTask) => Promise<EditorResponse>;\r\n private pendingProcessingTimeout?: NodeJS.Timeout;\r\n private statusChangeListeners: (() => void)[] = [];\r\n\r\n constructor() {\r\n console.debug('EditorProcessingService created');\r\n }\r\n\r\n // Set the processing function from the editor\r\n setProcessor(processImage: (task: EditorTask) => Promise<EditorResponse>) {\r\n this.processImage = processImage;\r\n console.debug('Editor processor set, queue length:', this.processingQueue.length);\r\n\r\n // Start processing if there are queued items\r\n if (this.processingQueue.length > 0) {\r\n this.scheduleProcessing();\r\n }\r\n }\r\n\r\n // Add listener for status changes\r\n addStatusChangeListener(listener: () => void) {\r\n this.statusChangeListeners.push(listener);\r\n }\r\n\r\n // Remove status change listener\r\n removeStatusChangeListener(listener: () => void) {\r\n const index = this.statusChangeListeners.indexOf(listener);\r\n if (index > -1) {\r\n this.statusChangeListeners.splice(index, 1);\r\n }\r\n }\r\n\r\n // Notify status change listeners\r\n private notifyStatusChange() {\r\n this.statusChangeListeners.forEach(listener => listener());\r\n }\r\n\r\n // Add task to processing queue\r\n async requestProcessing(task: EditorTask): Promise<EditorResponse> {\r\n return new Promise((resolve, reject) => {\r\n // Check if already aborted before adding to queue\r\n if (task.abortSignal?.aborted) {\r\n console.debug(`Task ${task.id} already aborted, not adding to queue`);\r\n reject(new Error('Task aborted before processing'));\r\n return;\r\n }\r\n\r\n // Validate that we have a processor\r\n if (!this.processImage) {\r\n console.warn('No processor available, rejecting task:', task.id);\r\n reject(new Error('Editor not ready - processor not set'));\r\n return;\r\n }\r\n\r\n const queueItem: QueueItem = {\r\n ...task,\r\n priority: task.priority || 0,\r\n resolve,\r\n reject,\r\n timestamp: Date.now(),\r\n abortSignal: task.abortSignal,\r\n };\r\n\r\n // Set up abort listener to remove from queue if cancelled\r\n if (task.abortSignal) {\r\n const abortHandler = () => {\r\n console.debug(`Task ${task.id} aborted, removing from queue if still pending`);\r\n this.removeFromQueue(task.id);\r\n reject(new Error('Task aborted'));\r\n };\r\n\r\n task.abortSignal.addEventListener('abort', abortHandler, { once: true });\r\n }\r\n\r\n // Add to priority queue - O(log n)\r\n this.processingQueue.enqueue(queueItem);\r\n console.debug(`Added task ${task.id} to queue. Queue length: ${this.processingQueue.length}`);\r\n\r\n // Notify status change\r\n this.notifyStatusChange();\r\n\r\n // Schedule processing with debouncing\r\n this.scheduleProcessing();\r\n });\r\n }\r\n\r\n // Debounced processing to avoid starting processing on every single addition\r\n private scheduleProcessing() {\r\n if (this.pendingProcessingTimeout) {\r\n clearTimeout(this.pendingProcessingTimeout);\r\n }\r\n\r\n this.pendingProcessingTimeout = setTimeout(() => {\r\n this.processQueue();\r\n }, 5); // 5ms debounce\r\n }\r\n\r\n // Process queue sequentially\r\n private async processQueue() {\r\n if (this.isProcessing || this.processingQueue.length === 0 || !this.processImage) {\r\n return;\r\n }\r\n\r\n this.isProcessing = true;\r\n this.notifyStatusChange();\r\n console.debug('Starting queue processing...');\r\n\r\n while (this.processingQueue.length > 0) {\r\n // Get highest priority item - O(log n) vs O(n log n) sorting\r\n const item = this.processingQueue.dequeue()!;\r\n \r\n // Check if the item was aborted before processing\r\n if (item.abortSignal?.aborted) {\r\n console.debug(`Skipping aborted task ${item.id}`);\r\n item.reject(new Error('Task aborted'));\r\n continue;\r\n }\r\n\r\n console.debug(`Processing task ${item.id} (priority: ${item.priority || 0}, queue remaining: ${this.processingQueue.length})`);\r\n\r\n try {\r\n // Check abort signal again before actual processing\r\n if (item.abortSignal?.aborted) {\r\n throw new Error('Task aborted during processing');\r\n }\r\n\r\n const result = await this.processImage(item);\r\n \r\n // Final check before resolving\r\n if (!item.abortSignal?.aborted) {\r\n item.resolve(result);\r\n } else {\r\n item.reject(new Error('Task aborted after processing'));\r\n }\r\n } catch (error) {\r\n console.error(`Failed to process task ${item.id}:`, error);\r\n item.reject(error instanceof Error ? error : new Error(String(error)));\r\n }\r\n\r\n // Yield control to browser for UI updates - more efficient than setTimeout\r\n await new Promise(resolve => {\r\n if (typeof requestIdleCallback !== 'undefined') {\r\n requestIdleCallback(resolve);\r\n } else {\r\n // Fallback for environments without requestIdleCallback\r\n setTimeout(resolve, 0);\r\n }\r\n });\r\n\r\n // Notify status change after each item\r\n this.notifyStatusChange();\r\n }\r\n\r\n this.isProcessing = false;\r\n this.notifyStatusChange();\r\n console.debug('Queue processing complete');\r\n }\r\n\r\n // Remove task from queue by ID\r\n private removeFromQueue(id: string): boolean {\r\n const removed = this.processingQueue.removeById(id);\r\n if (removed) {\r\n this.notifyStatusChange();\r\n }\r\n return removed;\r\n }\r\n\r\n // Get current queue status\r\n getQueueStatus() {\r\n return {\r\n queueLength: this.processingQueue.length,\r\n isProcessing: this.isProcessing,\r\n hasProcessor: !!this.processImage,\r\n };\r\n }\r\n\r\n // Clear the queue (useful for cleanup)\r\n clearQueue() {\r\n const clearedItems = this.processingQueue.clear();\r\n clearedItems.forEach(item => {\r\n item.reject(new Error('Queue cleared'));\r\n });\r\n this.notifyStatusChange();\r\n console.debug(`Cleared ${clearedItems.length} items from queue`);\r\n }\r\n\r\n // Cleanup method for removing timeouts\r\n cleanup() {\r\n if (this.pendingProcessingTimeout) {\r\n clearTimeout(this.pendingProcessingTimeout);\r\n this.pendingProcessingTimeout = undefined;\r\n }\r\n this.clearQueue();\r\n this.statusChangeListeners.length = 0;\r\n }\r\n}\r\n","import { useState, useEffect, useMemo, useRef } from 'react';\r\nimport { useEditor, useEditorHighPriority, useEditorLowPriority } from '../hooks/useEditor';\r\nimport type { AdjustmentValues } from '../editor/honcho-editor';\r\n\r\ninterface UseImageProcessorProps {\r\n photoId: string; // Unique identifier for the photo\r\n photoSrc: string;\r\n enableEditor?: boolean;\r\n adjustments?: Partial<AdjustmentValues>;\r\n frame?: string | null;\r\n priority?: 'high' | 'low'; // Priority for processing queue\r\n abortSignal?: AbortSignal; // External abort signal for cancellation\r\n}\r\n\r\ninterface UseImageProcessorReturn {\r\n processedImageSrc: string;\r\n isProcessingComplete: boolean;\r\n cancelProcessing: () => void; // Function to cancel current processing\r\n isProcessing: boolean; // Whether processing is currently happening\r\n}\r\n\r\nexport function useImageProcessor({\r\n photoId,\r\n photoSrc,\r\n enableEditor = true,\r\n adjustments,\r\n frame,\r\n priority = 'low',\r\n abortSignal,\r\n}: UseImageProcessorProps): UseImageProcessorReturn {\r\n const { processImage, isEditorReady } = priority === 'high'\r\n ? useEditorHighPriority()\r\n : useEditorLowPriority();\r\n\r\n // State for processed image and processing status\r\n const [processedImageSrc, setProcessedImageSrc] = useState<string>(photoSrc);\r\n const [isProcessingComplete, setIsProcessingComplete] = useState<boolean>(false);\r\n const [isProcessing, setIsProcessing] = useState<boolean>(false);\r\n\r\n // Internal abort controller for this hook\r\n const abortControllerRef = useRef<AbortController | null>(null);\r\n\r\n // Function to cancel current processing\r\n const cancelProcessing = () => {\r\n if (abortControllerRef.current) {\r\n abortControllerRef.current.abort();\r\n abortControllerRef.current = null;\r\n }\r\n setIsProcessing(false);\r\n console.debug(`[useImageProcessor] Cancelled processing for image ${photoId}`);\r\n };\r\n\r\n // Memoize adjustments to prevent unnecessary effect triggers\r\n const adjustmentsString = useMemo(() =>\r\n adjustments ? JSON.stringify(adjustments) : '',\r\n [adjustments]\r\n );\r\n const frameMemoized = useMemo<string | null>(() => frame ? frame : null, [frame]);\r\n\r\n // Process image when adjustments change\r\n useEffect(() => {\r\n // Cancel any previous processing\r\n if (abortControllerRef.current) {\r\n abortControllerRef.current.abort();\r\n }\r\n\r\n if (!enableEditor || !isEditorReady || !adjustments) {\r\n console.debug(\"Skipping editor processing:\", {\r\n enableEditor,\r\n isEditorReady,\r\n hasAdjustments: !!adjustments,\r\n hasFrame: frameMemoized,\r\n photoId\r\n });\r\n setProcessedImageSrc(photoSrc);\r\n setIsProcessingComplete(true);\r\n setIsProcessing(false);\r\n return;\r\n }\r\n\r\n // Create new abort controller for this processing cycle\r\n const controller = new AbortController();\r\n abortControllerRef.current = controller;\r\n\r\n // Reset processing state when starting new processing\r\n setIsProcessingComplete(false);\r\n setIsProcessing(true);\r\n\r\n const processImageWithEditor = async () => {\r\n try {\r\n // Check if already aborted before starting\r\n if (controller.signal.aborted || abortSignal?.aborted) {\r\n console.debug(`[useImageProcessor] Aborted before processing started for image ${photoId}`);\r\n return;\r\n }\r\n\r\n console.debug(`[useImageProcessor] Starting processing for image ${photoId}`);\r\n \r\n const result = await processImage({\r\n id: photoId,\r\n path: photoSrc,\r\n frame: frameMemoized,\r\n adjustments: adjustments,\r\n abortSignal: controller.signal // Pass the abort signal to the processing service\r\n });\r\n\r\n // Check if aborted after processing completes\r\n if (!controller.signal.aborted && !abortSignal?.aborted) {\r\n console.debug(`[useImageProcessor] Completed processing for image ${photoId}`);\r\n setProcessedImageSrc(result.path);\r\n setIsProcessingComplete(true);\r\n setIsProcessing(false);\r\n } else {\r\n console.debug(`[useImageProcessor] Aborted after processing completed for image ${photoId}`);\r\n }\r\n } catch (error: any) {\r\n if (error.name === 'AbortError' || controller.signal.aborted || abortSignal?.aborted) {\r\n console.debug(`[useImageProcessor] Processing cancelled for image ${photoId}`);\r\n } else {\r\n console.error({ error, photoKey: photoId, isEditorReady }, 'Failed to process image with editor');\r\n }\r\n setIsProcessing(false);\r\n }\r\n };\r\n\r\n processImageWithEditor();\r\n\r\n return () => {\r\n // Cleanup: abort the controller when effect cleanup runs\r\n controller.abort();\r\n if (abortControllerRef.current === controller) {\r\n abortControllerRef.current = null;\r\n }\r\n };\r\n }, [photoSrc, adjustmentsString, frameMemoized, enableEditor, isEditorReady, processImage, photoId, abortSignal]);\r\n\r\n // Listen to external abort signal\r\n useEffect(() => {\r\n if (!abortSignal) return;\r\n\r\n const handleAbort = () => {\r\n cancelProcessing();\r\n };\r\n\r\n abortSignal.addEventListener('abort', handleAbort);\r\n \r\n return () => {\r\n abortSignal.removeEventListener('abort', handleAbort);\r\n };\r\n }, [abortSignal]);\r\n\r\n return {\r\n processedImageSrc,\r\n isProcessingComplete,\r\n cancelProcessing,\r\n isProcessing\r\n };\r\n}\r\n","'use client';\r\n\r\nimport { useCallback } from 'react';\r\nimport { useEditorContext } from '../context/EditorContext';\r\nimport type { EditorTask, EditorResponse } from '../context/EditorProcessingService';\r\n\r\ninterface UseEditorOptions {\r\n priority?: number; // Priority for processing queue (higher = first)\r\n}\r\n\r\ninterface UseEditorResult {\r\n processImage: (task: Omit<EditorTask, 'priority'>) => Promise<EditorResponse>;\r\n isEditorReady: boolean;\r\n editorError: Error | null;\r\n queueStatus: {\r\n queueLength: number;\r\n isProcessing: boolean;\r\n hasProcessor: boolean;\r\n };\r\n}\r\n\r\n/**\r\n * Lightweight hook for components to request image processing\r\n * Uses the global editor instance via context\r\n */\r\nexport const useEditor = (options: UseEditorOptions = {}): UseEditorResult => {\r\n const { isReady, error, processingService, queueStatus } = useEditorContext();\r\n const { priority = 0 } = options;\r\n\r\n const processImage = useCallback(async (task: Omit<EditorTask, 'priority'>): Promise<EditorResponse> => {\r\n if (!isReady) {\r\n throw new Error('Editor not ready');\r\n }\r\n\r\n const taskWithPriority: EditorTask = {\r\n ...task,\r\n priority,\r\n };\r\n\r\n return processingService.requestProcessing(taskWithPriority);\r\n }, [isReady, processingService, priority]);\r\n\r\n return {\r\n processImage,\r\n isEditorReady: isReady,\r\n editorError: error,\r\n queueStatus,\r\n };\r\n};\r\n\r\n// Convenience hook for high-priority processing (e.g., visible images)\r\nexport const useEditorHighPriority = (): UseEditorResult => {\r\n return useEditor({ priority: 10 });\r\n};\r\n\r\n// Convenience hook for low-priority processing (e.g., off-screen images)\r\nexport const useEditorLowPriority = (): UseEditorResult => {\r\n return useEditor({ priority: 1 });\r\n};","import {\r\n\tButton,\r\n\tDialog,\r\n\tDialogActions,\r\n\tDialogContent,\r\n\tDialogTitle,\r\n\tGrid,\r\n\tTypography,\r\n\tuseTheme,\r\n} from \"@mui/material\";\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\nimport useColors from '../../themes/colors';\r\n\r\ninterface ModalDialogProps {\r\n isOpen: boolean;\r\n\tisLoading?: boolean;\r\n\ttitle?: string;\r\n\tdescription?: string;\r\n\tonCancel: () => void;\r\n\tonSubmit: () => void;\r\n\tcancelLabel?: string;\r\n\tsubmitLabel?: string;\r\n}\r\n\r\nconst defaultPaperStyle = {\r\n\tborderRadius: \"28px\",\r\n\twidth: { xs: \"100%\", sm: \"456px\" },\r\n\tboxShadow: \"none\",\r\n};\r\n\r\nfunction ModalDialog(props: ModalDialogProps) {\r\n\tconst {\r\n isOpen,\r\n\t\tisLoading = false,\r\n\t\ttitle,\r\n\t\tdescription,\r\n\t\tonCancel,\r\n\t\tonSubmit,\r\n\t\tcancelLabel = \"Cancel\",\r\n\t\tsubmitLabel = \"Confirm\",\r\n\t} = props;\r\n\r\n\tconst theme = useTheme();\r\n const typography = useHonchoTypography();\r\n const colors = useColors();\r\n\r\n\treturn (\r\n\t\t<Dialog\r\n\t\t\tdisableScrollLock\r\n\t\t\topen={isOpen}\r\n\t\t\tonClose={onCancel}\r\n\t\t\taria-labelledby=\"dialog-title\"\r\n\t\t\tPaperProps={{ sx: defaultPaperStyle }}\r\n\t\t>``\r\n\t\t\t{title && (\r\n\t\t\t\t<DialogTitle>\r\n\t\t\t\t\t<Typography\r\n\t\t\t\t\t\tvariant=\"labelLarge\"\r\n\t\t\t\t\t\tcolor={colors.onSurface}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{title}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t</DialogTitle>\r\n\t\t\t)}\r\n\r\n\t\t\t<DialogContent\r\n\t\t\t\tsx={{ padding: { xs: \"24px 24px 0 24px\", sm: \"24px 24px 0 24px\" } }}\r\n\t\t\t>\r\n\t\t\t\t{description && (\r\n\t\t\t\t\t<Typography\r\n\t\t\t\t\t\tsx={{ color: \"#656369\", fontSize: 14 }}\r\n\t\t\t\t\t\tvariant=\"bodyMedium\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{description}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t)}\r\n\t\t\t</DialogContent>\r\n\r\n\t\t\t<DialogActions sx={{ padding: 3 }}>\r\n\t\t\t\t<Grid\r\n\t\t\t\t\tcontainer\r\n\t\t\t\t\tdirection=\"row\"\r\n\t\t\t\t\tjustifyContent=\"end\"\r\n\t\t\t\t\talignItems=\"center\"\r\n\t\t\t\t\tgap={1}\r\n\t\t\t\t>\r\n\t\t\t\t\t<Button variant=\"text\" onClick={onCancel}>\r\n\t\t\t\t\t\t{cancelLabel}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tvariant=\"text\"\r\n\t\t\t\t\t\tcolor=\"error\"\r\n\t\t\t\t\t\tdisabled={isLoading}\r\n onClick={() => onSubmit()}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{submitLabel}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</Grid>\r\n\t\t\t</DialogActions>\r\n\t\t</Dialog>\r\n\t);\r\n};\r\n\r\nexport default ModalDialog;\r\n","import type { FC } from \"react\";\r\nimport ModalDialog from \"../modal/HModalDialog\";\r\ninterface Props {\r\n isLoading: boolean;\r\n\tonCancel: () => void;\r\n\tonSubmit:() => void;\r\n}\r\n\r\nfunction HPresetDeleteDialog(props: Props) {\r\n\r\n return (\r\n <ModalDialog\r\n isOpen\r\n title=\"Delete preset?\"\r\n description=\"The preset will be permanently removed.\"\r\n isLoading={props.isLoading}\r\n onCancel={props.onCancel}\r\n submitLabel=\"Delete\"\r\n onSubmit={props.onSubmit} />\r\n );\r\n}; \r\n\r\nexport default HPresetDeleteDialog;","import type { FC } from \"react\";\r\nimport {\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n Typography,\r\n useTheme,\r\n TextField,\r\n} from \"@mui/material\";\r\nimport useColors from '../../themes/colors';\r\nimport useHonchoTypography from \"../../themes/honchoTheme\";\r\n\r\n// isLoading prop removed from the interface\r\ninterface ModalRenameProps {\r\n isOpen: boolean;\r\n title?: string;\r\n description?: string;\r\n action?: React.ReactNode;\r\n onCancel: () => void;\r\n onSubmit: () => void;\r\n cancelLabel?: string;\r\n submitLabel?: string;\r\n valueName: string;\r\n setName: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n}\r\n\r\nconst defaultPaperStyle = {\r\n borderRadius: \"28px\",\r\n width: { xs: \"100%\", sm: \"456px\" },\r\n boxShadow: \"none\",\r\n};\r\n\r\nfunction ModalRename(props: ModalRenameProps){\r\n const {\r\n isOpen,\r\n title,\r\n onCancel,\r\n onSubmit,\r\n cancelLabel = \"Cancel\",\r\n submitLabel = \"Confirm\",\r\n valueName,\r\n setName\r\n } = props;\r\n const colors = useColors();\r\n const theme = useTheme();\r\n const typography = useHonchoTypography();\r\n\r\n return (\r\n <Dialog\r\n disableScrollLock\r\n open={isOpen}\r\n onClose={onCancel}\r\n aria-labelledby=\"dialog-title\"\r\n PaperProps={{ sx: defaultPaperStyle }}\r\n >\r\n {title && (\r\n <DialogTitle>\r\n <Typography\r\n variant=\"labelLarge\"\r\n color={colors.onSurface}\r\n >\r\n {title}\r\n </Typography>\r\n </DialogTitle>\r\n )}\r\n\r\n <DialogContent\r\n sx={{ padding: { xs: \"24px 24px 0 24px\", sm: \"24px 24px 0 24px\" } }}\r\n >\r\n <TextField\r\n autoFocus\r\n margin=\"dense\"\r\n id=\"name\"\r\n label=\"Preset Name\"\r\n type=\"text\"\r\n fullWidth\r\n variant=\"standard\"\r\n value={valueName} // Switched to controlled component\r\n onChange={setName}\r\n sx={{ \r\n backgroundColor: \"#F6F6F6\", \r\n p: \"7px\",\r\n borderRadius: \"6px\",\r\n '& .MuiInputLabel-root': {\r\n color: colors.onSurfaceVariant,\r\n pt: '10px',\r\n pl: '10px',\r\n },\r\n '& .MuiInput-input': {\r\n color: colors.onSurface,\r\n },\r\n '& .MuiInputLabel-root.Mui-focused': {\r\n color: colors.onSurfaceVariant,\r\n },\r\n }}\r\n />\r\n </DialogContent>\r\n\r\n <DialogActions sx={{ padding: 3 }}>\r\n <Grid\r\n container\r\n direction=\"row\"\r\n justifyContent=\"end\"\r\n alignItems=\"center\"\r\n gap={1}\r\n >\r\n <Button variant=\"text\" onClick={onCancel}>\r\n {cancelLabel}\r\n </Button>\r\n <Button\r\n variant=\"text\"\r\n color=\"info\"\r\n // The \"disabled\" attribute has been removed\r\n onClick={onSubmit}\r\n >\r\n {submitLabel}\r\n </Button>\r\n </Grid>\r\n </DialogActions>\r\n </Dialog>\r\n );\r\n};\r\n\r\nexport default ModalRename;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,oCAAAA,UAAAC,SAAA;AAAA;AAyBA,QAAM,oBAAoB;AAAA,MACtB,aAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,MAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,YAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,UAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,UAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,UAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,YAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,SAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,QAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,QAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;AAAA,MAC7D,SAAa,EAAE,KAAK,MAAM,KAAK,KAAK,SAAS,GAAK,MAAM,EAAK;A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AAK;AAAA,YAEL;AAAA,4DAAC,4BAAO,SAAQ,QAAO,SAAS,UAC3B,uBACL;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACG,SAAQ;AAAA,kBACR,OAAM;AAAA,kBAEN,SAAS;AAAA,kBAER;AAAA;AAAA,cACL;AAAA;AAAA;AAAA,QACJ,GACJ;AAAA;AAAA;AAAA,EACJ;AAER;AAEA,IAAO,uBAAQ;","names":["exports","module","HonchoEditor","import_react","batchStartIndex","import_react","import_react","error","presetToAdjustmentState","adjustmentsMatch","import_react","import_react","config","allImageIds","import_react","error","mapColorAdjustmentToAdjustmentState","import_material","import_material","import_jsx_runtime","import_material","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_react","import_material","import_jsx_runtime","React","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","ExpandMoreIcon","import_material","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_jsx_runtime","import_material","import_jsx_runtime","import_jsx_runtime","subTabs","import_material","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","import_material","import_jsx_runtime","CloseIcon","import_material","import_react","import_material","import_jsx_runtime","import_jsx_runtime","Masonry","import_react","import_react","error","import_jsx_runtime","import_react","import_react","import_material","import_jsx_runtime","import_jsx_runtime","import_material","import_jsx_runtime","defaultPaperStyle"]}