@tbib-image-viewer/react 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1224,16 +1224,18 @@ var ImageViewer = ({
|
|
|
1224
1224
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1225
1225
|
}, [handleUndo, handleRedo, zoomIn, zoomOut, resetTransform]);
|
|
1226
1226
|
const handleDownloadAnnotated = async () => {
|
|
1227
|
-
|
|
1228
|
-
|
|
1227
|
+
const targetSource = effectiveSrc || imgRef.current?.src || "";
|
|
1228
|
+
if (!targetSource) return;
|
|
1229
|
+
await (0, import_core3.downloadAnnotatedImage)(targetSource, strokes, {
|
|
1229
1230
|
format: "image/png",
|
|
1230
1231
|
includeAnnotations: true,
|
|
1231
1232
|
fileName: `tbib-annotated-${Date.now()}.png`
|
|
1232
1233
|
});
|
|
1233
1234
|
};
|
|
1234
1235
|
const handleDownloadClean = async () => {
|
|
1235
|
-
|
|
1236
|
-
|
|
1236
|
+
const targetSource = effectiveSrc || imgRef.current?.src || "";
|
|
1237
|
+
if (!targetSource) return;
|
|
1238
|
+
await (0, import_core3.downloadAnnotatedImage)(targetSource, [], {
|
|
1237
1239
|
format: "image/png",
|
|
1238
1240
|
includeAnnotations: false,
|
|
1239
1241
|
fileName: `tbib-clean-${Date.now()}.png`
|
|
@@ -1649,16 +1651,18 @@ var ImageGalleryLightbox = ({
|
|
|
1649
1651
|
}
|
|
1650
1652
|
};
|
|
1651
1653
|
const handleDownloadAnnotated = async () => {
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
+
const targetSource = effectiveSrc || currentItem?.src || imgRef.current?.src || "";
|
|
1655
|
+
if (!targetSource) return;
|
|
1656
|
+
await (0, import_core4.downloadAnnotatedImage)(targetSource, strokes, {
|
|
1654
1657
|
format: "image/png",
|
|
1655
1658
|
includeAnnotations: true,
|
|
1656
1659
|
fileName: `tbib-gallery-${currentIndex + 1}-annotated.png`
|
|
1657
1660
|
});
|
|
1658
1661
|
};
|
|
1659
1662
|
const handleDownloadClean = async () => {
|
|
1660
|
-
|
|
1661
|
-
|
|
1663
|
+
const targetSource = effectiveSrc || currentItem?.src || imgRef.current?.src || "";
|
|
1664
|
+
if (!targetSource) return;
|
|
1665
|
+
await (0, import_core4.downloadAnnotatedImage)(targetSource, [], {
|
|
1662
1666
|
format: "image/png",
|
|
1663
1667
|
includeAnnotations: false,
|
|
1664
1668
|
fileName: `tbib-gallery-${currentIndex + 1}-clean.png`
|