@antimatter-audio/antimatter-ui 16.6.0 → 16.8.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.
- package/dist/index.js +314 -252
- package/dist/index.js.map +1 -1
- package/dist/types/advanced/BevelContainer/BevelContainer.d.ts +2 -2
- package/dist/types/advanced/BevelContainer/BevelContainer.d.ts.map +1 -1
- package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualization.d.ts +1 -1
- package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualization.d.ts.map +1 -1
- package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualizationSVG.d.ts +1 -1
- package/dist/types/advanced/CircularDiagramStyleVisualization/CircularDiagramStyleVisualizationSVG.d.ts.map +1 -1
- package/dist/types/advanced/ControlGroupWrapper/ControlGroupWrapper.d.ts +1 -1
- package/dist/types/advanced/ControlGroupWrapper/ControlGroupWrapper.d.ts.map +1 -1
- package/dist/types/advanced/IconButton/IconButton.d.ts +1 -1
- package/dist/types/advanced/IconButton/IconButton.d.ts.map +1 -1
- package/dist/types/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts +1 -1
- package/dist/types/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts.map +1 -1
- package/dist/types/advanced/LFOIntensityMeter/LFOIntensityMeter.d.ts +1 -1
- package/dist/types/advanced/LFOIntensityMeter/LFOIntensityMeter.d.ts.map +1 -1
- package/dist/types/advanced/LFOVisualizer/LFOVisualizer.d.ts +1 -1
- package/dist/types/advanced/LFOVisualizer/LFOVisualizer.d.ts.map +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrix.d.ts +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrix.d.ts.map +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixCell.d.ts +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixComboboxCell.d.ts +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixComboboxCell.d.ts.map +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixRow.d.ts +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixRow.d.ts.map +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixToggleCell.d.ts +1 -1
- package/dist/types/advanced/ModMatrix/ModMatrixToggleCell.d.ts.map +1 -1
- package/dist/types/advanced/ModuleFooter/InputModTab.d.ts +1 -1
- package/dist/types/advanced/ModuleFooter/InputModTab.d.ts.map +1 -1
- package/dist/types/advanced/ModuleFooter/LFOBox.d.ts +1 -1
- package/dist/types/advanced/ModuleFooter/LFOBox.d.ts.map +1 -1
- package/dist/types/advanced/ModuleFooter/LFOTab.d.ts +1 -1
- package/dist/types/advanced/ModuleFooter/LFOTab.d.ts.map +1 -1
- package/dist/types/advanced/ModuleFooter/ModuleFooter.d.ts +4 -4
- package/dist/types/advanced/ModuleFooter/ModuleFooter.d.ts.map +1 -1
- package/dist/types/advanced/ModuleFooter/SeqPanel.d.ts +1 -1
- package/dist/types/advanced/ModuleFooter/SeqPanel.d.ts.map +1 -1
- package/dist/types/advanced/ModuleFooter/SeqTab.d.ts +1 -1
- package/dist/types/advanced/ModuleFooter/SeqTab.d.ts.map +1 -1
- package/dist/types/advanced/ModuleHeader/ModuleHeader.d.ts +1 -1
- package/dist/types/advanced/ModuleHeader/ModuleHeader.d.ts.map +1 -1
- package/dist/types/advanced/Oscilloscope/LinePlot.d.ts +1 -1
- package/dist/types/advanced/Oscilloscope/LinePlot.d.ts.map +1 -1
- package/dist/types/advanced/Oscilloscope/Oscilloscope.d.ts +1 -1
- package/dist/types/advanced/Oscilloscope/Oscilloscope.d.ts.map +1 -1
- package/dist/types/advanced/OuterGlowFilter.d.ts +1 -1
- package/dist/types/advanced/OuterGlowFilter.d.ts.map +1 -1
- package/dist/types/advanced/PresetManager/PresetManager.d.ts +1 -1
- package/dist/types/advanced/PresetManager/PresetManager.d.ts.map +1 -1
- package/dist/types/advanced/StepSequencer/StepSequencer.d.ts +1 -1
- package/dist/types/advanced/StepSequencer/StepSequencer.d.ts.map +1 -1
- package/dist/types/advanced/ThemeWrapper/ThemeWrapper.d.ts +1 -1
- package/dist/types/advanced/ThemeWrapper/ThemeWrapper.d.ts.map +1 -1
- package/dist/types/advanced/VUMeter/VUMeter.d.ts +1 -1
- package/dist/types/advanced/VUMeter/VUMeter.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +11 -1
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/common/utils.d.ts +67 -14
- package/dist/types/common/utils.d.ts.map +1 -1
- package/dist/types/common/utils.test.d.ts +2 -0
- package/dist/types/common/utils.test.d.ts.map +1 -0
- package/dist/types/context/GlobalContextProvider.d.ts +1 -1
- package/dist/types/context/GlobalContextProvider.d.ts.map +1 -1
- package/dist/types/core/Box/Box.d.ts +1 -1
- package/dist/types/core/Box/Box.d.ts.map +1 -1
- package/dist/types/core/Button/Button.d.ts +1 -1
- package/dist/types/core/Button/Button.d.ts.map +1 -1
- package/dist/types/core/Chart/AnimationDataWrapper.d.ts +1 -1
- package/dist/types/core/Chart/AnimationDataWrapper.d.ts.map +1 -1
- package/dist/types/core/Chart/Area.d.ts +1 -1
- package/dist/types/core/Chart/Area.d.ts.map +1 -1
- package/dist/types/core/Chart/Bar.d.ts +1 -1
- package/dist/types/core/Chart/Bar.d.ts.map +1 -1
- package/dist/types/core/Chart/Chart.d.ts +1 -1
- package/dist/types/core/Chart/Chart.d.ts.map +1 -1
- package/dist/types/core/Chart/Line.d.ts +1 -1
- package/dist/types/core/Chart/Line.d.ts.map +1 -1
- package/dist/types/core/Chart/LineChart/LineChart.d.ts +1 -1
- package/dist/types/core/Chart/LineChart/LineChart.d.ts.map +1 -1
- package/dist/types/core/Chart/LineChart/LineChartCanvas.d.ts +1 -1
- package/dist/types/core/Chart/LineChart/LineChartCanvas.d.ts.map +1 -1
- package/dist/types/core/Chart/LineChart/LineChartSvg.d.ts +1 -1
- package/dist/types/core/Chart/LineChart/LineChartSvg.d.ts.map +1 -1
- package/dist/types/core/Chart/StackedChart.d.ts +1 -1
- package/dist/types/core/Chart/StackedChart.d.ts.map +1 -1
- package/dist/types/core/Chart/Ticks.d.ts +1 -1
- package/dist/types/core/Chart/Ticks.d.ts.map +1 -1
- package/dist/types/core/Combobox/Combobox.d.ts +1 -1
- package/dist/types/core/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/core/Combobox/ComboboxComponent.d.ts +1 -1
- package/dist/types/core/Combobox/ComboboxComponent.d.ts.map +1 -1
- package/dist/types/core/Combobox/ListboxComponent.d.ts +1 -1
- package/dist/types/core/Combobox/ListboxComponent.d.ts.map +1 -1
- package/dist/types/core/DataViz/SingleBarViz.d.ts +1 -1
- package/dist/types/core/DataViz/SingleBarViz.d.ts.map +1 -1
- package/dist/types/core/Heading/Heading.d.ts +1 -1
- package/dist/types/core/Heading/Heading.d.ts.map +1 -1
- package/dist/types/core/Icon/Icon.d.ts +29 -29
- package/dist/types/core/Icon/Icon.d.ts.map +1 -1
- package/dist/types/core/Indicators/IndicatorLight.d.ts +1 -1
- package/dist/types/core/Indicators/IndicatorLight.d.ts.map +1 -1
- package/dist/types/core/Input/Input.d.ts +1 -1
- package/dist/types/core/Input/Input.d.ts.map +1 -1
- package/dist/types/core/Label/Label.d.ts +1 -1
- package/dist/types/core/Label/Label.d.ts.map +1 -1
- package/dist/types/core/PositioningWrapper/PositioningWrapper.d.ts +1 -1
- package/dist/types/core/PositioningWrapper/PositioningWrapper.d.ts.map +1 -1
- package/dist/types/core/Slider/BarSlider.d.ts +5 -2
- package/dist/types/core/Slider/BarSlider.d.ts.map +1 -1
- package/dist/types/core/Slider/RotaryCircle.d.ts +1 -1
- package/dist/types/core/Slider/RotaryCircle.d.ts.map +1 -1
- package/dist/types/core/Slider/RotaryCombobox.d.ts +1 -1
- package/dist/types/core/Slider/RotaryCombobox.d.ts.map +1 -1
- package/dist/types/core/Slider/RotarySlider.d.ts +1 -1
- package/dist/types/core/Slider/RotarySlider.d.ts.map +1 -1
- package/dist/types/core/Slider/Slider.d.ts +1 -1
- package/dist/types/core/Slider/Slider.d.ts.map +1 -1
- package/dist/types/core/Slider/SliderSVG.d.ts +3 -3
- package/dist/types/core/Slider/SliderSVG.d.ts.map +1 -1
- package/dist/types/core/Tabs/Tabs.d.ts +1 -1
- package/dist/types/core/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/core/Toggle/Toggle.d.ts +2 -1
- package/dist/types/core/Toggle/Toggle.d.ts.map +1 -1
- package/dist/types/hooks/useCombobox.d.ts +2 -2
- package/dist/types/hooks/useCombobox.d.ts.map +1 -1
- package/dist/types/hooks/useGroupFocus.d.ts +2 -1
- package/dist/types/hooks/useGroupFocus.d.ts.map +1 -1
- package/dist/types/hooks/useSlider.d.ts.map +1 -1
- package/package.json +9 -3
package/dist/index.js
CHANGED
|
@@ -193,7 +193,19 @@ var IncrementType;
|
|
|
193
193
|
IncrementType["fine"] = "fine";
|
|
194
194
|
IncrementType["standard"] = "standard";
|
|
195
195
|
IncrementType["button"] = "button";
|
|
196
|
+
IncrementType["index"] = "index";
|
|
197
|
+
IncrementType["indexButton"] = "indexButton";
|
|
196
198
|
})(IncrementType || (IncrementType = {}));
|
|
199
|
+
var NumberType;
|
|
200
|
+
(function(NumberType) {
|
|
201
|
+
NumberType["float"] = "float";
|
|
202
|
+
NumberType["integer"] = "integer";
|
|
203
|
+
})(NumberType || (NumberType = {}));
|
|
204
|
+
var StepDirection;
|
|
205
|
+
(function(StepDirection) {
|
|
206
|
+
StepDirection["up"] = "up";
|
|
207
|
+
StepDirection["down"] = "down";
|
|
208
|
+
})(StepDirection || (StepDirection = {}));
|
|
197
209
|
|
|
198
210
|
var SliderType;
|
|
199
211
|
(function(SliderType) {
|
|
@@ -262,7 +274,7 @@ const clamp = (val, min = 0, max = 1)=>{
|
|
|
262
274
|
};
|
|
263
275
|
function snapToLegalValue({ value, properties }) {
|
|
264
276
|
const { interval, start, end } = properties;
|
|
265
|
-
if (interval
|
|
277
|
+
if (interval === 0) return value;
|
|
266
278
|
const roundedInterval = parseFloat(interval?.toFixed(2));
|
|
267
279
|
const formattedValue = start + roundedInterval * Math.floor((value - start) / roundedInterval + 0.5);
|
|
268
280
|
return parseFloat(clamp(formattedValue, start, end)?.toFixed(2));
|
|
@@ -371,25 +383,59 @@ const randomizeValue = (min, max)=>{
|
|
|
371
383
|
// min?: number;
|
|
372
384
|
// max?: number;
|
|
373
385
|
// }
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
const constrainedNumStepsMultiplier = incrementType === IncrementType.standard ? Math.abs(numSteps * 0.01) : 1;
|
|
377
|
-
const newValue = parseFloat(((prevVal ?? 0) + interval * velocityMultiplier * constrainedNumStepsMultiplier * Math.sign(delta ?? 1))?.toFixed(2));
|
|
378
|
-
return newValue;
|
|
386
|
+
const getTotalNumStepsMultiplier = (incrementType, numSteps)=>{
|
|
387
|
+
return incrementType === IncrementType.standard || incrementType === IncrementType.button ? Math.max(Math.abs(numSteps * 0.01), 1) : 1;
|
|
379
388
|
};
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
const incrementValue = ({ incrementType, sliderNumSteps, comboboxNumChoices, delta, startingValue, buttonIncrement, buttonDirection = StepDirection.up, sliderInterval, sliderMin, sliderMax })=>{
|
|
390
|
+
const hasButtonIncrementType = incrementType === IncrementType.button || incrementType === IncrementType.indexButton;
|
|
391
|
+
const hasVelocity = incrementType === IncrementType.standard || incrementType === IncrementType.index;
|
|
392
|
+
const isFloatValue = incrementType === IncrementType.standard || incrementType === IncrementType.fine || incrementType === IncrementType.button;
|
|
393
|
+
// const velocityMultiplier: number = 1;
|
|
394
|
+
const buttonIncrementMultiplier = hasButtonIncrementType && buttonIncrement ? Math.abs(buttonIncrement) : 1;
|
|
395
|
+
const totalNumStepsMultiplier = getTotalNumStepsMultiplier(incrementType, (isFloatValue ? sliderNumSteps : comboboxNumChoices) ?? 0);
|
|
396
|
+
const deltaMultiplier = hasVelocity ? Math.abs(delta ?? 1) : 1;
|
|
397
|
+
const signMultiplier = hasButtonIncrementType ? Math.sign(buttonDirection === StepDirection.down ? -1 : 1) : Math.sign(delta ?? 1);
|
|
398
|
+
const returnVal = (startingValue ?? 0) + (incrementType === IncrementType.indexButton || incrementType === IncrementType.index ? 1 : sliderInterval ?? 0) * signMultiplier * deltaMultiplier * buttonIncrementMultiplier * totalNumStepsMultiplier;
|
|
399
|
+
return isFloatValue ? Math.max(sliderMin, Math.min(parseFloat(returnVal?.toFixed(2)), sliderMax)) : Math.max(0, Math.min((comboboxNumChoices ?? 0) - 1, Math.round(returnVal)));
|
|
400
|
+
};
|
|
401
|
+
const incrementSlider = ({ delta, incrementType, startingValue, sliderInterval, sliderNumSteps, sliderMin, sliderMax })=>{
|
|
402
|
+
return incrementValue({
|
|
403
|
+
delta,
|
|
404
|
+
incrementType,
|
|
405
|
+
startingValue,
|
|
406
|
+
sliderInterval,
|
|
407
|
+
sliderNumSteps,
|
|
408
|
+
sliderMin,
|
|
409
|
+
sliderMax
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
const incrementSliderButton = ({ startingValue, buttonIncrement, buttonDirection, sliderInterval, sliderNumSteps, sliderMin, sliderMax })=>{
|
|
413
|
+
return incrementValue({
|
|
414
|
+
incrementType: IncrementType.button,
|
|
415
|
+
startingValue,
|
|
416
|
+
buttonIncrement,
|
|
417
|
+
buttonDirection,
|
|
418
|
+
sliderInterval,
|
|
419
|
+
sliderNumSteps,
|
|
420
|
+
sliderMin,
|
|
421
|
+
sliderMax
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
const incrementIndex = ({ delta, startingValue, comboboxNumChoices })=>{
|
|
425
|
+
return incrementValue({
|
|
426
|
+
delta,
|
|
427
|
+
incrementType: IncrementType.index,
|
|
428
|
+
startingValue,
|
|
429
|
+
comboboxNumChoices
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
const incrementIndexButton = ({ startingValue, comboboxNumChoices, buttonDirection })=>{
|
|
433
|
+
return incrementValue({
|
|
434
|
+
incrementType: IncrementType.indexButton,
|
|
435
|
+
startingValue,
|
|
436
|
+
comboboxNumChoices,
|
|
437
|
+
buttonDirection
|
|
438
|
+
});
|
|
393
439
|
};
|
|
394
440
|
const generateDropShadowFilterString = (colors, radius)=>{
|
|
395
441
|
let output = [];
|
|
@@ -405,7 +451,7 @@ const generateDropShadowFilterString = (colors, radius)=>{
|
|
|
405
451
|
};
|
|
406
452
|
const getTextOuterGlowString = (outerGlowColor, outerGlowRadius)=>`${outerGlowColor} 0px 0px ${outerGlowRadius / 2}px, ${outerGlowColor} 0px 0px ${outerGlowRadius}px`;
|
|
407
453
|
const getNumericValue = (value)=>typeof value === 'string' ? +(value?.match(/\d+/)?.[0] ?? '') : value;
|
|
408
|
-
const
|
|
454
|
+
const getUnit = (value)=>typeof value === 'string' ? value.match(/[a-z]/g)?.[0] : 'px';
|
|
409
455
|
const getStringSizeValue = (value, increment = 'px')=>typeof value === 'string' ? value : `${value}${increment}`;
|
|
410
456
|
const getBorderValue = (borderArray, borderDirection, returnNumericValue)=>{
|
|
411
457
|
switch(borderDirection){
|
|
@@ -1342,11 +1388,17 @@ function Tabs({ items, initialSelectedIndex = undefined, id = '', className, pad
|
|
|
1342
1388
|
useEffect(()=>{
|
|
1343
1389
|
if (dataSource === DataSource.JuceCombobox) {
|
|
1344
1390
|
setTimeout(()=>{
|
|
1345
|
-
|
|
1346
|
-
|
|
1391
|
+
if (comboBoxState.properties.choices.length > 0) {
|
|
1392
|
+
setChoices(comboBoxState.properties.choices);
|
|
1393
|
+
setSelectedIndex(comboBoxState.getChoiceIndex());
|
|
1394
|
+
}
|
|
1347
1395
|
});
|
|
1348
1396
|
} else {
|
|
1349
|
-
|
|
1397
|
+
setTimeout(()=>{
|
|
1398
|
+
if (items?.length) {
|
|
1399
|
+
setChoices(items);
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1350
1402
|
}
|
|
1351
1403
|
}, []);
|
|
1352
1404
|
useEffect(()=>{
|
|
@@ -1911,8 +1963,6 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
|
|
|
1911
1963
|
const [properties, setProperties] = useState(comboBoxState?.properties);
|
|
1912
1964
|
const [selectedIndex, setSelectedIndex] = useState(comboBoxState?.getChoiceIndex());
|
|
1913
1965
|
const prevIndex = useRef(null);
|
|
1914
|
-
const nextIndex = useRef(null);
|
|
1915
|
-
const prevDragDirection = useRef(null);
|
|
1916
1966
|
const { highlightedItemChanged, getModSlotPreview, updateModSlotRowTarget } = useGlobalContext();
|
|
1917
1967
|
const modSlotPreview = getModSlotPreview();
|
|
1918
1968
|
//TODO: Filter choices for subsequent rows
|
|
@@ -1978,7 +2028,7 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
|
|
|
1978
2028
|
const filteredChoices = getFilteredChoices(items, filter);
|
|
1979
2029
|
// Used in RotaryCombobox
|
|
1980
2030
|
const bindDrag = useGesture({
|
|
1981
|
-
onDrag: ({ direction,
|
|
2031
|
+
onDrag: ({ direction, delta })=>{
|
|
1982
2032
|
//TODO: Move this out of useSlider
|
|
1983
2033
|
if (updateModSlotPreview) {
|
|
1984
2034
|
updateModSlotRowTarget({
|
|
@@ -1987,34 +2037,12 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
|
|
|
1987
2037
|
saveToBackend: false
|
|
1988
2038
|
});
|
|
1989
2039
|
}
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
if (selectedIndex < choices.length && directionY && directionY === 1) {
|
|
1997
|
-
// throttle(() => {
|
|
1998
|
-
nextIndex.current = incrementIndex({
|
|
1999
|
-
velocity: velocity[1],
|
|
2000
|
-
incrementBy: 1,
|
|
2001
|
-
numOptions: properties?.choices?.length,
|
|
2002
|
-
selectedIndex
|
|
2003
|
-
});
|
|
2004
|
-
// }, 90);
|
|
2005
|
-
} else if (selectedIndex > 0 && directionY && directionY === -1) {
|
|
2006
|
-
// throttle(() => {
|
|
2007
|
-
nextIndex.current = incrementIndex({
|
|
2008
|
-
velocity: velocity[1],
|
|
2009
|
-
incrementBy: -1,
|
|
2010
|
-
numOptions: properties?.choices?.length,
|
|
2011
|
-
selectedIndex
|
|
2012
|
-
});
|
|
2013
|
-
// }, 90);
|
|
2014
|
-
}
|
|
2015
|
-
if (nextIndex.current !== null && nextIndex.current !== undefined && nextIndex.current !== selectedIndex.current) {
|
|
2016
|
-
comboBoxState?.setChoiceIndex(nextIndex.current);
|
|
2017
|
-
}
|
|
2040
|
+
const newValue = incrementIndex({
|
|
2041
|
+
delta: delta[1] * -1,
|
|
2042
|
+
startingValue: selectedIndex,
|
|
2043
|
+
comboboxNumChoices: properties?.choices?.length ?? 0
|
|
2044
|
+
});
|
|
2045
|
+
comboBoxState?.setChoiceIndex(newValue);
|
|
2018
2046
|
}
|
|
2019
2047
|
}, {
|
|
2020
2048
|
enabled: !isDisabled,
|
|
@@ -2055,20 +2083,22 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
|
|
|
2055
2083
|
});
|
|
2056
2084
|
}
|
|
2057
2085
|
};
|
|
2058
|
-
const
|
|
2059
|
-
if (selectedIndex
|
|
2060
|
-
const newIndex =
|
|
2061
|
-
selectedIndex,
|
|
2062
|
-
|
|
2086
|
+
const incrementComboboxButton = ()=>{
|
|
2087
|
+
if (selectedIndex <= properties.choices.length - 1) {
|
|
2088
|
+
const newIndex = incrementIndexButton({
|
|
2089
|
+
startingValue: selectedIndex,
|
|
2090
|
+
comboboxNumChoices: properties?.choices?.length,
|
|
2091
|
+
buttonDirection: StepDirection.up
|
|
2063
2092
|
});
|
|
2064
2093
|
handleChange(newIndex);
|
|
2065
2094
|
}
|
|
2066
2095
|
};
|
|
2067
|
-
const
|
|
2096
|
+
const decrementComboboxButton = ()=>{
|
|
2068
2097
|
if (selectedIndex > 0) {
|
|
2069
|
-
const newIndex =
|
|
2070
|
-
selectedIndex,
|
|
2071
|
-
|
|
2098
|
+
const newIndex = incrementIndexButton({
|
|
2099
|
+
startingValue: selectedIndex,
|
|
2100
|
+
comboboxNumChoices: properties?.choices?.length,
|
|
2101
|
+
buttonDirection: StepDirection.down
|
|
2072
2102
|
});
|
|
2073
2103
|
handleChange(newIndex);
|
|
2074
2104
|
}
|
|
@@ -2086,8 +2116,8 @@ const useCombobox = ({ id, label, items = [], filter, onChange, displayValInHead
|
|
|
2086
2116
|
onClick,
|
|
2087
2117
|
onDoubleClick,
|
|
2088
2118
|
bindDrag,
|
|
2089
|
-
|
|
2090
|
-
|
|
2119
|
+
incrementComboboxButton,
|
|
2120
|
+
decrementComboboxButton
|
|
2091
2121
|
};
|
|
2092
2122
|
};
|
|
2093
2123
|
|
|
@@ -2148,7 +2178,7 @@ function ComboboxComponent({ id, anchorTo, excludeItems = [], items, onChange, c
|
|
|
2148
2178
|
}) : null,
|
|
2149
2179
|
jsxs(Combobox$2, {
|
|
2150
2180
|
value: selectedIndexLabel,
|
|
2151
|
-
onChange: (selectedIndexLabel)=>handleChange(selectedIndexLabel),
|
|
2181
|
+
onChange: (selectedIndexLabel)=>selectedIndexLabel && handleChange(selectedIndexLabel),
|
|
2152
2182
|
onClose: ()=>{
|
|
2153
2183
|
setIncludeFilterString('');
|
|
2154
2184
|
},
|
|
@@ -2206,7 +2236,7 @@ function ComboboxComponent({ id, anchorTo, excludeItems = [], items, onChange, c
|
|
|
2206
2236
|
style: {
|
|
2207
2237
|
visibility: numVisibleItems === 0 ? 'hidden' : 'visible',
|
|
2208
2238
|
// bottom: `${-(listItemHeight * numVisibleItems)}px`,
|
|
2209
|
-
height: getStringSizeValue(getNumericValue(listItemHeight) * numVisibleItems,
|
|
2239
|
+
height: getStringSizeValue(getNumericValue(listItemHeight) * numVisibleItems, getUnit(listItemHeight)),
|
|
2210
2240
|
border: `${dropdownBorderWidth}px solid ${dropdownBorderColor}`,
|
|
2211
2241
|
background: dropdownBackgroundColor,
|
|
2212
2242
|
width: width && getStringSizeValue(width)
|
|
@@ -2247,7 +2277,7 @@ function Combobox$1({ label, showLabel, color = 'var(--color-text)', labelColor,
|
|
|
2247
2277
|
0,
|
|
2248
2278
|
0
|
|
2249
2279
|
], buttonBackgroundColor = 'var(--bg-lv4)', buttonHighlightColor, buttonHeight = 34, outerGlowRadius, outerGlowColors, className, onChange, isDisabled, anchorTo = AnchorTo.bottomLeft, width = 110, listItemHeight = 34, id, style }) {
|
|
2250
|
-
const { selectedIndexLabel, choices, onMouseEnter, onMouseExit, handleChange, onClick,
|
|
2280
|
+
const { selectedIndexLabel, choices, onMouseEnter, onMouseExit, handleChange, onClick, incrementComboboxButton, properties, decrementComboboxButton } = useCombobox({
|
|
2251
2281
|
id,
|
|
2252
2282
|
label,
|
|
2253
2283
|
onChange
|
|
@@ -2385,7 +2415,7 @@ function Combobox$1({ label, showLabel, color = 'var(--color-text)', labelColor,
|
|
|
2385
2415
|
IconButton.padding.xSmall,
|
|
2386
2416
|
IconButton.padding.small
|
|
2387
2417
|
],
|
|
2388
|
-
onClick:
|
|
2418
|
+
onClick: decrementComboboxButton
|
|
2389
2419
|
}),
|
|
2390
2420
|
jsx(IconButton, {
|
|
2391
2421
|
id: "Combobox-down-arrow",
|
|
@@ -2405,7 +2435,7 @@ function Combobox$1({ label, showLabel, color = 'var(--color-text)', labelColor,
|
|
|
2405
2435
|
IconButton.padding.small,
|
|
2406
2436
|
IconButton.padding.small
|
|
2407
2437
|
],
|
|
2408
|
-
onClick:
|
|
2438
|
+
onClick: incrementComboboxButton
|
|
2409
2439
|
})
|
|
2410
2440
|
]
|
|
2411
2441
|
})
|
|
@@ -2818,12 +2848,14 @@ const useSlider = ({ id, rowId, label, displayValInHeader = true, mockProperties
|
|
|
2818
2848
|
}
|
|
2819
2849
|
if (dragOrientation !== DragOrientation.followCursor) {
|
|
2820
2850
|
const deltaVal = dragOrientation === DragOrientation.vertical ? delta[1] * -1 : delta[0];
|
|
2821
|
-
const newValue =
|
|
2851
|
+
const newValue = incrementSlider({
|
|
2822
2852
|
delta: deltaVal,
|
|
2823
2853
|
incrementType: optionIsDown ? IncrementType.fine : IncrementType.standard,
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2854
|
+
startingValue: previousScaledValueRef.current || 0,
|
|
2855
|
+
sliderInterval: properties?.interval ?? 0,
|
|
2856
|
+
sliderNumSteps: properties?.numSteps ?? 0,
|
|
2857
|
+
sliderMin: properties?.start ?? 0,
|
|
2858
|
+
sliderMax: properties?.end ?? 0
|
|
2827
2859
|
});
|
|
2828
2860
|
setJuceScaledValue(newValue);
|
|
2829
2861
|
}
|
|
@@ -3533,13 +3565,14 @@ activeColor = 'var(--color-brand)', inactiveColor = 'var(--bg-lv1)', shape = Ind
|
|
|
3533
3565
|
});
|
|
3534
3566
|
}
|
|
3535
3567
|
|
|
3536
|
-
function useGroupFocus({ isDisabled, id, inputRef }) {
|
|
3568
|
+
function useGroupFocus({ isDisabled, id, inputRef, incrementBy }) {
|
|
3537
3569
|
const [isFocused, setIsFocused] = useState(false);
|
|
3538
3570
|
const isOptionPressed = useRef(false);
|
|
3539
3571
|
const groupId = `${id}-control-group`;
|
|
3540
3572
|
const inputId = `${id}-input`;
|
|
3541
3573
|
const sliderState = Juce.getSliderState(id);
|
|
3542
3574
|
const comboBoxState = Juce.getComboBoxState(id);
|
|
3575
|
+
const isMainSliderACombobox = comboBoxState?.properties?.choices?.length > 0;
|
|
3543
3576
|
const mousedownListener = (event)=>{
|
|
3544
3577
|
if (!isDisabled) {
|
|
3545
3578
|
if (event.target.closest('.ControlGroup')?.id === groupId) {
|
|
@@ -3566,15 +3599,16 @@ function useGroupFocus({ isDisabled, id, inputRef }) {
|
|
|
3566
3599
|
}
|
|
3567
3600
|
};
|
|
3568
3601
|
const increment = ()=>{
|
|
3569
|
-
const isMainSliderACombobox = comboBoxState?.properties?.choices?.length > 0;
|
|
3570
3602
|
if (!isMainSliderACombobox) {
|
|
3571
3603
|
const scaledVal = sliderState?.scaledValue;
|
|
3572
|
-
const newValue =
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3604
|
+
const newValue = incrementSliderButton({
|
|
3605
|
+
sliderNumSteps: sliderState?.properties?.numSteps,
|
|
3606
|
+
startingValue: scaledVal,
|
|
3607
|
+
buttonDirection: StepDirection.up,
|
|
3608
|
+
sliderInterval: sliderState?.properties?.interval,
|
|
3609
|
+
sliderMin: sliderState?.properties?.start,
|
|
3610
|
+
sliderMax: sliderState?.properties?.end,
|
|
3611
|
+
buttonIncrement: 1
|
|
3578
3612
|
});
|
|
3579
3613
|
sliderState.setScaledValue(newValue);
|
|
3580
3614
|
} else {
|
|
@@ -3583,15 +3617,16 @@ function useGroupFocus({ isDisabled, id, inputRef }) {
|
|
|
3583
3617
|
}
|
|
3584
3618
|
};
|
|
3585
3619
|
const decrement = ()=>{
|
|
3586
|
-
const isMainSliderACombobox = comboBoxState?.properties?.choices?.length > 0;
|
|
3587
3620
|
if (!isMainSliderACombobox) {
|
|
3588
3621
|
const scaledVal = sliderState?.scaledValue;
|
|
3589
|
-
const newValue =
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3622
|
+
const newValue = incrementSliderButton({
|
|
3623
|
+
sliderNumSteps: sliderState?.properties?.numSteps,
|
|
3624
|
+
startingValue: scaledVal,
|
|
3625
|
+
buttonDirection: StepDirection.down,
|
|
3626
|
+
sliderInterval: sliderState?.properties?.interval,
|
|
3627
|
+
sliderMin: sliderState?.properties?.start,
|
|
3628
|
+
sliderMax: sliderState?.properties?.end,
|
|
3629
|
+
buttonIncrement: 1
|
|
3595
3630
|
});
|
|
3596
3631
|
sliderState?.setScaledValue(newValue);
|
|
3597
3632
|
} else {
|
|
@@ -3638,6 +3673,14 @@ function useGroupFocus({ isDisabled, id, inputRef }) {
|
|
|
3638
3673
|
event.preventDefault();
|
|
3639
3674
|
increment();
|
|
3640
3675
|
}
|
|
3676
|
+
if (event.key === 'ArrowUp') {
|
|
3677
|
+
event.preventDefault();
|
|
3678
|
+
increment();
|
|
3679
|
+
}
|
|
3680
|
+
if (event.key === 'ArrowDown') {
|
|
3681
|
+
event.preventDefault();
|
|
3682
|
+
decrement();
|
|
3683
|
+
}
|
|
3641
3684
|
}
|
|
3642
3685
|
}
|
|
3643
3686
|
}
|
|
@@ -3804,7 +3847,7 @@ RotarySlider.trackWidth = TrackWidths;
|
|
|
3804
3847
|
var css_248z$9 = ".BarSlider-innerWrapper:hover {\n cursor: pointer;\n}\n\n.BarSlider-Track {\n touch-action: none;\n position: relative;\n width: 100%;\n height: 100%;\n max-height: 100%;\n max-width: 100%;\n background-color: var(--bg-lv5);\n}\n\n.BarSlider-Track.isHighlighted {\n background-color: var(--bg-lv6);\n}\n.Barslider-IndicatorLineWrapper,\n.BarSlider-HandleWrapper {\n position: absolute;\n pointer-events: none;\n}\n\n.BarSlider-IndicatorLine {\n position: absolute;\n top: 0;\n /* left: 0; */\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n.BarSlider-Handle {\n position: absolute;\n pointer-events: none;\n}\n\n.BarSliderHandle {\n pointer-events: auto;\n}\n.Barslider-IndicatorLineWrapper {\n /* border-radius: var(--trackBorderRadius); */\n overflow: hidden;\n}\n\n.BarSlider-Input {\n font-weight: bold;\n width: 100%;\n}\n\n.BarSlider-Input.includeValueInHeightIsFalse {\n position: absolute;\n bottom: -1.7em;\n left: 0;\n right: 0;\n z-index: 10;\n}\n";
|
|
3805
3848
|
styleInject(css_248z$9);
|
|
3806
3849
|
|
|
3807
|
-
function Slider$1({ polarity = Polarity.unipolar, orientation = Orientation.vertical, dragOrientation = DragOrientation.followCursor, isRandomizable = false, randomizerObject, isStandalone = true, isHighlighted = false, showValue = true, showHandle = true, showLabel = true, showInsetBoxShadow = true, resetterObject, className, id, width, height =
|
|
3850
|
+
function Slider$1({ polarity = Polarity.unipolar, orientation = Orientation.vertical, dragOrientation = DragOrientation.followCursor, isRandomizable = false, randomizerObject, isStandalone = true, isHighlighted = false, showValue = true, showHandle = true, showLabel = true, showInsetBoxShadow = true, resetterObject, className, id, width, height = Height.full, onChange, outerGlowRadius, outerGlowColors, trackBorderRadius = 20, blur, style, indicatorLineColor = 'var(--color-brand)', indicatorLineGradient, trackColor = 'var(--bg-lv3)', markColor = 'var(--bg-lv7)', markHighlightColor = 'var(--color-text)', trackStrokeColor, handleFillColor, handleStrokeColor, cornerBorderHighlightColor, trackWidth = TrackWidths.small, label, labelColor, marks = [], inputHighlightColor = 'var(--color-brand)', includeValueInHeight = true, // Mocks the initial scaled value of the slider for web veiws outside of JUCE
|
|
3808
3851
|
mockInitialNormalisedValue = 0, mockProperties = {
|
|
3809
3852
|
start: 20.0,
|
|
3810
3853
|
end: 15000.0,
|
|
@@ -3814,6 +3857,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
|
|
|
3814
3857
|
const sliderElementRef = useRef(null);
|
|
3815
3858
|
const handleElementRef = useRef(null);
|
|
3816
3859
|
const barSliderIndicatorRef = useRef(null);
|
|
3860
|
+
const inputRef = useRef(null);
|
|
3817
3861
|
const isHorizontal = orientation === Orientation.horizontal;
|
|
3818
3862
|
const isVertical = orientation === Orientation.vertical;
|
|
3819
3863
|
const handleWidth = 18;
|
|
@@ -3822,6 +3866,10 @@ mockInitialNormalisedValue = 0, mockProperties = {
|
|
|
3822
3866
|
// const elementRef = useRef<HTMLDivElement>(null);
|
|
3823
3867
|
const animationFrameRef = useRef(null);
|
|
3824
3868
|
const prevValRef = useRef(null);
|
|
3869
|
+
const { isFocused } = useGroupFocus({
|
|
3870
|
+
id,
|
|
3871
|
+
inputRef
|
|
3872
|
+
});
|
|
3825
3873
|
const animate = animateBarChart({
|
|
3826
3874
|
animationFrameRef,
|
|
3827
3875
|
elementRef: barSliderIndicatorRef,
|
|
@@ -3854,6 +3902,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
|
|
|
3854
3902
|
marks
|
|
3855
3903
|
});
|
|
3856
3904
|
const drag = isStandalone ? bindDrag : bindSequenceDrag;
|
|
3905
|
+
// const focusBorderMargin = 10;
|
|
3857
3906
|
useEffect(()=>{
|
|
3858
3907
|
if (normalisedValue !== null && normalisedValue !== undefined && normalisedValue !== prevValRef.current) {
|
|
3859
3908
|
animate(normalisedValue);
|
|
@@ -3879,6 +3928,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
|
|
|
3879
3928
|
[GradientStyles.multicolor]: multiColorGradient,
|
|
3880
3929
|
[GradientStyles.unicolor]: singleColorGradient
|
|
3881
3930
|
};
|
|
3931
|
+
const marginSize = Spacing.mediumSmall;
|
|
3882
3932
|
// const handleRef = useRef(null);
|
|
3883
3933
|
// useEffect(() => {
|
|
3884
3934
|
// console.log(normalisedValue, 'NORMALIZEDVAL');
|
|
@@ -3890,7 +3940,7 @@ mockInitialNormalisedValue = 0, mockProperties = {
|
|
|
3890
3940
|
className: classnames('BarSlider', isVertical && 'BarSlider--isVertical', isHorizontal && 'BarSlider--isHorizontal', className),
|
|
3891
3941
|
id: id,
|
|
3892
3942
|
ref: sliderElementRef,
|
|
3893
|
-
gap: Box.gap.
|
|
3943
|
+
gap: Box.gap.none,
|
|
3894
3944
|
height: isVertical ? height : 'auto',
|
|
3895
3945
|
width: isHorizontal ? width : width ?? '100%',
|
|
3896
3946
|
style: {
|
|
@@ -3904,185 +3954,196 @@ mockInitialNormalisedValue = 0, mockProperties = {
|
|
|
3904
3954
|
color: labelColor,
|
|
3905
3955
|
outerGlowRadius: outerGlowRadius,
|
|
3906
3956
|
outerGlowColor: labelColor,
|
|
3907
|
-
blur: blur
|
|
3908
|
-
padding: [
|
|
3909
|
-
Label.padding.none,
|
|
3910
|
-
Label.padding.none,
|
|
3911
|
-
Label.padding.small,
|
|
3912
|
-
Label.padding.none
|
|
3913
|
-
]
|
|
3957
|
+
blur: blur
|
|
3914
3958
|
}) : null,
|
|
3915
3959
|
polarity === Polarity.bipolar && jsx("div", {
|
|
3916
3960
|
className: 'Slider-center-marker'
|
|
3917
3961
|
}),
|
|
3918
|
-
jsxs(
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
Label.padding.none,
|
|
3926
|
-
Label.padding.small,
|
|
3927
|
-
Label.padding.none
|
|
3928
|
-
],
|
|
3962
|
+
jsxs(ControlGroupWrapper, {
|
|
3963
|
+
id: id,
|
|
3964
|
+
width: '100%',
|
|
3965
|
+
height: '100%',
|
|
3966
|
+
isFocused: isFocused,
|
|
3967
|
+
className: `RotarySlider-HighlightWrapper`,
|
|
3968
|
+
borderHighlightColor: cornerBorderHighlightColor,
|
|
3929
3969
|
children: [
|
|
3930
|
-
|
|
3931
|
-
width: '2.5rem',
|
|
3932
|
-
height: '2rem',
|
|
3933
|
-
flexDirection: Box.flexDirection.column,
|
|
3934
|
-
style: {
|
|
3935
|
-
position: 'absolute',
|
|
3936
|
-
pointerEvents: 'none',
|
|
3937
|
-
top: `1px`,
|
|
3938
|
-
height: '2rem',
|
|
3939
|
-
width: '2rem',
|
|
3940
|
-
left: `calc(${item?.value * 100}% - 1rem)`,
|
|
3941
|
-
zIndex: 1
|
|
3942
|
-
},
|
|
3943
|
-
children: [
|
|
3944
|
-
jsx("div", {
|
|
3945
|
-
className: "BarSlider-Mark",
|
|
3946
|
-
style: {
|
|
3947
|
-
width: '5px',
|
|
3948
|
-
height: '5px',
|
|
3949
|
-
borderRadius: '100%',
|
|
3950
|
-
background: hoveredMark === item?.label ? markHighlightColor : markColor,
|
|
3951
|
-
zIndex: 1,
|
|
3952
|
-
cursor: 'pointer',
|
|
3953
|
-
pointerEvents: 'auto'
|
|
3954
|
-
},
|
|
3955
|
-
onMouseEnter: ()=>setHoveredMark(item?.label),
|
|
3956
|
-
onMouseLeave: ()=>setHoveredMark(null),
|
|
3957
|
-
onClick: ()=>{
|
|
3958
|
-
setNormalisedState(item?.value);
|
|
3959
|
-
}
|
|
3960
|
-
}),
|
|
3961
|
-
item?.label ? jsx(Label, {
|
|
3962
|
-
id: item?.label,
|
|
3963
|
-
value: item?.label,
|
|
3964
|
-
fontSize: Label.fontSize.xXSmall,
|
|
3965
|
-
onMouseEnter: ()=>setHoveredMark(item?.label),
|
|
3966
|
-
onMouseLeave: ()=>setHoveredMark(null),
|
|
3967
|
-
color: +normalisedValue?.toFixed(2) === +item?.value?.toFixed(2) || hoveredMark === item?.label ? markHighlightColor : markColor,
|
|
3968
|
-
highlightColor: markHighlightColor,
|
|
3969
|
-
onClick: ()=>{
|
|
3970
|
-
setNormalisedState(item?.value);
|
|
3971
|
-
},
|
|
3972
|
-
style: {
|
|
3973
|
-
cursor: 'pointer',
|
|
3974
|
-
pointerEvents: 'auto'
|
|
3975
|
-
}
|
|
3976
|
-
}) : null
|
|
3977
|
-
]
|
|
3978
|
-
})) : null,
|
|
3979
|
-
jsx(Box, {
|
|
3980
|
-
className: "BarSlider-innerWrapper",
|
|
3981
|
-
height: isHorizontal && showHandle ? `${handleWidth}px` : isHorizontal && !showHandle ? 'auto' : '100%',
|
|
3982
|
-
width: isVertical && showHandle ? `${handleWidth}px` : '100%',
|
|
3970
|
+
jsxs(Box, {
|
|
3983
3971
|
style: {
|
|
3984
|
-
|
|
3985
|
-
touchAction: 'none'
|
|
3972
|
+
position: 'relative'
|
|
3986
3973
|
},
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
children: [
|
|
4004
|
-
normalisedValue !== null && normalisedValue !== undefined ? jsx("div", {
|
|
4005
|
-
className: "Barslider-IndicatorLineWrapper",
|
|
3974
|
+
fullHeight: true,
|
|
3975
|
+
padding: isStandalone ? isVertical ? [
|
|
3976
|
+
Box.padding.none
|
|
3977
|
+
] : [
|
|
3978
|
+
marginSize,
|
|
3979
|
+
Box.padding.small,
|
|
3980
|
+
Box.padding.none,
|
|
3981
|
+
Box.padding.small
|
|
3982
|
+
] : [
|
|
3983
|
+
Box.padding.none
|
|
3984
|
+
],
|
|
3985
|
+
children: [
|
|
3986
|
+
marks && marks?.length > 0 ? marks?.map((item)=>jsxs(Box, {
|
|
3987
|
+
width: '2.5rem',
|
|
3988
|
+
height: '2rem',
|
|
3989
|
+
flexDirection: Box.flexDirection.column,
|
|
4006
3990
|
style: {
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
3991
|
+
position: 'absolute',
|
|
3992
|
+
pointerEvents: 'none',
|
|
3993
|
+
top: `var(--spacing-${marginSize})`,
|
|
3994
|
+
height: '2rem',
|
|
3995
|
+
width: '2rem',
|
|
3996
|
+
left: `calc(${item?.value * 100}% - 1rem)`,
|
|
3997
|
+
zIndex: 1
|
|
4012
3998
|
},
|
|
4013
|
-
children:
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
3999
|
+
children: [
|
|
4000
|
+
jsx("div", {
|
|
4001
|
+
className: "BarSlider-Mark",
|
|
4002
|
+
style: {
|
|
4003
|
+
width: '5px',
|
|
4004
|
+
height: '5px',
|
|
4005
|
+
borderRadius: '100%',
|
|
4006
|
+
background: hoveredMark === item?.label ? markHighlightColor : markColor,
|
|
4007
|
+
zIndex: 1,
|
|
4008
|
+
cursor: 'pointer',
|
|
4009
|
+
pointerEvents: 'auto'
|
|
4010
|
+
},
|
|
4011
|
+
onMouseEnter: ()=>setHoveredMark(item?.label),
|
|
4012
|
+
onMouseLeave: ()=>setHoveredMark(null),
|
|
4013
|
+
onClick: ()=>{
|
|
4014
|
+
setNormalisedState(item?.value);
|
|
4015
|
+
}
|
|
4016
|
+
}),
|
|
4017
|
+
item?.label ? jsx(Label, {
|
|
4018
|
+
id: item?.label,
|
|
4019
|
+
value: item?.label,
|
|
4020
|
+
fontSize: Label.fontSize.xXSmall,
|
|
4021
|
+
onMouseEnter: ()=>setHoveredMark(item?.label),
|
|
4022
|
+
onMouseLeave: ()=>setHoveredMark(null),
|
|
4023
|
+
color: +normalisedValue?.toFixed(2) === +item?.value?.toFixed(2) || hoveredMark === item?.label ? markHighlightColor : markColor,
|
|
4024
|
+
highlightColor: markHighlightColor,
|
|
4025
|
+
onClick: ()=>{
|
|
4026
|
+
setNormalisedState(item?.value);
|
|
4027
|
+
},
|
|
4028
|
+
style: {
|
|
4029
|
+
cursor: 'pointer',
|
|
4030
|
+
pointerEvents: 'auto'
|
|
4031
|
+
}
|
|
4032
|
+
}) : null
|
|
4033
|
+
]
|
|
4034
|
+
})) : null,
|
|
4035
|
+
jsx(Box, {
|
|
4036
|
+
className: "BarSlider-innerWrapper",
|
|
4037
|
+
height: isHorizontal && showHandle ? `${handleWidth}px` : isHorizontal && !showHandle ? 'auto' : '100%',
|
|
4038
|
+
width: isVertical && showHandle ? `${handleWidth}px` : '100%',
|
|
4039
|
+
style: {
|
|
4040
|
+
filter: `blur(${blur}px)`,
|
|
4041
|
+
touchAction: 'none'
|
|
4042
|
+
},
|
|
4043
|
+
"data-sliderElement": "true",
|
|
4044
|
+
...drag(),
|
|
4045
|
+
children: jsxs("div", {
|
|
4046
|
+
className: classnames('BarSlider-Track', isHighlighted && 'isHighlighted'),
|
|
4047
|
+
// onMouseEnter={onMouseEnter}
|
|
4048
|
+
id: id,
|
|
4033
4049
|
style: {
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
width: isHorizontal ?
|
|
4037
|
-
height: isHorizontal ?
|
|
4038
|
-
|
|
4050
|
+
background: trackColor,
|
|
4051
|
+
stroke: trackStrokeColor ? `1px solid ${trackStrokeColor}` : 'none',
|
|
4052
|
+
width: isHorizontal ? '100%' : trackStringWidth,
|
|
4053
|
+
height: isHorizontal ? trackStringWidth : '100%',
|
|
4054
|
+
borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : '0',
|
|
4055
|
+
boxShadow: showInsetBoxShadow ? `inset 0px 2px 6px rgba(0, 0, 0, 0.25)` : 'none',
|
|
4056
|
+
filter: generateDropShadowFilterString(outerGlowColors, outerGlowRadius),
|
|
4057
|
+
...style
|
|
4039
4058
|
},
|
|
4040
|
-
children:
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4059
|
+
children: [
|
|
4060
|
+
normalisedValue !== null && normalisedValue !== undefined ? jsx("div", {
|
|
4061
|
+
className: "Barslider-IndicatorLineWrapper",
|
|
4062
|
+
style: {
|
|
4063
|
+
borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : '0',
|
|
4064
|
+
bottom: '0',
|
|
4065
|
+
left: '0',
|
|
4066
|
+
width: isHorizontal ? '100%' : trackStringWidth,
|
|
4067
|
+
height: '100%'
|
|
4068
|
+
},
|
|
4069
|
+
children: jsx("div", {
|
|
4070
|
+
// TODO: Why aren't the Tailwind classes working?
|
|
4071
|
+
// className={classnames('h-full', 'w-full', 'absolute', 'bg-panel')}
|
|
4072
|
+
ref: barSliderIndicatorRef,
|
|
4073
|
+
className: "BarSlider-IndicatorLine",
|
|
4074
|
+
style: {
|
|
4075
|
+
background: indicatorLineGradient ? selectedGradientMap[indicatorLineGradient] : indicatorLineColor,
|
|
4076
|
+
opacity: isStandalone || isHighlighted ? '100%' : '80%',
|
|
4077
|
+
top: `${isHorizontal && 'calc(50% - 3px)'}`,
|
|
4078
|
+
left: `${isVertical && 'calc(50% - 3px)'}`,
|
|
4079
|
+
filter: generateDropShadowFilterString(outerGlowColors, outerGlowRadius),
|
|
4080
|
+
...getBarTransformStyles({
|
|
4081
|
+
orientation: orientation,
|
|
4082
|
+
polarity
|
|
4083
|
+
})
|
|
4084
|
+
}
|
|
4085
|
+
})
|
|
4086
|
+
}) : '',
|
|
4087
|
+
showHandle ? jsx("div", {
|
|
4088
|
+
className: "BarSlider-HandleWrapper",
|
|
4089
|
+
style: {
|
|
4090
|
+
top: isHorizontal ? 0 : handleMargin / 2,
|
|
4091
|
+
left: isHorizontal ? handleMargin / 2 : 0,
|
|
4092
|
+
width: isHorizontal ? `calc(100% - ${handleMargin}px)` : '100%',
|
|
4093
|
+
height: isHorizontal ? '100%' : `calc(100% - ${handleMargin}px)`,
|
|
4094
|
+
zIndex: 2
|
|
4095
|
+
},
|
|
4096
|
+
children: jsx("div", {
|
|
4097
|
+
ref: handleElementRef,
|
|
4098
|
+
className: "BarSlider-Handle",
|
|
4099
|
+
style: {
|
|
4100
|
+
borderRadius: trackBorderRadius ? `${trackBorderRadius}px` : 'none'
|
|
4101
|
+
},
|
|
4102
|
+
children: jsx(BarSliderHandle, {
|
|
4103
|
+
handleFillColor: handleFillColor,
|
|
4104
|
+
handleStrokeColor: handleStrokeColor,
|
|
4105
|
+
strokeWidth: 5,
|
|
4106
|
+
width: handleWidth
|
|
4107
|
+
})
|
|
4108
|
+
})
|
|
4109
|
+
}) : null
|
|
4110
|
+
]
|
|
4111
|
+
})
|
|
4112
|
+
})
|
|
4113
|
+
]
|
|
4114
|
+
}),
|
|
4115
|
+
showValue ? jsx(Input, {
|
|
4116
|
+
className: `BarSlider-Input ${includeValueInHeight ? 'includeValueInHeightIsTrue' : 'includeValueInHeightIsFalse'}`,
|
|
4117
|
+
ref: inputRef,
|
|
4118
|
+
value: scaledValue,
|
|
4119
|
+
id: id,
|
|
4120
|
+
min: properties?.start || 0,
|
|
4121
|
+
max: properties?.end || 0,
|
|
4122
|
+
type: Input.type.number,
|
|
4123
|
+
textColor: labelColor,
|
|
4124
|
+
highlightColor: inputHighlightColor,
|
|
4125
|
+
outerGlowRadius: outerGlowRadius,
|
|
4126
|
+
outerGlowColor: labelColor,
|
|
4127
|
+
style: {
|
|
4128
|
+
},
|
|
4129
|
+
blur: blur,
|
|
4130
|
+
textAlign: Input.textAlign.center,
|
|
4131
|
+
onComplete: (value)=>{
|
|
4132
|
+
// normalisedValue !== undefined &&
|
|
4133
|
+
// setScaledState(normalisedValue);
|
|
4134
|
+
value !== undefined && setScaledState(value);
|
|
4135
|
+
}
|
|
4136
|
+
}) : null
|
|
4057
4137
|
]
|
|
4058
|
-
})
|
|
4059
|
-
showValue ? jsx(Input, {
|
|
4060
|
-
className: `BarSlider-Input ${includeValueInHeight ? 'includeValueInHeightIsTrue' : 'includeValueInHeightIsFalse'}`,
|
|
4061
|
-
value: scaledValue,
|
|
4062
|
-
id: id,
|
|
4063
|
-
min: properties?.start || 0,
|
|
4064
|
-
max: properties?.end || 0,
|
|
4065
|
-
type: Input.type.number,
|
|
4066
|
-
textColor: labelColor,
|
|
4067
|
-
highlightColor: inputHighlightColor,
|
|
4068
|
-
outerGlowRadius: outerGlowRadius,
|
|
4069
|
-
outerGlowColor: labelColor,
|
|
4070
|
-
style: {
|
|
4071
|
-
},
|
|
4072
|
-
blur: blur,
|
|
4073
|
-
textAlign: Input.textAlign.center,
|
|
4074
|
-
onComplete: (value)=>{
|
|
4075
|
-
// normalisedValue !== undefined &&
|
|
4076
|
-
// setScaledState(normalisedValue);
|
|
4077
|
-
value !== undefined && setScaledState(value);
|
|
4078
|
-
}
|
|
4079
|
-
}) : null
|
|
4138
|
+
})
|
|
4080
4139
|
]
|
|
4081
4140
|
});
|
|
4082
4141
|
}
|
|
4083
4142
|
Slider$1.sliderType = SliderType;
|
|
4084
4143
|
Slider$1.polarity = Polarity;
|
|
4085
4144
|
Slider$1.orientation = Orientation;
|
|
4145
|
+
Slider$1.width = Width;
|
|
4146
|
+
Slider$1.height = Height;
|
|
4086
4147
|
|
|
4087
4148
|
// Rotary Slider UI component.
|
|
4088
4149
|
// Connects to Juce's Slider element
|
|
@@ -4286,6 +4347,7 @@ mockInitialNormalisedValue = 0, showValue, includeValueInHeight, marks, isRandom
|
|
|
4286
4347
|
isStandalone: isStandalone,
|
|
4287
4348
|
isHighlighted: isHighlighted,
|
|
4288
4349
|
includeValueInHeight: includeValueInHeight,
|
|
4350
|
+
cornerBorderHighlightColor: cornerBorderHighlightColor,
|
|
4289
4351
|
randomizerObject: randomizerObject,
|
|
4290
4352
|
blur: blur
|
|
4291
4353
|
}) : null
|