@yogiswara/honcho-editor-ui 1.4.6 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -298,14 +298,13 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
298
298
  const file = new File([blob], filename, { type: blob.type });
299
299
  await editorRef.current.loadImageFromFile(file);
300
300
  setIsImageLoaded(true);
301
- updateCanvasEditor();
302
301
  }
303
302
  catch (error) {
304
303
  console.error(error);
305
304
  setEditorStatus("Error: Could not load image from URL.");
306
305
  setIsImageLoaded(false);
307
306
  }
308
- }, [editorRef.current, updateCanvasEditor]);
307
+ }, [editorRef.current]);
309
308
  const handleScriptReady = useCallback(async () => {
310
309
  console.log("[Editor] Script tag is ready."); // Log entry
311
310
  if (typeof window.Module === 'function' && !editorRef.current) {
@@ -647,7 +646,7 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
647
646
  const pathGallery = extractPathFromGallery(galleryImageData);
648
647
  // load image to editor
649
648
  await loadImageEditorFromUrl(pathGallery);
650
- console.log("Image loaded to editor");
649
+ updateCanvasEditor();
651
650
  // adjustment setup
652
651
  if (adjustmentData) {
653
652
  const adjustmentState = mapColorAdjustmentToAdjustmentState(adjustmentData);
@@ -659,14 +658,14 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
659
658
  }
660
659
  };
661
660
  init();
662
- }, [galleryImageData, editorRef.current]);
661
+ }, [galleryImageData, editorRef.current, updateCanvasEditor]);
663
662
  useEffect(() => {
664
663
  // Render photo if adjustmentState change;
665
- if (!editorRef.current)
664
+ if (!editorRef.current || !isImageLoaded)
666
665
  return;
667
666
  editorRef.current.setAdjustments(mapAdjustmentStateToAdjustmentEditor(currentAdjustmentsState));
668
667
  updateCanvasEditor();
669
- }, [editorRef.current, currentAdjustmentsState]);
668
+ }, [editorRef.current, currentAdjustmentsState, isImageLoaded]);
670
669
  useEffect(() => {
671
670
  window.addEventListener('keydown', handleKeyDown);
672
671
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yogiswara/honcho-editor-ui",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "A complete UI component library for the Honcho photo editor.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",