@yogiswara/honcho-editor-ui 3.1.23 → 3.2.1

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,234 @@ 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
+ zIndex: 2,
122
+ },
123
+ '& .MuiSlider-thumb:hover': {
124
+ boxShadow: 'none',
125
+ pointerEvents: 'auto',
126
+ zIndex: 2,
127
+ }
128
+ }, slotProps: {
129
+ thumb: {
130
+ ref: exposureSliderRef,
131
+ onDoubleClick: exposureInput.handleDoubleClick
132
+ }
133
+ }, 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
134
  ...typography.bodyMedium, // Use your standard typography
122
135
  color: colors.surface,
123
136
  width: "40px", // Keep the fixed width for alignment
124
137
  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: {
138
+ }, children: formatValue(props.contrastScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
139
+ position: 'absolute',
140
+ top: "-5px",
141
+ bottom: "-5px",
142
+ // Offset by 16px to align with the slider's track inside the component
143
+ left: 0,
144
+ right: 0,
145
+ zIndex: 1,
146
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
147
+ } }), _jsx(Slider, { sx: {
148
+ width: "100%",
149
+ color: colors.onSurfaceVariant,
150
+ '& .MuiSlider-rail': {
151
+ background: colors.onSurfaceVariant,
152
+ opacity: 1,
153
+ pointerEvents: 'none',
154
+ },
155
+ '& .MuiSlider-thumb': {
156
+ background: colors.surface,
157
+ boxShadow: 'none',
158
+ opacity: 1,
159
+ pointerEvents: 'auto',
160
+ zIndex: 2,
161
+ },
162
+ '& .MuiSlider-thumb:hover': {
163
+ boxShadow: 'none',
164
+ pointerEvents: 'auto',
165
+ zIndex: 2,
166
+ }
167
+ }, slotProps: {
168
+ thumb: {
169
+ ref: contrastSliderRef,
170
+ onDoubleClick: contrastInput.handleDoubleClick
171
+ }
172
+ }, 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
173
  ...typography.bodyMedium, // Use your standard typography
149
174
  color: colors.surface,
150
175
  width: "40px", // Keep the fixed width for alignment
151
176
  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: {
177
+ }, children: formatValue(props.highlightsScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
178
+ position: 'absolute',
179
+ top: "-5px",
180
+ bottom: "-5px",
181
+ // Offset by 16px to align with the slider's track inside the component
182
+ left: 0,
183
+ right: 0,
184
+ zIndex: 1,
185
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
186
+ } }), _jsx(Slider, { sx: {
187
+ width: "100%",
188
+ color: colors.onSurfaceVariant,
189
+ '& .MuiSlider-rail': {
190
+ background: colors.onSurfaceVariant,
191
+ opacity: 1,
192
+ pointerEvents: 'none',
193
+ },
194
+ '& .MuiSlider-thumb': {
195
+ background: colors.surface,
196
+ boxShadow: 'none',
197
+ opacity: 1,
198
+ pointerEvents: 'auto',
199
+ zIndex: 2,
200
+ },
201
+ '& .MuiSlider-thumb:hover': {
202
+ boxShadow: 'none',
203
+ pointerEvents: 'auto',
204
+ zIndex: 2,
205
+ }
206
+ }, slotProps: {
207
+ thumb: {
208
+ ref: highlightsSliderRef,
209
+ onDoubleClick: highlightsInput.handleDoubleClick
210
+ }
211
+ }, 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
212
  ...typography.bodyMedium, // Use your standard typography
176
213
  color: colors.surface,
177
214
  width: "40px", // Keep the fixed width for alignment
178
215
  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: {
216
+ }, children: formatValue(props.shadowScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
217
+ position: 'absolute',
218
+ top: "-5px",
219
+ bottom: "-5px",
220
+ // Offset by 16px to align with the slider's track inside the component
221
+ left: 0,
222
+ right: 0,
223
+ zIndex: 1,
224
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
225
+ } }), _jsx(Slider, { sx: {
226
+ width: "100%",
227
+ color: colors.onSurfaceVariant,
228
+ '& .MuiSlider-rail': {
229
+ background: colors.onSurfaceVariant,
230
+ opacity: 1,
231
+ pointerEvents: 'none',
232
+ },
233
+ '& .MuiSlider-thumb': {
234
+ background: colors.surface,
235
+ boxShadow: 'none',
236
+ opacity: 1,
237
+ pointerEvents: 'auto',
238
+ zIndex: 2,
239
+ },
240
+ '& .MuiSlider-thumb:hover': {
241
+ boxShadow: 'none',
242
+ pointerEvents: 'auto',
243
+ zIndex: 2,
244
+ }
245
+ }, slotProps: {
246
+ thumb: {
247
+ ref: shadowsSliderRef,
248
+ onDoubleClick: shadowsInput.handleDoubleClick
249
+ }
250
+ }, 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
251
  ...typography.bodyMedium, // Use your standard typography
203
252
  color: colors.surface,
204
253
  width: "40px", // Keep the fixed width for alignment
205
254
  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: {
255
+ }, children: formatValue(props.whiteScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
256
+ position: 'absolute',
257
+ top: "-5px",
258
+ bottom: "-5px",
259
+ // Offset by 16px to align with the slider's track inside the component
260
+ left: 0,
261
+ right: 0,
262
+ zIndex: 1,
263
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
264
+ } }), _jsx(Slider, { sx: {
265
+ width: "100%",
266
+ color: colors.onSurfaceVariant,
267
+ '& .MuiSlider-rail': {
268
+ background: colors.onSurfaceVariant,
269
+ opacity: 1,
270
+ pointerEvents: 'none',
271
+ },
272
+ '& .MuiSlider-thumb': {
273
+ background: colors.surface,
274
+ boxShadow: 'none',
275
+ opacity: 1,
276
+ pointerEvents: 'auto',
277
+ zIndex: 2,
278
+ },
279
+ '& .MuiSlider-thumb:hover': {
280
+ boxShadow: 'none',
281
+ pointerEvents: 'auto',
282
+ zIndex: 2,
283
+ }
284
+ }, slotProps: {
285
+ thumb: {
286
+ ref: whitesSliderRef,
287
+ onDoubleClick: whitesInput.handleDoubleClick
288
+ }
289
+ }, 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
290
  ...typography.bodyMedium, // Use your standard typography
230
291
  color: colors.surface,
231
292
  width: "40px", // Keep the fixed width for alignment
232
293
  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 })] }) }));
