@deepnoid/canvas 0.1.75 → 0.1.76

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.
@@ -141,12 +141,24 @@ const AnnotationCanvas = ({ image, annotations = [], setAnnotations, options, dr
141
141
  }, [image, resetOnImageChange]);
142
142
  /* ---------- External annotations ---------- */
143
143
  useEffect(() => {
144
+ console.log('External annotations effect:', {
145
+ imageLoading: imageLoadingRef.current,
146
+ hasEngine: !!engineRef.current,
147
+ annotationsLength: annotations.length,
148
+ pendingLength: pendingAnnotationsRef.current?.length,
149
+ });
144
150
  if (imageLoadingRef.current || !engineRef.current) {
151
+ console.log('Saving to pending annotations');
145
152
  pendingAnnotationsRef.current = annotations;
146
153
  return;
147
154
  }
148
155
  const before = engineRef.current.getAnnotations();
156
+ console.log('Comparing annotations:', {
157
+ before: before.length,
158
+ after: annotations.length,
159
+ });
149
160
  if (JSON.stringify(before) !== JSON.stringify(annotations)) {
161
+ console.log('Setting new annotations to engine');
150
162
  engineRef.current.setAnnotations(annotations);
151
163
  engineRef.current.commitHistory();
152
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/canvas",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",