@antimatter-audio/antimatter-ui 5.10.3 → 5.10.5
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.d.ts +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -225,7 +225,7 @@ interface SliderProps {
|
|
|
225
225
|
sliderPolarity?: SLIDER_POLARITY;
|
|
226
226
|
sliderType?: SLIDER_TYPE;
|
|
227
227
|
sliderOrientation?: SLIDER_ORIENTATION;
|
|
228
|
-
onMouseEnter?: (label: string,
|
|
228
|
+
onMouseEnter?: (label: string, scaledValue: number) => void;
|
|
229
229
|
onChange?: (newValue: any) => void;
|
|
230
230
|
imageAssets?: {
|
|
231
231
|
background: string;
|
package/dist/index.js
CHANGED
|
@@ -669,6 +669,9 @@ function getNormalisedValue(param) {
|
|
|
669
669
|
var scaledValue = param.scaledValue, start = param.start, end = param.end, _param_skew = param.skew, skew = _param_skew === void 0 ? 1.0 : _param_skew;
|
|
670
670
|
return Math.pow((scaledValue - start) / (end - start), skew);
|
|
671
671
|
}
|
|
672
|
+
var decimalToPercent = function(decimal) {
|
|
673
|
+
return Math.round(100 * (typeof decimal === 'string' ? parseFloat(decimal) : decimal));
|
|
674
|
+
};
|
|
672
675
|
|
|
673
676
|
function _array_like_to_array(arr, len) {
|
|
674
677
|
if (len == null || len > arr.length) len = arr.length;
|
|
@@ -863,20 +866,20 @@ function Slider(param) {
|
|
|
863
866
|
// TODO: This is a temporary solution.
|
|
864
867
|
// TODO: what is the best way to handle react vs JUCE state?
|
|
865
868
|
if (!isLocalhost) {
|
|
866
|
-
var
|
|
867
|
-
onChange && onChange(
|
|
869
|
+
var newScaledValue = sliderState.getScaledValue();
|
|
870
|
+
onChange && onChange(decimalToPercent(newScaledValue));
|
|
868
871
|
}
|
|
869
872
|
// If the front end app is running in a browser, set the new value here.
|
|
870
873
|
// Otherwise, the value will come from JUCE.
|
|
871
874
|
if (isLocalhost) {
|
|
872
875
|
var newValueClamped = clamp(newValue);
|
|
873
|
-
onChange && onChange(newValueClamped);
|
|
874
876
|
setNormalizedValue(newValueClamped);
|
|
875
877
|
setScaledValue(normalisedToScaledValue({
|
|
876
878
|
normalisedValue: newValueClamped,
|
|
877
879
|
start: mockProperties === null || mockProperties === void 0 ? void 0 : mockProperties.start,
|
|
878
880
|
end: mockProperties === null || mockProperties === void 0 ? void 0 : mockProperties.end
|
|
879
881
|
}));
|
|
882
|
+
onChange && onChange(decimalToPercent(scaledValue));
|
|
880
883
|
}
|
|
881
884
|
};
|
|
882
885
|
useEffect(function() {
|
|
@@ -943,7 +946,7 @@ function Slider(param) {
|
|
|
943
946
|
className: classnames('Slider', "bg-slider", sliderPolarity === "LINEAR" ? 'Slider-polarity-linear' : 'Slider-polarity-bipolar', sliderType === "BAR" && 'Slider-bar', (sliderType === "ROTARY" || sliderType === "ROTARY_LARGE") && 'Slider-rotary', sliderType === "ROTARY_LARGE" && 'Slider-rotary-large', sliderType === "BAR" ? sliderOrientation === "HORIZONTAL" ? 'Slider-orientation-horizontal' : 'Slider-orientation-vertical' : '', className)
|
|
944
947
|
}, bindDrag()), {
|
|
945
948
|
onMouseEnter: function() {
|
|
946
|
-
return onMouseEnter && onMouseEnter(label || id,
|
|
949
|
+
return onMouseEnter && onMouseEnter(label || id, decimalToPercent(scaledValue));
|
|
947
950
|
},
|
|
948
951
|
style: {
|
|
949
952
|
touchAction: 'none',
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAA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