@yogiswara/honcho-editor-ui 1.3.9 → 1.3.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.
|
@@ -188,6 +188,18 @@ export declare function useHonchoEditor(controller: Controller, initImageId: str
|
|
|
188
188
|
toggleBulkEditing: () => void;
|
|
189
189
|
handleSelectBulkPreset: (event: SelectChangeEvent<string>) => void;
|
|
190
190
|
currentAdjustmentsState: AdjustmentState;
|
|
191
|
+
setTempScore: (value: number | ((prev: number) => number)) => void;
|
|
192
|
+
setTintScore: (value: number | ((prev: number) => number)) => void;
|
|
193
|
+
setVibranceScore: (value: number | ((prev: number) => number)) => void;
|
|
194
|
+
setSaturationScore: (value: number | ((prev: number) => number)) => void;
|
|
195
|
+
setExposureScore: (value: number | ((prev: number) => number)) => void;
|
|
196
|
+
setHighlightsScore: (value: number | ((prev: number) => number)) => void;
|
|
197
|
+
setShadowsScore: (value: number | ((prev: number) => number)) => void;
|
|
198
|
+
setWhitesScore: (value: number | ((prev: number) => number)) => void;
|
|
199
|
+
setBlacksScore: (value: number | ((prev: number) => number)) => void;
|
|
200
|
+
setContrastScore: (value: number | ((prev: number) => number)) => void;
|
|
201
|
+
setClarityScore: (value: number | ((prev: number) => number)) => void;
|
|
202
|
+
setSharpnessScore: (value: number | ((prev: number) => number)) => void;
|
|
191
203
|
setCurrentAdjustmentsState: import("react").Dispatch<import("react").SetStateAction<AdjustmentState>>;
|
|
192
204
|
imageList: ImageItem[];
|
|
193
205
|
adjustmentsMap: Map<string, AdjustmentState>;
|
|
@@ -996,6 +996,55 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
996
996
|
canvasRef.current.style.transform = `scale(${zoomLevel})`;
|
|
997
997
|
}
|
|
998
998
|
}, [zoomLevel]);
|
|
999
|
+
const setTempScore = (value) => {
|
|
1000
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.tempScore) : value;
|
|
1001
|
+
updateAdjustments({ tempScore: newValue });
|
|
1002
|
+
};
|
|
1003
|
+
const setTintScore = (value) => {
|
|
1004
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.tintScore) : value;
|
|
1005
|
+
updateAdjustments({ tintScore: newValue });
|
|
1006
|
+
};
|
|
1007
|
+
// ...and so on for all 12 adjustments. Here are the rest:
|
|
1008
|
+
const setVibranceScore = (value) => {
|
|
1009
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.vibranceScore) : value;
|
|
1010
|
+
updateAdjustments({ vibranceScore: newValue });
|
|
1011
|
+
};
|
|
1012
|
+
const setSaturationScore = (value) => {
|
|
1013
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.saturationScore) : value;
|
|
1014
|
+
updateAdjustments({ saturationScore: newValue });
|
|
1015
|
+
};
|
|
1016
|
+
const setExposureScore = (value) => {
|
|
1017
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.exposureScore) : value;
|
|
1018
|
+
updateAdjustments({ exposureScore: newValue });
|
|
1019
|
+
};
|
|
1020
|
+
const setHighlightsScore = (value) => {
|
|
1021
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.highlightsScore) : value;
|
|
1022
|
+
updateAdjustments({ highlightsScore: newValue });
|
|
1023
|
+
};
|
|
1024
|
+
const setShadowsScore = (value) => {
|
|
1025
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.shadowsScore) : value;
|
|
1026
|
+
updateAdjustments({ shadowsScore: newValue });
|
|
1027
|
+
};
|
|
1028
|
+
const setWhitesScore = (value) => {
|
|
1029
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.whitesScore) : value;
|
|
1030
|
+
updateAdjustments({ whitesScore: newValue });
|
|
1031
|
+
};
|
|
1032
|
+
const setBlacksScore = (value) => {
|
|
1033
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.blacksScore) : value;
|
|
1034
|
+
updateAdjustments({ blacksScore: newValue });
|
|
1035
|
+
};
|
|
1036
|
+
const setContrastScore = (value) => {
|
|
1037
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.contrastScore) : value;
|
|
1038
|
+
updateAdjustments({ contrastScore: newValue });
|
|
1039
|
+
};
|
|
1040
|
+
const setClarityScore = (value) => {
|
|
1041
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.clarityScore) : value;
|
|
1042
|
+
updateAdjustments({ clarityScore: newValue });
|
|
1043
|
+
};
|
|
1044
|
+
const setSharpnessScore = (value) => {
|
|
1045
|
+
const newValue = typeof value === 'function' ? value(currentAdjustmentsState.sharpnessScore) : value;
|
|
1046
|
+
updateAdjustments({ sharpnessScore: newValue });
|
|
1047
|
+
};
|
|
999
1048
|
// Undo, Redo, Revert
|
|
1000
1049
|
const handleRevert = useCallback(() => {
|
|
1001
1050
|
setCurrentAdjustmentsState(initialAdjustments);
|
|
@@ -1198,6 +1247,18 @@ export function useHonchoEditor(controller, initImageId, firebaseUid) {
|
|
|
1198
1247
|
handleSelectBulkPreset,
|
|
1199
1248
|
// Adjustment State & Setters
|
|
1200
1249
|
currentAdjustmentsState,
|
|
1250
|
+
setTempScore,
|
|
1251
|
+
setTintScore,
|
|
1252
|
+
setVibranceScore,
|
|
1253
|
+
setSaturationScore,
|
|
1254
|
+
setExposureScore,
|
|
1255
|
+
setHighlightsScore,
|
|
1256
|
+
setShadowsScore,
|
|
1257
|
+
setWhitesScore,
|
|
1258
|
+
setBlacksScore,
|
|
1259
|
+
setContrastScore,
|
|
1260
|
+
setClarityScore,
|
|
1261
|
+
setSharpnessScore,
|
|
1201
1262
|
setCurrentAdjustmentsState,
|
|
1202
1263
|
// Bulk Adjustment Handlers
|
|
1203
1264
|
// Note: These handlers are for image list
|