@yogiswara/honcho-editor-ui 2.10.20 → 2.11.0
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.
|
@@ -1,52 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AdjustmentState } from '../../hooks/editor/type';
|
|
3
|
-
type Preset = {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
2
|
interface Props {
|
|
8
|
-
|
|
9
|
-
activePanel: string;
|
|
3
|
+
activePanelMobile: string;
|
|
10
4
|
activeSubPanel: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
setActivePanelMobile: (tab: string) => void;
|
|
6
|
+
subNavigation: React.ReactNode;
|
|
7
|
+
panelContent: React.ReactNode;
|
|
14
8
|
panelRef: React.RefObject<HTMLDivElement>;
|
|
15
9
|
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
16
10
|
panelHeight: number;
|
|
17
11
|
handleDragStart: (e: React.MouseEvent | React.TouchEvent) => void;
|
|
18
|
-
onContentHeightChange: (height: number) => void;
|
|
19
|
-
tempScore: number;
|
|
20
|
-
tintScore: number;
|
|
21
|
-
vibranceScore: number;
|
|
22
|
-
saturationScore: number;
|
|
23
|
-
exposureScore: number;
|
|
24
|
-
highlightsScore: number;
|
|
25
|
-
shadowScore: number;
|
|
26
|
-
whiteScore: number;
|
|
27
|
-
blackScore: number;
|
|
28
|
-
contrastScore: number;
|
|
29
|
-
clarityScore: number;
|
|
30
|
-
sharpnessScore: number;
|
|
31
|
-
setTempScore: (field: keyof AdjustmentState, value: number) => void;
|
|
32
|
-
setTintScore: (field: keyof AdjustmentState, value: number) => void;
|
|
33
|
-
setVibranceScore: (field: keyof AdjustmentState, value: number) => void;
|
|
34
|
-
setSaturationScore: (field: keyof AdjustmentState, value: number) => void;
|
|
35
|
-
onExposureChange: (field: keyof AdjustmentState, value: number) => void;
|
|
36
|
-
onHighlightsChange: (field: keyof AdjustmentState, value: number) => void;
|
|
37
|
-
onShadowsChange: (field: keyof AdjustmentState, value: number) => void;
|
|
38
|
-
onWhitesChange: (field: keyof AdjustmentState, value: number) => void;
|
|
39
|
-
onBlacksChange: (field: keyof AdjustmentState, value: number) => void;
|
|
40
|
-
onContrastChange: (field: keyof AdjustmentState, value: number) => void;
|
|
41
|
-
onClarityChange: (field: keyof AdjustmentState, value: number) => void;
|
|
42
|
-
onSharpnessChange: (field: keyof AdjustmentState, value: number) => void;
|
|
43
|
-
isBatchMode: boolean;
|
|
44
|
-
onDragStart: () => void;
|
|
45
|
-
onDragEnd: () => void;
|
|
46
|
-
selectedPreset: string | null;
|
|
47
|
-
onSelectPreset: (id: string) => void;
|
|
48
|
-
onOpenPresetModal: () => void;
|
|
49
|
-
presetOptionModal: (event: React.MouseEvent<HTMLElement>, presetId: string) => void;
|
|
50
12
|
}
|
|
51
13
|
export default function HImageEditorMobile(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
52
14
|
export {};
|
|
@@ -1,43 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import useColors from '../../themes/colors';
|
|
5
|
-
import HTabColorAdjustmentMobile from "./HTabColorAdjustmentMobile";
|
|
6
|
-
import HTabPresetMobile from "./HTabPresetMobile";
|
|
7
|
-
// Data structure for the sub-navigation tabs
|
|
8
|
-
const subTabs = {
|
|
9
|
-
colorAdjustment: [
|
|
10
|
-
{ value: "color", label: "Color", inactiveIcon: "/v1/svg/new-mobile-coloAdjustment-notpress.svg", activeIcon: "/v1/svg/new-mobile-coloAdjustment-presssvg.svg" },
|
|
11
|
-
{ value: "light", label: "Light", inactiveIcon: "/v1/svg/light-inactive-mobile.svg", activeIcon: "/v1/svg/light-active-mobile.svg" },
|
|
12
|
-
// { value: "details", label: "Details", inactiveIcon: "/v1/svg/details-inactive-mobile.svg", activeIcon: "/v1/svg/details-active-mobile.svg"},
|
|
13
|
-
],
|
|
14
|
-
aspectRatio: [
|
|
15
|
-
{ value: "portrait", label: "Portrait" },
|
|
16
|
-
{ value: "square", label: "Square" },
|
|
17
|
-
{ value: "wide", label: "Wide" },
|
|
18
|
-
],
|
|
19
|
-
preset: [
|
|
20
|
-
{ value: "Preset", label: "Preset", inactiveIcon: "/v1/svg/preset-inactive-mobile.svg", activeIcon: "/v1/svg/preset-active-mobile.svg" },
|
|
21
|
-
],
|
|
22
|
-
};
|
|
2
|
+
import { Box, Paper, Stack } from "@mui/material";
|
|
3
|
+
// The hardcoded `subTabs` and `renderPanelContent` are now removed.
|
|
23
4
|
export default function HImageEditorMobile(props) {
|
|
24
|
-
|
|
25
|
-
const colors = useColors();
|
|
26
|
-
console.log(`[HImageEditorMobile TEMPERATURE] Rendering with tempScore: ${props.tempScore}, isBatchMode: ${props.isBatchMode}`);
|
|
5
|
+
// The handleChange function now only needs the renamed prop
|
|
27
6
|
const handleChange = (event, newValue) => {
|
|
28
|
-
props.
|
|
29
|
-
};
|
|
30
|
-
const currentSubTabs = subTabs[props.activePanel];
|
|
31
|
-
// Helper function to render the correct content inside the draggable panel
|
|
32
|
-
const renderPanelContent = () => {
|
|
33
|
-
switch (props.activePanel) {
|
|
34
|
-
case 'colorAdjustment':
|
|
35
|
-
return _jsx(HTabColorAdjustmentMobile, { activeSubPanel: props.activeSubPanel, innerRef: props.innerRef, onDragStart: props.onDragStart, onDragEnd: props.onDragEnd, onExposureChange: props.onExposureChange, onContrastChange: props.onContrastChange, onHighlightsChange: props.onHighlightsChange, onShadowsChange: props.onShadowsChange, onWhitesChange: props.onWhitesChange, onBlacksChange: props.onBlacksChange, setTempScore: props.setTempScore, setTintScore: props.setTintScore, setVibranceScore: props.setVibranceScore, setSaturationScore: props.setSaturationScore, exposureScore: props.exposureScore, contrastScore: props.contrastScore, highlightsScore: props.highlightsScore, shadowScore: props.shadowScore, whiteScore: props.whiteScore, blackScore: props.blackScore, tempScore: props.tempScore, tintScore: props.tintScore, vibranceScore: props.vibranceScore, saturationScore: props.saturationScore, isBatchMode: props.isBatchMode, sharpnessScore: props.sharpnessScore, onSharpnessChange: props.onSharpnessChange, clarityScore: props.clarityScore, onClarityChange: props.onClarityChange });
|
|
36
|
-
case 'preset':
|
|
37
|
-
return _jsx(HTabPresetMobile, { ...props });
|
|
38
|
-
default:
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
7
|
+
props.setActivePanelMobile(newValue);
|
|
41
8
|
};
|
|
42
9
|
return (_jsx(Paper, { elevation: 0, sx: {
|
|
43
10
|
id: 'HImageEditorMobile',
|
|
@@ -71,23 +38,5 @@ export default function HImageEditorMobile(props) {
|
|
|
71
38
|
overflowY: 'auto',
|
|
72
39
|
scrollbarWidth: 'none',
|
|
73
40
|
'&::-webkit-scrollbar': { display: 'none' },
|
|
74
|
-
}, children:
|
|
75
|
-
backgroundColor: colors.onBackground,
|
|
76
|
-
paddingTop: "10px",
|
|
77
|
-
pb: "0px",
|
|
78
|
-
mb: "0px",
|
|
79
|
-
px: "44px",
|
|
80
|
-
borderRadius: "0px",
|
|
81
|
-
}, elevation: 3, children: _jsx(BottomNavigation, { showLabels: true, sx: { backgroundColor: colors.onBackground, gap: '10px' }, children: currentSubTabs.map((tab) => {
|
|
82
|
-
const isActive = props.activeSubPanel === tab.value;
|
|
83
|
-
const iconSrc = isActive ? tab.activeIcon : tab.inactiveIcon;
|
|
84
|
-
return (_jsx(BottomNavigationAction, { label: tab.label, value: tab.value, onClick: () => props.setActiveSubPanel(isActive ? '' : tab.value), icon: iconSrc && _jsx(CardMedia, { component: "img", image: iconSrc, sx: { width: "20px", height: "20px", mb: "5px" } }), sx: {
|
|
85
|
-
color: isActive ? colors.surface : colors.onSurfaceVariant1,
|
|
86
|
-
minWidth: 'auto', p: 0,
|
|
87
|
-
'& .MuiBottomNavigationAction-label': {
|
|
88
|
-
...typography.labelSmall,
|
|
89
|
-
color: isActive ? colors.surface : colors.onSurfaceVariant1,
|
|
90
|
-
}
|
|
91
|
-
} }, tab.value));
|
|
92
|
-
}) }) })), _jsx(Paper, { sx: { backgroundColor: colors.onBackground, borderRadius: "0px" }, elevation: 3, children: _jsx(Stack, { direction: "row", justifyContent: "center", alignItems: "center", sx: { pt: "0px", pb: "0px", mb: "0px", mr: "0px", ml: "0px" }, children: _jsxs(BottomNavigation, { value: props.activePanel, onChange: handleChange, sx: { backgroundColor: colors.onBackground }, children: [_jsx(BottomNavigationAction, { value: "colorAdjustment", sx: { px: '12px', py: '0px', minWidth: 'auto' }, icon: _jsx(CardMedia, { component: "img", image: props.activePanel === 'colorAdjustment' ? "/v1/svg/color-adjustment-active-mobile.svg" : "/v1/svg/color-adjustment-inactive-mobile.svg", sx: { width: "20px", height: "20px" } }) }), _jsx(BottomNavigationAction, { value: "preset", sx: { px: '12px', py: '0px', minWidth: 'auto' }, icon: _jsx(CardMedia, { component: "img", image: props.activePanel === 'preset' ? "/v1/svg/preset-and-watermark-active-mobile.svg" : "/v1/svg/preset-and-watermark-inactive-mobile.svg", sx: { width: "20px", height: "20px" } }) })] }) }) })] }) }));
|
|
41
|
+
}, children: props.panelContent })] })), props.subNavigation] }) }));
|
|
93
42
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export { ImageSize, HonchoEditor, AdjustmentValues, AdjustmentRange, AdjustmentR
|
|
|
33
33
|
export { default as HPresetDeleteDialog } from './components/editor/HPresetDelete';
|
|
34
34
|
export { default as HModalDialog } from './components/modal/HModalDialog';
|
|
35
35
|
export { default as HModalRename } from './components/modal/HModalRename';
|
|
36
|
+
export { default as HTabColorAdjustmentMobile } from './components/editor/HTabColorAdjustmentMobile';
|
|
37
|
+
export { default as HTabPresetMobile } from './components/editor/HTabPresetMobile';
|
|
36
38
|
export { useAdjustmentHistory, type UseAdjustmentHistoryReturn, type HistoryInfo, type HistoryActions, type HistoryConfig } from './hooks/useAdjustmentHistory';
|
|
37
39
|
export { useAdjustmentHistoryBatch, type UseAdjustmentHistoryBatchReturn, type BatchAdjustmentState, type ImageAdjustmentConfig, type BatchHistoryInfo, type BatchHistoryActions, type BatchHistoryConfig } from './hooks/useAdjustmentHistoryBatch';
|
|
38
40
|
export { usePreset, type UsePresetReturn, type PresetInfo, type PresetActions, type PresetOptions } from './hooks/usePreset';
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,8 @@ export { HonchoEditor } from './lib/editor/honcho-editor';
|
|
|
32
32
|
export { default as HPresetDeleteDialog } from './components/editor/HPresetDelete';
|
|
33
33
|
export { default as HModalDialog } from './components/modal/HModalDialog';
|
|
34
34
|
export { default as HModalRename } from './components/modal/HModalRename';
|
|
35
|
+
export { default as HTabColorAdjustmentMobile } from './components/editor/HTabColorAdjustmentMobile';
|
|
36
|
+
export { default as HTabPresetMobile } from './components/editor/HTabPresetMobile';
|
|
35
37
|
// --- History Hooks ---
|
|
36
38
|
export { useAdjustmentHistory } from './hooks/useAdjustmentHistory';
|
|
37
39
|
export { useAdjustmentHistoryBatch } from './hooks/useAdjustmentHistoryBatch';
|