@yogiswara/honcho-editor-ui 3.1.23 → 3.2.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,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
- import { Stack, Slider, Typography } from "@mui/material";
3
+ import { Stack, Slider, Typography, Box } from "@mui/material";
4
4
  import useHonchoTypography from "../../themes/honchoTheme";
5
5
  import useColors from '../../themes/colors';
6
6
  import useSliderEvents from "../editor/sliderComponents/useSliderEvents";
@@ -96,161 +96,222 @@ export default function HSliderLightMobile(props) {
96
96
  color: colors.surface,
97
97
  width: "40px", // Keep the fixed width for alignment
98
98
  textAlign: "right", // Keep the text alignment
99
- }, children: formatValue(props.exposureScore) })] }), _jsx(Slider, { sx: {
100
- width: "100%",
101
- color: colors.onSurfaceVariant,
102
- '& .MuiSlider-rail': {
103
- background: colors.onSurfaceVariant,
104
- opacity: 1,
105
- },
106
- '& .MuiSlider-thumb': {
107
- background: colors.surface,
108
- boxShadow: 'none',
109
- opacity: 1,
110
- pointerEvents: 'auto',
111
- },
112
- '& .MuiSlider-thumb:hover': {
113
- boxShadow: 'none',
114
- pointerEvents: 'auto',
115
- }
116
- }, slotProps: {
117
- thumb: {
118
- ref: exposureSliderRef
119
- }
120
- }, size: "small", value: props.exposureScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onExposureChange("exposureScore", newValue), onDoubleClick: exposureInput.handleDoubleClick }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: contrastInput.handleDoubleClick, children: "Contrast" }), _jsx(Typography, { sx: {
99
+ }, children: formatValue(props.exposureScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
100
+ position: 'absolute',
101
+ top: "-5px",
102
+ bottom: "-5px",
103
+ // Offset by 16px to align with the slider's track inside the component
104
+ left: 0,
105
+ right: 0,
106
+ zIndex: 1,
107
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
108
+ } }), _jsx(Slider, { sx: {
109
+ width: "100%",
110
+ color: colors.onSurfaceVariant,
111
+ '& .MuiSlider-rail': {
112
+ background: colors.onSurfaceVariant,
113
+ opacity: 1,
114
+ pointerEvents: 'none',
115
+ },
116
+ '& .MuiSlider-thumb': {
117
+ background: colors.surface,
118
+ boxShadow: 'none',
119
+ opacity: 1,
120
+ pointerEvents: 'auto',
121
+ },
122
+ '& .MuiSlider-thumb:hover': {
123
+ boxShadow: 'none',
124
+ pointerEvents: 'auto',
125
+ }
126
+ }, slotProps: {
127
+ thumb: {
128
+ ref: exposureSliderRef,
129
+ onDoubleClick: exposureInput.handleDoubleClick
130
+ }
131
+ }, size: "small", value: props.exposureScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onExposureChange("exposureScore", newValue) })] }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: contrastInput.handleDoubleClick, children: "Contrast" }), _jsx(Typography, { sx: {
121
132
  ...typography.bodyMedium, // Use your standard typography
122
133
  color: colors.surface,
123
134
  width: "40px", // Keep the fixed width for alignment
124
135
  textAlign: "right", // Keep the text alignment
125
- }, children: formatValue(props.contrastScore) })] }), _jsx(Slider, { sx: {
126
- width: "100%",
127
- color: colors.onSurfaceVariant,
128
- '& .MuiSlider-rail': {
129
- background: colors.onSurfaceVariant,
130
- opacity: 1,
131
- pointerEvents: 'none',
132
- },
133
- '& .MuiSlider-thumb': {
134
- background: colors.surface,
135
- boxShadow: 'none',
136
- opacity: 1,
137
- pointerEvents: 'auto',
138
- },
139
- '& .MuiSlider-thumb:hover': {
140
- boxShadow: 'none',
141
- pointerEvents: 'auto',
142
- }
143
- }, slotProps: {
144
- thumb: {
145
- ref: contrastSliderRef
146
- }
147
- }, size: "small", value: props.contrastScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onContrastChange("contrastScore", newValue), onDoubleClick: contrastInput.handleDoubleClick }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: highlightsInput.handleDoubleClick, children: "Highlights" }), _jsx(Typography, { sx: {
136
+ }, children: formatValue(props.contrastScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
137
+ position: 'absolute',
138
+ top: "-5px",
139
+ bottom: "-5px",
140
+ // Offset by 16px to align with the slider's track inside the component
141
+ left: 0,
142
+ right: 0,
143
+ zIndex: 1,
144
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
145
+ } }), _jsx(Slider, { sx: {
146
+ width: "100%",
147
+ color: colors.onSurfaceVariant,
148
+ '& .MuiSlider-rail': {
149
+ background: colors.onSurfaceVariant,
150
+ opacity: 1,
151
+ pointerEvents: 'none',
152
+ },
153
+ '& .MuiSlider-thumb': {
154
+ background: colors.surface,
155
+ boxShadow: 'none',
156
+ opacity: 1,
157
+ pointerEvents: 'auto',
158
+ },
159
+ '& .MuiSlider-thumb:hover': {
160
+ boxShadow: 'none',
161
+ pointerEvents: 'auto',
162
+ }
163
+ }, slotProps: {
164
+ thumb: {
165
+ ref: contrastSliderRef,
166
+ onDoubleClick: contrastInput.handleDoubleClick
167
+ }
168
+ }, size: "small", value: props.contrastScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onContrastChange("contrastScore", newValue) })] }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: highlightsInput.handleDoubleClick, children: "Highlights" }), _jsx(Typography, { sx: {
148
169
  ...typography.bodyMedium, // Use your standard typography
149
170
  color: colors.surface,
150
171
  width: "40px", // Keep the fixed width for alignment
151
172
  textAlign: "right", // Keep the text alignment
152
- }, children: formatValue(props.highlightsScore) })] }), _jsx(Slider, { sx: {
153
- width: "100%",
154
- color: colors.onSurfaceVariant,
155
- '& .MuiSlider-rail': {
156
- background: colors.onSurfaceVariant,
157
- opacity: 1,
158
- pointerEvents: 'none',
159
- },
160
- '& .MuiSlider-thumb': {
161
- background: colors.surface,
162
- boxShadow: 'none',
163
- opacity: 1,
164
- pointerEvents: 'auto',
165
- },
166
- '& .MuiSlider-thumb:hover': {
167
- boxShadow: 'none',
168
- pointerEvents: 'auto',
169
- }
170
- }, slotProps: {
171
- thumb: {
172
- ref: highlightsSliderRef
173
- }
174
- }, size: "small", value: props.highlightsScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onHighlightsChange("highlightsScore", newValue), onDoubleClick: highlightsInput.handleDoubleClick }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: shadowsInput.handleDoubleClick, children: "Shadows" }), _jsx(Typography, { sx: {
173
+ }, children: formatValue(props.highlightsScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
174
+ position: 'absolute',
175
+ top: "-5px",
176
+ bottom: "-5px",
177
+ // Offset by 16px to align with the slider's track inside the component
178
+ left: 0,
179
+ right: 0,
180
+ zIndex: 1,
181
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
182
+ } }), _jsx(Slider, { sx: {
183
+ width: "100%",
184
+ color: colors.onSurfaceVariant,
185
+ '& .MuiSlider-rail': {
186
+ background: colors.onSurfaceVariant,
187
+ opacity: 1,
188
+ pointerEvents: 'none',
189
+ },
190
+ '& .MuiSlider-thumb': {
191
+ background: colors.surface,
192
+ boxShadow: 'none',
193
+ opacity: 1,
194
+ pointerEvents: 'auto',
195
+ },
196
+ '& .MuiSlider-thumb:hover': {
197
+ boxShadow: 'none',
198
+ pointerEvents: 'auto',
199
+ }
200
+ }, slotProps: {
201
+ thumb: {
202
+ ref: highlightsSliderRef,
203
+ onDoubleClick: highlightsInput.handleDoubleClick
204
+ }
205
+ }, size: "small", value: props.highlightsScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onHighlightsChange("highlightsScore", newValue) })] }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: shadowsInput.handleDoubleClick, children: "Shadows" }), _jsx(Typography, { sx: {
175
206
  ...typography.bodyMedium, // Use your standard typography
176
207
  color: colors.surface,
177
208
  width: "40px", // Keep the fixed width for alignment
178
209
  textAlign: "right", // Keep the text alignment
179
- }, children: formatValue(props.shadowScore) })] }), _jsx(Slider, { sx: {
180
- width: "100%",
181
- color: colors.onSurfaceVariant,
182
- '& .MuiSlider-rail': {
183
- background: colors.onSurfaceVariant,
184
- opacity: 1,
185
- pointerEvents: 'none',
186
- },
187
- '& .MuiSlider-thumb': {
188
- background: colors.surface,
189
- boxShadow: 'none',
190
- opacity: 1,
191
- pointerEvents: 'auto',
192
- },
193
- '& .MuiSlider-thumb:hover': {
194
- boxShadow: 'none',
195
- pointerEvents: 'auto',
196
- }
197
- }, slotProps: {
198
- thumb: {
199
- ref: shadowsSliderRef
200
- }
201
- }, size: "small", value: props.shadowScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onShadowsChange("shadowsScore", newValue), onDoubleClick: shadowsInput.handleDoubleClick }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: whitesInput.handleDoubleClick, children: "Whites" }), _jsx(Typography, { sx: {
210
+ }, children: formatValue(props.shadowScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
211
+ position: 'absolute',
212
+ top: "-5px",
213
+ bottom: "-5px",
214
+ // Offset by 16px to align with the slider's track inside the component
215
+ left: 0,
216
+ right: 0,
217
+ zIndex: 1,
218
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
219
+ } }), _jsx(Slider, { sx: {
220
+ width: "100%",
221
+ color: colors.onSurfaceVariant,
222
+ '& .MuiSlider-rail': {
223
+ background: colors.onSurfaceVariant,
224
+ opacity: 1,
225
+ pointerEvents: 'none',
226
+ },
227
+ '& .MuiSlider-thumb': {
228
+ background: colors.surface,
229
+ boxShadow: 'none',
230
+ opacity: 1,
231
+ pointerEvents: 'auto',
232
+ },
233
+ '& .MuiSlider-thumb:hover': {
234
+ boxShadow: 'none',
235
+ pointerEvents: 'auto',
236
+ }
237
+ }, slotProps: {
238
+ thumb: {
239
+ ref: shadowsSliderRef,
240
+ onDoubleClick: shadowsInput.handleDoubleClick
241
+ }
242
+ }, size: "small", value: props.shadowScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onShadowsChange("shadowsScore", newValue) })] }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: whitesInput.handleDoubleClick, children: "Whites" }), _jsx(Typography, { sx: {
202
243
  ...typography.bodyMedium, // Use your standard typography
203
244
  color: colors.surface,
204
245
  width: "40px", // Keep the fixed width for alignment
205
246
  textAlign: "right", // Keep the text alignment
206
- }, children: formatValue(props.whiteScore) })] }), _jsx(Slider, { sx: {
207
- width: "100%",
208
- color: colors.onSurfaceVariant,
209
- '& .MuiSlider-rail': {
210
- background: colors.onSurfaceVariant,
211
- opacity: 1,
212
- pointerEvents: 'none',
213
- },
214
- '& .MuiSlider-thumb': {
215
- background: colors.surface,
216
- boxShadow: 'none',
217
- opacity: 1,
218
- pointerEvents: 'auto',
219
- },
220
- '& .MuiSlider-thumb:hover': {
221
- boxShadow: 'none',
222
- pointerEvents: 'auto',
223
- }
224
- }, slotProps: {
225
- thumb: {
226
- ref: whitesSliderRef
227
- }
228
- }, size: "small", value: props.whiteScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onWhitesChange("whitesScore", newValue), onDoubleClick: whitesInput.handleDoubleClick }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: blacksInput.handleDoubleClick, children: "Blacks" }), _jsx(Typography, { sx: {
247
+ }, children: formatValue(props.whiteScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
248
+ position: 'absolute',
249
+ top: "-5px",
250
+ bottom: "-5px",
251
+ // Offset by 16px to align with the slider's track inside the component
252
+ left: 0,
253
+ right: 0,
254
+ zIndex: 1,
255
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
256
+ } }), _jsx(Slider, { sx: {
257
+ width: "100%",
258
+ color: colors.onSurfaceVariant,
259
+ '& .MuiSlider-rail': {
260
+ background: colors.onSurfaceVariant,
261
+ opacity: 1,
262
+ pointerEvents: 'none',
263
+ },
264
+ '& .MuiSlider-thumb': {
265
+ background: colors.surface,
266
+ boxShadow: 'none',
267
+ opacity: 1,
268
+ pointerEvents: 'auto',
269
+ },
270
+ '& .MuiSlider-thumb:hover': {
271
+ boxShadow: 'none',
272
+ pointerEvents: 'auto',
273
+ }
274
+ }, slotProps: {
275
+ thumb: {
276
+ ref: whitesSliderRef,
277
+ onDoubleClick: whitesInput.handleDoubleClick
278
+ }
279
+ }, size: "small", value: props.whiteScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onWhitesChange("whitesScore", newValue) })] }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pt: '10px', pb: '0px' }, children: [_jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface, userSelect: 'none' }, onDoubleClick: blacksInput.handleDoubleClick, children: "Blacks" }), _jsx(Typography, { sx: {
229
280
  ...typography.bodyMedium, // Use your standard typography
230
281
  color: colors.surface,
231
282
  width: "40px", // Keep the fixed width for alignment
232
283
  textAlign: "right", // Keep the text alignment
233
- }, children: formatValue(props.blackScore) })] }), _jsx(Slider, { sx: {
234
- width: "100%",
235
- color: colors.onSurfaceVariant,
236
- '& .MuiSlider-rail': {
237
- background: colors.onSurfaceVariant,
238
- opacity: 1,
239
- pointerEvents: 'none',
240
- },
241
- '& .MuiSlider-thumb': {
242
- background: colors.surface,
243
- boxShadow: 'none',
244
- opacity: 1,
245
- pointerEvents: 'auto',
246
- },
247
- '& .MuiSlider-thumb:hover': {
248
- boxShadow: 'none',
249
- pointerEvents: 'auto',
250
- }
251
- }, slotProps: {
252
- thumb: {
253
- ref: blacksSliderRef
254
- }
255
- }, size: "small", value: props.blackScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onBlacksChange("blacksScore", newValue), onDoubleClick: blacksInput.handleDoubleClick })] }) }));
284
+ }, children: formatValue(props.blackScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
285
+ position: 'absolute',
286
+ top: "-5px",
287
+ bottom: "-5px",
288
+ // Offset by 16px to align with the slider's track inside the component
289
+ left: 0,
290
+ right: 0,
291
+ zIndex: 1,
292
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
293
+ } }), _jsx(Slider, { sx: {
294
+ width: "100%",
295
+ color: colors.onSurfaceVariant,
296
+ '& .MuiSlider-rail': {
297
+ background: colors.onSurfaceVariant,
298
+ opacity: 1,
299
+ pointerEvents: 'none',
300
+ },
301
+ '& .MuiSlider-thumb': {
302
+ background: colors.surface,
303
+ boxShadow: 'none',
304
+ opacity: 1,
305
+ pointerEvents: 'auto',
306
+ },
307
+ '& .MuiSlider-thumb:hover': {
308
+ boxShadow: 'none',
309
+ pointerEvents: 'auto',
310
+ }
311
+ }, slotProps: {
312
+ thumb: {
313
+ ref: blacksSliderRef,
314
+ onDoubleClick: blacksInput.handleDoubleClick
315
+ }
316
+ }, size: "small", value: props.blackScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onBlacksChange("blacksScore", newValue) })] })] }) }));
256
317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yogiswara/honcho-editor-ui",
3
- "version": "3.1.23",
3
+ "version": "3.2.0",
4
4
  "description": "A complete UI component library for the Honcho photo editor.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",