@yogiswara/honcho-editor-ui 2.1.12 → 2.1.14
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.
|
@@ -6,6 +6,7 @@ import GalleryImageItem from "./ImageItem";
|
|
|
6
6
|
const AlbumImageGallery = (props) => {
|
|
7
7
|
const { imageCollection, isSelectedMode, isHiddenGallery, enableEditor, // Destructure the new prop
|
|
8
8
|
onPreview, onSelectedMode, onToggleSelect, } = props;
|
|
9
|
+
console.log("imageCollection: ", imageCollection);
|
|
9
10
|
return (_jsx("section", { children: _jsx(ResponsiveMasonry, { columnsCountBreakPoints: { 750: 2, 900: 4 }, children: _jsx(Masonry, { children: imageCollection.map((photo, index) => {
|
|
10
11
|
// This guard clause is still important for runtime safety.
|
|
11
12
|
if (!photo.key || !photo.src) {
|
|
@@ -26,7 +27,7 @@ const AlbumImageGallery = (props) => {
|
|
|
26
27
|
};
|
|
27
28
|
return (_jsx(Box, { sx: { m: 0.5 }, children: _jsx(GalleryImageItem, { margin: "0px", index: index,
|
|
28
29
|
// UPDATED: Pass the new, correctly-typed object.
|
|
29
|
-
photo: imageItemPhotoProps, direction: "column", isFullScreenMode: false, isSelected: photo.isSelected, isSelectedMode: isSelectedMode, isHiddenGallery: isHiddenGallery, onPreview: onPreview(photo), onSelectedMode: onSelectedMode, onToggleSelect: onToggleSelect(photo), enableEditor: enableEditor, adjustments: photo.adjustments, frame: photo.frame }) }, photo.key));
|
|
30
|
+
photo: imageItemPhotoProps, direction: "column", isFullScreenMode: false, isSelected: photo.isSelected, isSelectedMode: isSelectedMode, isHiddenGallery: isHiddenGallery, onPreview: onPreview(photo), onSelectedMode: onSelectedMode, onToggleSelect: onToggleSelect(photo), enableEditor: enableEditor, adjustments: photo.adjustments, frame: photo.frame, data: photo }) }, photo.key));
|
|
30
31
|
}) }) }) }));
|
|
31
32
|
};
|
|
32
33
|
export default AlbumImageGallery;
|
|
@@ -20,8 +20,9 @@ const selectedImgStyle = {
|
|
|
20
20
|
// transition: "transform .135s cubic-bezier(0.0,0.0,0.2,1),opacity linear .15s"
|
|
21
21
|
};
|
|
22
22
|
const GalleryImageItem = (props) => {
|
|
23
|
-
const { photo, margin, adjustments, isSelected = false } = props;
|
|
23
|
+
const { photo, margin, adjustments, isSelected = false, data } = props;
|
|
24
24
|
const theme = useTheme();
|
|
25
|
+
const imageData = data;
|
|
25
26
|
const hasAdjustments = useMemo(() => {
|
|
26
27
|
if (!adjustments)
|
|
27
28
|
return false;
|
|
@@ -159,6 +160,6 @@ const GalleryImageItem = (props) => {
|
|
|
159
160
|
xs: props.isSelectedMode ? "visible" : "hidden",
|
|
160
161
|
sm: "visible",
|
|
161
162
|
},
|
|
162
|
-
}, className: "checkbox", children: _jsx(TickCircle, { style: { width: "24px", height: "24px" }, color: "white" }) }))), _jsx(CardMedia, { id: "card_media", component: "img", className: "image", loading: "lazy", alt:
|
|
163
|
+
}, className: "checkbox", children: _jsx(TickCircle, { style: { width: "24px", height: "24px" }, color: "white" }) }))), _jsx(CardMedia, { id: "card_media", component: "img", className: "image", loading: "lazy", alt: imageData.alt ?? "Image", sx: imageSx, src: imageData.src, width: "100%", onClick: handleImageClick })] }, photo.key));
|
|
163
164
|
};
|
|
164
165
|
export default GalleryImageItem;
|