@yogiswara/honcho-editor-ui 2.0.3 → 2.0.5
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.
|
@@ -74,7 +74,7 @@ export default function HSliderLightMobile(props) {
|
|
|
74
74
|
'& .MuiSlider-thumb:hover': {
|
|
75
75
|
boxShadow: 'none',
|
|
76
76
|
}
|
|
77
|
-
}, size: "small", value: props.exposureScore, step:
|
|
77
|
+
}, size: "small", value: props.exposureScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onExposureChange(newValue) }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface }, children: "Contrast" }), _jsx(TextField, { hiddenLabel: true, id: "filled-hidden-label-small", value: formatValue(props.contrastScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onContrastChange), sx: {
|
|
78
78
|
width: "40px",
|
|
79
79
|
alignItems: "center",
|
|
80
80
|
textAlign: "right",
|
|
@@ -8,7 +8,6 @@ const initialAdjustments = {
|
|
|
8
8
|
tempScore: 0, tintScore: 0, vibranceScore: 0, exposureScore: 0, highlightsScore: 0, shadowsScore: 0,
|
|
9
9
|
whitesScore: 0, blacksScore: 0, saturationScore: 0, contrastScore: 0, clarityScore: 0, sharpnessScore: 0,
|
|
10
10
|
};
|
|
11
|
-
// const clamp = (value: number) => Math.max(-100, Math.min(100, value));
|
|
12
11
|
export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
13
12
|
const { onSwipeNext, onSwipePrev, isNextAvailable, isPrevAvailable, isLoading: isGalleryLoading, error: galleryError, currentImageData: galleryImageData } = useGallerySwipe(firebaseUid, initImageId, controller);
|
|
14
13
|
// The useAdjustmentHistory hook now manages all undo/redo and adjustment state logic.
|
|
@@ -40,7 +39,7 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
40
39
|
const [headerMenuAnchorEl, setHeaderMenuAnchorEl] = useState(null);
|
|
41
40
|
const [anchorMenuZoom, setAnchorMenuZoom] = useState(null);
|
|
42
41
|
// Panel Expansion State
|
|
43
|
-
const [colorAdjustmentExpandedPanels, setColorAdjustmentExpandedPanels] = useState(['whiteBalance']);
|
|
42
|
+
const [colorAdjustmentExpandedPanels, setColorAdjustmentExpandedPanels] = useState(['whiteBalance', 'light', 'details']);
|
|
44
43
|
const [presetExpandedPanels, setPresetExpandedPanels] = useState(['preset']);
|
|
45
44
|
// Watermark State
|
|
46
45
|
const [isCreatingWatermark, setIsCreatingWatermark] = useState(false);
|
|
@@ -52,7 +51,6 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
52
51
|
const [isPresetCreated, setIsPresetCreated] = useState(false);
|
|
53
52
|
const [selectedMobilePreset, setSelectedMobilePreset] = useState('preset1');
|
|
54
53
|
const [selectedDesktopPreset, setSelectedDesktopPreset] = useState('preset1');
|
|
55
|
-
// const [selectedBulkPreset, setSelectedBulkPreset] = useState<string>('preset1');
|
|
56
54
|
const [presetMenuAnchorEl, setPresetMenuAnchorEl] = useState(null);
|
|
57
55
|
const [activePresetMenuId, setActivePresetMenuId] = useState(null);
|
|
58
56
|
const [isRenameModalOpen, setRenameModalOpen] = useState(false);
|
|
@@ -90,30 +88,6 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
90
88
|
const contentRef = useRef(null);
|
|
91
89
|
// Effect for keyboard shortcuts
|
|
92
90
|
// MARK: - Core Editor Logic
|
|
93
|
-
// MARK: Batch Edit logic
|
|
94
|
-
// const handleToggleImageSelection = useCallback((imageId: string) => {
|
|
95
|
-
// const newSelectedIds = new Set(selectedImageIds);
|
|
96
|
-
// const isCurrentlySelected = newSelectedIds.has(imageId);
|
|
97
|
-
// if (isCurrentlySelected) {
|
|
98
|
-
// if (newSelectedIds.size > 1) {
|
|
99
|
-
// newSelectedIds.delete(imageId);
|
|
100
|
-
// }
|
|
101
|
-
// } else {
|
|
102
|
-
// newSelectedIds.add(imageId);
|
|
103
|
-
// // Apply the current UI's adjustments to the newly selected image.
|
|
104
|
-
// setAdjustmentsMap(prevMap => {
|
|
105
|
-
// const newMap = new Map(prevMap);
|
|
106
|
-
// const currentUiState = {
|
|
107
|
-
// tempScore, tintScore, vibranceScore, saturationScore,
|
|
108
|
-
// exposureScore, highlightsScore, shadowsScore, whitesScore,
|
|
109
|
-
// blacksScore, contrastScore, clarityScore, sharpnessScore
|
|
110
|
-
// };
|
|
111
|
-
// newMap.set(imageId, currentUiState);
|
|
112
|
-
// return newMap;
|
|
113
|
-
// });
|
|
114
|
-
// }
|
|
115
|
-
// setSelectedImageIds(newSelectedIds);
|
|
116
|
-
// }, [selectedImageIds, tempScore, tintScore, vibranceScore, saturationScore, exposureScore, highlightsScore, shadowsScore, whitesScore, blacksScore, contrastScore, clarityScore, sharpnessScore]);
|
|
117
91
|
// Mobile Panel Drag Handlers
|
|
118
92
|
const handleContentHeightChange = useCallback((height) => {
|
|
119
93
|
if (height > 0 && height !== contentHeight)
|
|
@@ -164,7 +138,7 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
164
138
|
return;
|
|
165
139
|
if ((event.ctrlKey || event.metaKey) && event.key === 'c') {
|
|
166
140
|
event.preventDefault();
|
|
167
|
-
handleOpenCopyDialog();
|
|
141
|
+
handleOpenCopyDialog();
|
|
168
142
|
}
|
|
169
143
|
}, [ /* handleOpenCopyDialog dependency */]);
|
|
170
144
|
const extractPathFromGallery = useCallback((data) => {
|
|
@@ -224,7 +198,6 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
224
198
|
return;
|
|
225
199
|
controller.handleBack(firebaseUid, galleryImageData.id);
|
|
226
200
|
}, [controller, firebaseUid, galleryImageData]);
|
|
227
|
-
// MARK: - UI Handlers (Moved from page.tsx)
|
|
228
201
|
// MARK: - UI Handlers
|
|
229
202
|
// Panel Handlers
|
|
230
203
|
const handleColorAccordionChange = (panel) => (_, isExpanded) => {
|