@yogiswara/honcho-editor-ui 2.1.8 → 2.1.10
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/components/editor/GalleryAlbum/SimplifiedAlbumGallery.d.ts +17 -0
- package/dist/components/editor/GalleryAlbum/SimplifiedAlbumGallery.js +14 -0
- package/dist/components/editor/GalleryAlbum/SimplifiedImageItem.d.ts +8 -0
- package/dist/components/editor/GalleryAlbum/SimplifiedImageItem.js +30 -0
- package/dist/hooks/editor/useHonchoEditorBulk.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Gallery } from "../../../hooks/editor/type";
|
|
2
|
+
export interface PhotoData {
|
|
3
|
+
key: string;
|
|
4
|
+
src: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
alt: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
originalData: Gallery;
|
|
10
|
+
}
|
|
11
|
+
interface SimplifiedAlbumGalleryProps {
|
|
12
|
+
imageCollection: PhotoData[];
|
|
13
|
+
onToggleSelect: (photo: PhotoData) => void;
|
|
14
|
+
onPreview: (photo: PhotoData) => void;
|
|
15
|
+
}
|
|
16
|
+
export default function SimplifiedAlbumGallery({ imageCollection, onToggleSelect, onPreview }: SimplifiedAlbumGalleryProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import SimplifiedImageItem from './SimplifiedImageItem'; // Import the child component
|
|
4
|
+
export default function SimplifiedAlbumGallery({ imageCollection, onToggleSelect, onPreview }) {
|
|
5
|
+
return (_jsx(Box, { sx: {
|
|
6
|
+
display: 'grid',
|
|
7
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
|
|
8
|
+
gap: '16px',
|
|
9
|
+
width: '100%',
|
|
10
|
+
height: '100%',
|
|
11
|
+
overflowY: 'auto',
|
|
12
|
+
p: 1
|
|
13
|
+
}, children: imageCollection.map(photo => (_jsx(SimplifiedImageItem, { photo: photo, onToggleSelect: onToggleSelect, onPreview: onPreview }, photo.key))) }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PhotoData } from './SimplifiedAlbumGallery';
|
|
2
|
+
interface SimplifiedImageItemProps {
|
|
3
|
+
photo: PhotoData;
|
|
4
|
+
onToggleSelect: (photo: PhotoData) => void;
|
|
5
|
+
onPreview: (photo: PhotoData) => void;
|
|
6
|
+
}
|
|
7
|
+
export default function SimplifiedImageItem({ photo, onToggleSelect, onPreview }: SimplifiedImageItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box } from '@mui/material';
|
|
4
|
+
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
5
|
+
import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked';
|
|
6
|
+
export default function SimplifiedImageItem({ photo, onToggleSelect, onPreview }) {
|
|
7
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
8
|
+
return (_jsxs(Box, { onClick: () => onPreview(photo), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), sx: {
|
|
9
|
+
position: 'relative',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
borderRadius: '8px',
|
|
13
|
+
'& img': {
|
|
14
|
+
display: 'block',
|
|
15
|
+
width: '100%',
|
|
16
|
+
transition: 'transform 0.2s ease-in-out',
|
|
17
|
+
transform: isHovered ? 'scale(1.05)' : 'scale(1)',
|
|
18
|
+
},
|
|
19
|
+
}, children: [_jsx("img", { src: photo.src, alt: photo.alt, style: { aspectRatio: `${photo.width} / ${photo.height}` } }), _jsx(Box, { onClick: (e) => {
|
|
20
|
+
e.stopPropagation(); // Prevent onPreview from firing when clicking checkbox
|
|
21
|
+
onToggleSelect(photo);
|
|
22
|
+
}, sx: {
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
top: '8px',
|
|
25
|
+
left: '8px',
|
|
26
|
+
color: 'white',
|
|
27
|
+
opacity: photo.isSelected || isHovered ? 1 : 0,
|
|
28
|
+
transition: 'opacity 0.2s ease-in-out',
|
|
29
|
+
}, children: photo.isSelected ? (_jsx(CheckCircleIcon, { sx: { fontSize: '28px', background: 'rgba(0,0,0,0.3)', borderRadius: '50%' } })) : (_jsx(RadioButtonUncheckedIcon, { sx: { fontSize: '28px', background: 'rgba(0,0,0,0.3)', borderRadius: '50%' } })) })] }));
|
|
30
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { default as HPresetOptionsMenu } from './components/editor/HPresetOption
|
|
|
23
23
|
export { HAlertInternetBox, HAlertCopyBox, HAlertInternetConnectionBox, HAlertPresetSave } from './components/editor/HAlertBox';
|
|
24
24
|
export { default as AlbumImageGallery } from './components/editor/GalleryAlbum/AlbumImageGallery';
|
|
25
25
|
export { default as GalleryImageItem } from './components/editor/GalleryAlbum/ImageItem';
|
|
26
|
+
export { default as SimplifiedAlbumGallery } from './components/editor/GalleryAlbum/SimplifiedAlbumGallery';
|
|
27
|
+
export { default as SimplifiedImageItem } from './components/editor/GalleryAlbum/SimplifiedImageItem';
|
|
26
28
|
export { useAdjustmentHistory, type UseAdjustmentHistoryReturn, type HistoryInfo, type HistoryActions, type HistoryConfig } from './hooks/useAdjustmentHistory';
|
|
27
29
|
export { useAdjustmentHistoryBatch, type UseAdjustmentHistoryBatchReturn, type BatchAdjustmentState, type ImageAdjustmentConfig, type BatchHistoryInfo, type BatchHistoryActions, type BatchHistoryConfig } from './hooks/useAdjustmentHistoryBatch';
|
|
28
30
|
export { default as useColors } from './themes/colors';
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export { default as HPresetOptionsMenu } from './components/editor/HPresetOption
|
|
|
20
20
|
export { HAlertInternetBox, HAlertCopyBox, HAlertInternetConnectionBox, HAlertPresetSave } from './components/editor/HAlertBox';
|
|
21
21
|
export { default as AlbumImageGallery } from './components/editor/GalleryAlbum/AlbumImageGallery';
|
|
22
22
|
export { default as GalleryImageItem } from './components/editor/GalleryAlbum/ImageItem';
|
|
23
|
+
export { default as SimplifiedAlbumGallery } from './components/editor/GalleryAlbum/SimplifiedAlbumGallery';
|
|
24
|
+
export { default as SimplifiedImageItem } from './components/editor/GalleryAlbum/SimplifiedImageItem';
|
|
23
25
|
// --- History Hooks ---
|
|
24
26
|
export { useAdjustmentHistory } from './hooks/useAdjustmentHistory';
|
|
25
27
|
export { useAdjustmentHistoryBatch } from './hooks/useAdjustmentHistoryBatch';
|