294
+ }, children: formatValue(props.blackScore) })] }), _jsxs(Box, { sx: { position: 'relative', width: '100%' }, children: [_jsx("div", { style: {
295
+ position: 'absolute',
296
+ top: "-5px",
297
+ bottom: "-5px",
298
+ // Offset by 16px to align with the slider's track inside the component
299
+ left: 0,
300
+ right: 0,
301
+ zIndex: 1,
302
+ touchAction: 'manipulation', // ✅ 1. Add this to make double-tap reliable on mobile
303
+ } }), _jsx(Slider, { sx: {
304
+ width: "100%",
305
+ color: colors.onSurfaceVariant,
306
+ '& .MuiSlider-rail': {
307
+ background: colors.onSurfaceVariant,
308
+ opacity: 1,
309
+ pointerEvents: 'none',
310
+ },
311
+ '& .MuiSlider-thumb': {
312
+ background: colors.surface,
313
+ boxShadow: 'none',
314
+ opacity: 1,
315
+ pointerEvents: 'auto',
316
+ zIndex: 2,
317
+ },
318
+ '& .MuiSlider-thumb:hover': {
319
+ boxShadow: 'none',
320
+ pointerEvents: 'auto',
321
+ zIndex: 2,
322
+ }
323
+ }, slotProps: {
324
+ thumb: {
325
+ ref: blacksSliderRef,
326
+ onDoubleClick: blacksInput.handleDoubleClick
327
+ }
328
+ }, size: "small", value: props.blackScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onBlacksChange("blacksScore", newValue) })] })] }) }));
256
329
  }
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.1",
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",