@antimatter-audio/antimatter-ui 10.17.0 → 11.0.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/advanced/ControlGroup/ControlGroup.d.ts +10 -0
- package/dist/advanced/ControlGroup/ControlGroup.d.ts.map +1 -0
- package/dist/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -1
- package/dist/common/utils.d.ts +5 -0
- package/dist/common/utils.d.ts.map +1 -1
- package/dist/core/DataViz/SingleBarViz.d.ts +3 -2
- package/dist/core/DataViz/SingleBarViz.d.ts.map +1 -1
- package/dist/core/Slider/RotarySlider.d.ts.map +1 -1
- package/dist/hooks/useSlider.d.ts +0 -3
- package/dist/hooks/useSlider.d.ts.map +1 -1
- package/dist/index.js +389 -225
- package/dist/index.js.map +1 -1
- package/dist/src/advanced/ControlGroup/ControlGroup.d.ts +10 -0
- package/dist/src/advanced/ControlGroup/ControlGroup.d.ts.map +1 -0
- package/dist/src/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -1
- package/dist/src/common/utils.d.ts +5 -0
- package/dist/src/common/utils.d.ts.map +1 -1
- package/dist/src/core/DataViz/SingleBarViz.d.ts +3 -2
- package/dist/src/core/DataViz/SingleBarViz.d.ts.map +1 -1
- package/dist/src/core/Slider/RotarySlider.d.ts.map +1 -1
- package/dist/src/hooks/useSlider.d.ts +0 -3
- package/dist/src/hooks/useSlider.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,8 +33,8 @@ function styleInject(css, ref) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var css_248z$
|
|
37
|
-
styleInject(css_248z$
|
|
36
|
+
var css_248z$c = "@import 'tailwindcss';\n@import 'tailwindcss/base';\n@import 'tailwindcss/utilities';\n\n@theme static {\n --color-brand: #bb68d9;\n --color-brand-900: #443342;\n --color-brand-700: #932eb8;\n --color-brand-600: #826993;\n --color-brand-400: #d199e6;\n --color-brand-300: #f3d4f4;\n --color-alert: #8a0101;\n --color-text: #bab6cf;\n --color-gray-100: #c7c3de;\n --color-gray-200: #9a96ab;\n --color-gray-300: #838091;\n --color-gray-400: #595763;\n --color-gray-500: #4c4a54;\n --color-gray-600: #2e2c33;\n --color-gray-700: #1e1d21;\n --color-gray-800: #101012;\n --color-gray-900: #09090a;\n\n --color-VFDBlue-100: #0d3814;\n --color-VFDBlue-200: #234e4a;\n --color-VFDBlue-300: #128073;\n --color-VFDBlue-400: #138c6e;\n --color-VFDBlue-500: #1abe95;\n --color-VFDBlue-600: #23d8a4;\n --color-VFDBlue-700: #4aeea4;\n --color-VFDBlue-1000: #35edb4;\n --spacing-none: 0px;\n --spacing-xs: 2px;\n --spacing-sm: 4px;\n --spacing-ms: 6px;\n --spacing-md: 8px;\n --spacing-ml: 12px;\n --spacing-lg: 16px;\n --spacing-xl: 20px;\n --m-none: 0px;\n --m-xs: 2px;\n --m-sm: 4px;\n --m-ms: 6px;\n --m-md: 8px;\n --m-ml: 12px;\n --m-lg: 16px;\n --m-xl: 20px;\n --mt-none: 0px;\n --mt-xs: 2px;\n --mt-sm: 4px;\n --mt-ms: 6px;\n --mt-md: 8px;\n --mt-ml: 12px;\n --mt-lg: 16px;\n --mt-xl: 20px;\n --mr-none: 0px;\n --mr-xs: 2px;\n --mr-sm: 4px;\n --mr-ms: 6px;\n --mr-md: 8px;\n --mr-ml: 12px;\n --mr-lg: 16px;\n --mr-xl: 20px;\n --mb-none: 0px;\n --mb-xs: 2px;\n --mb-sm: 4px;\n --mb-ms: 6px;\n --mb-md: 8px;\n --mb-ml: 12px;\n --mb-lg: 16px;\n --mb-xl: 20px;\n --ml-none: 0px;\n --ml-xs: 2px;\n --ml-sm: 4px;\n --ml-ms: 6px;\n --ml-md: 8px;\n --ml-ml: 12px;\n --ml-lg: 16px;\n --ml-xl: 20px;\n --p-none: 0px;\n --p-xs: 2px;\n --p-sm: 4px;\n --p-ms: 6px;\n --p-md: 8px;\n --p-ml: 12px;\n --p-lg: 16px;\n --p-xl: 20px;\n --pt-none: 0px;\n --pt-xs: 2px;\n --pt-sm: 4px;\n --pt-ms: 6px;\n --pt-md: 8px;\n --pt-ml: 12px;\n --pt-lg: 16px;\n --pt-xl: 20px;\n --pr-none: 0px;\n --pr-xs: 2px;\n --pr-sm: 4px;\n --pr-ms: 6px;\n --pr-md: 8px;\n --pr-ml: 12px;\n --pr-lg: 16px;\n --pr-xl: 20px;\n --pb-none: 0px;\n --pb-xs: 2px;\n --pb-sm: 4px;\n --pb-ms: 6px;\n --pb-md: 8px;\n --pb-ml: 12px;\n --pb-lg: 16px;\n --pb-xl: 20px;\n --pl-none: 0px;\n --pl-xs: 2px;\n --pl-sm: 4px;\n --pl-ms: 6px;\n --pl-md: 8px;\n --pl-ml: 12px;\n --pl-lg: 16px;\n --pl-xl: 20px;\n --bg-page: #1e1d21;\n --bg-section: #1e1d21;\n --bg-popover: #09090a;\n --bg-highlighted: #838091;\n --bg-muted: #595763;\n --bg-selected: #2e2c33;\n --bg-input: #1e1d21;\n --font-leagueSpartan: 'LeagueSpartan';\n --text-xs: 0.625rem;\n --text-sm: 0.75rem;\n --text-ms: 0.813rem;\n --text-md: 0.875rem;\n --text-lg: 1rem;\n --text-xl: 1.25rem;\n --text-title: 1.75rem;\n --gap-none: 0px;\n --gap-xs: 2px;\n --gap-sm: 4px;\n --gap-ms: 6px;\n --gap-md: 8px;\n --gap-ml: 12px;\n --gap-lg: 16px;\n --gap-xl: 20px;\n}\n\ninput,\ninput:hover,\ninput:focus,\ninput:focus-visible {\n background: transparent;\n border: none;\n outline: none;\n appearance: textfield;\n}\n\nbutton,\nbutton:hover,\nbutton:focus,\nbutton:focus-visible {\n outline: none;\n}\n\nbutton:disabled,\ninput:disabled {\n cursor: not-allowed;\n}\n\ndiv:focus,\ndiv:focus-visible {\n outline: none;\n appearance: textfield;\n}\n\n@font-face {\n font-family: LeagueSpartan;\n /* ascent-override: 70%; */\n src: url('./common/assets/fonts/LeagueSpartan-Regular.ttf');\n}\n\n@font-face {\n font-family: LeagueSpartan;\n /* ascent-override: 70%; */\n src: url('./common/assets/fonts/LeagueSpartan-Thin.ttf');\n font-weight: lighter;\n}\n";
|
|
37
|
+
styleInject(css_248z$c);
|
|
38
38
|
|
|
39
39
|
var Spacing = /*#__PURE__*/ function(Spacing) {
|
|
40
40
|
Spacing["none"] = "none";
|
|
@@ -87,8 +87,8 @@ var Orientation = /*#__PURE__*/ function(Orientation) {
|
|
|
87
87
|
return Orientation;
|
|
88
88
|
}({});
|
|
89
89
|
|
|
90
|
-
var css_248z$
|
|
91
|
-
styleInject(css_248z$
|
|
90
|
+
var css_248z$b = ".Tabs {\n display: flex;\n font-size: 1rem;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-transform: uppercase;\n text-align: center;\n border: 0;\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.Tabs-item {\n &:disabled {\n cursor: not-allowed;\n }\n}\n\n.Tabs-item::-moz-selection {\n background: transparent;\n}\n.Tabs-item::selection {\n background: transparent;\n}\n";
|
|
91
|
+
styleInject(css_248z$b);
|
|
92
92
|
|
|
93
93
|
function Tabs(param) {
|
|
94
94
|
var items = param.items, className = param.className, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
@@ -144,8 +144,8 @@ function Tabs(param) {
|
|
|
144
144
|
Tabs.padding = Spacing;
|
|
145
145
|
Tabs.margin = Spacing;
|
|
146
146
|
|
|
147
|
-
var css_248z$
|
|
148
|
-
styleInject(css_248z$
|
|
147
|
+
var css_248z$a = ".Button {\n font-size: var(--text-xs);\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: var(--spacing-ms);\n padding-left: var(--spacing-ms);\n cursor: pointer;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-align: enter;\n border: 0;\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n &.xSmall {\n width: var(--spacing-ml);\n height: var(--spacing-ml);\n }\n &.small {\n font-size: var(--text-xs);\n min-width: 1rem;\n min-height: var(--spacing-sm);\n }\n &.large {\n border-radius: var(--radius-sm);\n min-width: 1rem;\n min-height: var(--spacing-xl);\n }\n}\n";
|
|
148
|
+
styleInject(css_248z$a);
|
|
149
149
|
|
|
150
150
|
var ButtonSize = /*#__PURE__*/ function(ButtonSize) {
|
|
151
151
|
ButtonSize["xSmall"] = "xSmall";
|
|
@@ -199,13 +199,13 @@ function useObservable(param) {
|
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
function _array_like_to_array$
|
|
202
|
+
function _array_like_to_array$j(arr, len) {
|
|
203
203
|
if (len == null || len > arr.length) len = arr.length;
|
|
204
204
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
205
205
|
return arr2;
|
|
206
206
|
}
|
|
207
207
|
function _array_without_holes$2(arr) {
|
|
208
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
208
|
+
if (Array.isArray(arr)) return _array_like_to_array$j(arr);
|
|
209
209
|
}
|
|
210
210
|
function _iterable_to_array$2(iter) {
|
|
211
211
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
@@ -214,15 +214,15 @@ function _non_iterable_spread$2() {
|
|
|
214
214
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
215
215
|
}
|
|
216
216
|
function _to_consumable_array$2(arr) {
|
|
217
|
-
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$
|
|
217
|
+
return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$j(arr) || _non_iterable_spread$2();
|
|
218
218
|
}
|
|
219
|
-
function _unsupported_iterable_to_array$
|
|
219
|
+
function _unsupported_iterable_to_array$j(o, minLen) {
|
|
220
220
|
if (!o) return;
|
|
221
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
221
|
+
if (typeof o === "string") return _array_like_to_array$j(o, minLen);
|
|
222
222
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
223
223
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
224
224
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
225
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
225
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$j(o, minLen);
|
|
226
226
|
}
|
|
227
227
|
// export const roundUpToTwoDecimals = (val: number) => Math.ceil(val * 100) / 100;
|
|
228
228
|
// mocks the `normalisedToScaledValue` internal method from JUCE
|
|
@@ -336,17 +336,37 @@ var getBarTransformStyles = function(param) {
|
|
|
336
336
|
var randomizeValue = function(min, max) {
|
|
337
337
|
return Math.random() * (max - min) + min;
|
|
338
338
|
};
|
|
339
|
+
var incrementValue = function(param) {
|
|
340
|
+
var incomingVal = param.incomingVal, prevVal = param.prevVal, interval = param.interval;
|
|
341
|
+
var getNormalisedInterval = function() {
|
|
342
|
+
if (interval) {
|
|
343
|
+
if (interval >= 1) {
|
|
344
|
+
return interval * 0.01;
|
|
345
|
+
} else {
|
|
346
|
+
return interval;
|
|
347
|
+
}
|
|
348
|
+
} else {
|
|
349
|
+
return 0.01;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
var normalisedInterval = getNormalisedInterval();
|
|
353
|
+
var newValue = (prevVal !== null && prevVal !== void 0 ? prevVal : 0) + incomingVal * // (interval && interval.toString().length > 4
|
|
354
|
+
// ? 4
|
|
355
|
+
// : 0.4) *
|
|
356
|
+
normalisedInterval;
|
|
357
|
+
return clamp(newValue);
|
|
358
|
+
};
|
|
339
359
|
|
|
340
|
-
function _array_like_to_array$
|
|
360
|
+
function _array_like_to_array$i(arr, len) {
|
|
341
361
|
if (len == null || len > arr.length) len = arr.length;
|
|
342
362
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
343
363
|
return arr2;
|
|
344
364
|
}
|
|
345
|
-
function _array_with_holes$
|
|
365
|
+
function _array_with_holes$i(arr) {
|
|
346
366
|
if (Array.isArray(arr)) return arr;
|
|
347
367
|
}
|
|
348
368
|
function _array_without_holes$1(arr) {
|
|
349
|
-
if (Array.isArray(arr)) return _array_like_to_array$
|
|
369
|
+
if (Array.isArray(arr)) return _array_like_to_array$i(arr);
|
|
350
370
|
}
|
|
351
371
|
function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
|
|
352
372
|
try {
|
|
@@ -393,7 +413,7 @@ function _define_property$k(obj, key, value) {
|
|
|
393
413
|
function _iterable_to_array$1(iter) {
|
|
394
414
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
395
415
|
}
|
|
396
|
-
function _iterable_to_array_limit$
|
|
416
|
+
function _iterable_to_array_limit$i(arr, i) {
|
|
397
417
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
398
418
|
if (_i == null) return;
|
|
399
419
|
var _arr = [];
|
|
@@ -417,7 +437,7 @@ function _iterable_to_array_limit$g(arr, i) {
|
|
|
417
437
|
}
|
|
418
438
|
return _arr;
|
|
419
439
|
}
|
|
420
|
-
function _non_iterable_rest$
|
|
440
|
+
function _non_iterable_rest$i() {
|
|
421
441
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
422
442
|
}
|
|
423
443
|
function _non_iterable_spread$1() {
|
|
@@ -457,19 +477,19 @@ function _object_spread_props$4(target, source) {
|
|
|
457
477
|
}
|
|
458
478
|
return target;
|
|
459
479
|
}
|
|
460
|
-
function _sliced_to_array$
|
|
461
|
-
return _array_with_holes$
|
|
480
|
+
function _sliced_to_array$i(arr, i) {
|
|
481
|
+
return _array_with_holes$i(arr) || _iterable_to_array_limit$i(arr, i) || _unsupported_iterable_to_array$i(arr, i) || _non_iterable_rest$i();
|
|
462
482
|
}
|
|
463
483
|
function _to_consumable_array$1(arr) {
|
|
464
|
-
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$
|
|
484
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$i(arr) || _non_iterable_spread$1();
|
|
465
485
|
}
|
|
466
|
-
function _unsupported_iterable_to_array$
|
|
486
|
+
function _unsupported_iterable_to_array$i(o, minLen) {
|
|
467
487
|
if (!o) return;
|
|
468
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
488
|
+
if (typeof o === "string") return _array_like_to_array$i(o, minLen);
|
|
469
489
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
470
490
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
471
491
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
472
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
492
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$i(o, minLen);
|
|
473
493
|
}
|
|
474
494
|
function _ts_generator$4(thisArg, body) {
|
|
475
495
|
var f, y, t, _ = {
|
|
@@ -711,7 +731,7 @@ function useGlobalContext(selector) {
|
|
|
711
731
|
// Context provider
|
|
712
732
|
function GlobalContextProvider(param) {
|
|
713
733
|
var children = param.children;
|
|
714
|
-
var _useReducer = _sliced_to_array$
|
|
734
|
+
var _useReducer = _sliced_to_array$i(useReducer(reducer, defaultGlobalStateValue), 2), state = _useReducer[0], dispatch = _useReducer[1];
|
|
715
735
|
var highlightedItemChanged = useCallback(function(highlightedItem) {
|
|
716
736
|
dispatch({
|
|
717
737
|
type: 'HIGHLIGHTED_ITEM_CHANGED',
|
|
@@ -980,12 +1000,12 @@ function GlobalContextProvider(param) {
|
|
|
980
1000
|
}, children);
|
|
981
1001
|
}
|
|
982
1002
|
|
|
983
|
-
function _array_like_to_array$
|
|
1003
|
+
function _array_like_to_array$h(arr, len) {
|
|
984
1004
|
if (len == null || len > arr.length) len = arr.length;
|
|
985
1005
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
986
1006
|
return arr2;
|
|
987
1007
|
}
|
|
988
|
-
function _array_with_holes$
|
|
1008
|
+
function _array_with_holes$h(arr) {
|
|
989
1009
|
if (Array.isArray(arr)) return arr;
|
|
990
1010
|
}
|
|
991
1011
|
function _define_property$j(obj, key, value) {
|
|
@@ -1001,7 +1021,7 @@ function _define_property$j(obj, key, value) {
|
|
|
1001
1021
|
}
|
|
1002
1022
|
return obj;
|
|
1003
1023
|
}
|
|
1004
|
-
function _iterable_to_array_limit$
|
|
1024
|
+
function _iterable_to_array_limit$h(arr, i) {
|
|
1005
1025
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1006
1026
|
if (_i == null) return;
|
|
1007
1027
|
var _arr = [];
|
|
@@ -1025,7 +1045,7 @@ function _iterable_to_array_limit$f(arr, i) {
|
|
|
1025
1045
|
}
|
|
1026
1046
|
return _arr;
|
|
1027
1047
|
}
|
|
1028
|
-
function _non_iterable_rest$
|
|
1048
|
+
function _non_iterable_rest$h() {
|
|
1029
1049
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1030
1050
|
}
|
|
1031
1051
|
function _object_spread$j(target) {
|
|
@@ -1043,16 +1063,16 @@ function _object_spread$j(target) {
|
|
|
1043
1063
|
}
|
|
1044
1064
|
return target;
|
|
1045
1065
|
}
|
|
1046
|
-
function _sliced_to_array$
|
|
1047
|
-
return _array_with_holes$
|
|
1066
|
+
function _sliced_to_array$h(arr, i) {
|
|
1067
|
+
return _array_with_holes$h(arr) || _iterable_to_array_limit$h(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$h();
|
|
1048
1068
|
}
|
|
1049
|
-
function _unsupported_iterable_to_array$
|
|
1069
|
+
function _unsupported_iterable_to_array$h(o, minLen) {
|
|
1050
1070
|
if (!o) return;
|
|
1051
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1071
|
+
if (typeof o === "string") return _array_like_to_array$h(o, minLen);
|
|
1052
1072
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1053
1073
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1054
1074
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1055
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1075
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
|
|
1056
1076
|
}
|
|
1057
1077
|
function Button(param) {
|
|
1058
1078
|
var disabled = param.disabled, text = param.text, id = param.id, className = param.className, style = param.style, onClick = param.onClick, children = param.children, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
@@ -1060,7 +1080,7 @@ function Button(param) {
|
|
|
1060
1080
|
] : _param_padding, _param_margin = param.margin, margin = _param_margin === void 0 ? [
|
|
1061
1081
|
Spacing.none
|
|
1062
1082
|
] : _param_margin, _param_type = param.type, type = _param_type === void 0 ? ButtonType.latch : _param_type, _param_size = param.size, size = _param_size === void 0 ? ButtonSize.large : _param_size;
|
|
1063
|
-
var _React_useState = _sliced_to_array$
|
|
1083
|
+
var _React_useState = _sliced_to_array$h(React__default.useState(false), 2), isSelected = _React_useState[0], setIsSelected = _React_useState[1];
|
|
1064
1084
|
var buttonState = Juce.getToggleState(id);
|
|
1065
1085
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
1066
1086
|
var setModSlotRowTargetAsPreview = useGlobalContext().setModSlotRowTargetAsPreview;
|
|
@@ -1140,18 +1160,18 @@ Button.margin = Spacing;
|
|
|
1140
1160
|
Button.type = ButtonType;
|
|
1141
1161
|
Button.size = ButtonSize;
|
|
1142
1162
|
|
|
1143
|
-
var css_248z$
|
|
1144
|
-
styleInject(css_248z$
|
|
1163
|
+
var css_248z$9 = ".Dropdown-button {\n font-size: var(--text-sm);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--spacing-lg);\n cursor: pointer;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-transform: uppercase;\n text-align: center;\n border-radius: var(--radius-sm);\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n height: var(--spacing-xl);\n background: var(--color-gray-800);\n color: var(--color-text);\n &:hover,\n &:focus,\n &:active {\n outline: none;\n background-color: var(--bg-highlighted);\n }\n &:disabled {\n cursor: not-allowed;\n }\n}\n\n.Dropdown-items {\n border: 2px solid;\n}\n\n.Dropdown-item {\n background-color: var(--bg-page);\n font-size: var(--text-sm);\n padding: var(--spacing-md) var(--spacing-xl);\n min-width: 100px;\n color: var(--color-text);\n cursor: pointer;\n text-align: center;\n text-transform: uppercase;\n font-weight: bold;\n}\n\n.Dropdown-item[data-selected] {\n background-color: var(--bg-popover);\n color: var(--color-text);\n}\n\n.Dropdown-item[data-active] {\n background-color: var(--bg-popover);\n color: var(--color-text);\n}\n";
|
|
1164
|
+
styleInject(css_248z$9);
|
|
1145
1165
|
|
|
1146
|
-
function _array_like_to_array$
|
|
1166
|
+
function _array_like_to_array$g(arr, len) {
|
|
1147
1167
|
if (len == null || len > arr.length) len = arr.length;
|
|
1148
1168
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1149
1169
|
return arr2;
|
|
1150
1170
|
}
|
|
1151
|
-
function _array_with_holes$
|
|
1171
|
+
function _array_with_holes$g(arr) {
|
|
1152
1172
|
if (Array.isArray(arr)) return arr;
|
|
1153
1173
|
}
|
|
1154
|
-
function _iterable_to_array_limit$
|
|
1174
|
+
function _iterable_to_array_limit$g(arr, i) {
|
|
1155
1175
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1156
1176
|
if (_i == null) return;
|
|
1157
1177
|
var _arr = [];
|
|
@@ -1175,27 +1195,27 @@ function _iterable_to_array_limit$e(arr, i) {
|
|
|
1175
1195
|
}
|
|
1176
1196
|
return _arr;
|
|
1177
1197
|
}
|
|
1178
|
-
function _non_iterable_rest$
|
|
1198
|
+
function _non_iterable_rest$g() {
|
|
1179
1199
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1180
1200
|
}
|
|
1181
|
-
function _sliced_to_array$
|
|
1182
|
-
return _array_with_holes$
|
|
1201
|
+
function _sliced_to_array$g(arr, i) {
|
|
1202
|
+
return _array_with_holes$g(arr) || _iterable_to_array_limit$g(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$g();
|
|
1183
1203
|
}
|
|
1184
|
-
function _unsupported_iterable_to_array$
|
|
1204
|
+
function _unsupported_iterable_to_array$g(o, minLen) {
|
|
1185
1205
|
if (!o) return;
|
|
1186
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1206
|
+
if (typeof o === "string") return _array_like_to_array$g(o, minLen);
|
|
1187
1207
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1188
1208
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1189
1209
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1190
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1210
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
|
|
1191
1211
|
}
|
|
1192
1212
|
var useDropdown = function(param) {
|
|
1193
1213
|
var id = param.id, // TODO: Is there a better way to handle mod matrix dropdowns?
|
|
1194
1214
|
rowId = param.rowId, label = param.label, _param_items = param.items, items = _param_items === void 0 ? [] : _param_items, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, filter = param.filter, onChange = param.onChange, _param_displayValInHeader = param.displayValInHeader, displayValInHeader = _param_displayValInHeader === void 0 ? true : _param_displayValInHeader;
|
|
1195
1215
|
var _properties_choices;
|
|
1196
1216
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
1197
|
-
var _useState = _sliced_to_array$
|
|
1198
|
-
var _useState1 = _sliced_to_array$
|
|
1217
|
+
var _useState = _sliced_to_array$g(useState(comboBoxState.getChoiceIndex()), 2), index = _useState[0], setIndex = _useState[1];
|
|
1218
|
+
var _useState1 = _sliced_to_array$g(useState(comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
1199
1219
|
var _useGlobalContext = useGlobalContext(), highlightedItemChanged = _useGlobalContext.highlightedItemChanged, setModSlotRowTargetAsPreview = _useGlobalContext.setModSlotRowTargetAsPreview;
|
|
1200
1220
|
var choices = items.length ? items : (properties === null || properties === void 0 ? void 0 : (_properties_choices = properties.choices) === null || _properties_choices === void 0 ? void 0 : _properties_choices.length) ? properties === null || properties === void 0 ? void 0 : properties.choices : [];
|
|
1201
1221
|
var filteredChoices = filter ? choices === null || choices === void 0 ? void 0 : choices.filter(function(item) {
|
|
@@ -1581,15 +1601,15 @@ function Dropdown(param) {
|
|
|
1581
1601
|
}));
|
|
1582
1602
|
}
|
|
1583
1603
|
|
|
1584
|
-
var css_248z$
|
|
1585
|
-
styleInject(css_248z$
|
|
1604
|
+
var css_248z$8 = ".TextInput {\n pointer-events: auto;\n /* font-size: var(--text-xs); */\n}\n\n.TextInput::-moz-selection {\n background: transparent;\n}\n.TextInput::selection {\n background: transparent;\n}\n\n.TextInput:disabled {\n -webkit-user-select: none;\n user-select: none;\n}\n";
|
|
1605
|
+
styleInject(css_248z$8);
|
|
1586
1606
|
|
|
1587
|
-
function _array_like_to_array$
|
|
1607
|
+
function _array_like_to_array$f(arr, len) {
|
|
1588
1608
|
if (len == null || len > arr.length) len = arr.length;
|
|
1589
1609
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1590
1610
|
return arr2;
|
|
1591
1611
|
}
|
|
1592
|
-
function _array_with_holes$
|
|
1612
|
+
function _array_with_holes$f(arr) {
|
|
1593
1613
|
if (Array.isArray(arr)) return arr;
|
|
1594
1614
|
}
|
|
1595
1615
|
function _define_property$f(obj, key, value) {
|
|
@@ -1605,7 +1625,7 @@ function _define_property$f(obj, key, value) {
|
|
|
1605
1625
|
}
|
|
1606
1626
|
return obj;
|
|
1607
1627
|
}
|
|
1608
|
-
function _iterable_to_array_limit$
|
|
1628
|
+
function _iterable_to_array_limit$f(arr, i) {
|
|
1609
1629
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1610
1630
|
if (_i == null) return;
|
|
1611
1631
|
var _arr = [];
|
|
@@ -1629,7 +1649,7 @@ function _iterable_to_array_limit$d(arr, i) {
|
|
|
1629
1649
|
}
|
|
1630
1650
|
return _arr;
|
|
1631
1651
|
}
|
|
1632
|
-
function _non_iterable_rest$
|
|
1652
|
+
function _non_iterable_rest$f() {
|
|
1633
1653
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1634
1654
|
}
|
|
1635
1655
|
function _object_spread$f(target) {
|
|
@@ -1647,16 +1667,16 @@ function _object_spread$f(target) {
|
|
|
1647
1667
|
}
|
|
1648
1668
|
return target;
|
|
1649
1669
|
}
|
|
1650
|
-
function _sliced_to_array$
|
|
1651
|
-
return _array_with_holes$
|
|
1670
|
+
function _sliced_to_array$f(arr, i) {
|
|
1671
|
+
return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$f();
|
|
1652
1672
|
}
|
|
1653
|
-
function _unsupported_iterable_to_array$
|
|
1673
|
+
function _unsupported_iterable_to_array$f(o, minLen) {
|
|
1654
1674
|
if (!o) return;
|
|
1655
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1675
|
+
if (typeof o === "string") return _array_like_to_array$f(o, minLen);
|
|
1656
1676
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1657
1677
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1658
1678
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1659
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1679
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
|
|
1660
1680
|
}
|
|
1661
1681
|
// import { decimalToPercent, percentToDecimal } from '../../common/utils';
|
|
1662
1682
|
// import debounce from 'lodash.debounce';
|
|
@@ -1668,9 +1688,9 @@ var InputTypes = /*#__PURE__*/ function(InputTypes) {
|
|
|
1668
1688
|
function Input(param) {
|
|
1669
1689
|
var onComplete = param.onComplete, value = param.value; param.min; param.max; var _param_fontSize = param.fontSize, fontSize = _param_fontSize === void 0 ? FontSizes.xSmall : _param_fontSize, style = param.style, className = param.className, id = param.id, _param_textColor = param.textColor, textColor = _param_textColor === void 0 ? 'var(--color-text)' : _param_textColor;
|
|
1670
1690
|
var _inputRef_current;
|
|
1671
|
-
var _useState = _sliced_to_array$
|
|
1691
|
+
var _useState = _sliced_to_array$f(useState(value), 2), internalValue = _useState[0], setInternalValue = _useState[1];
|
|
1672
1692
|
// const [hasError, setHasError] = useState<boolean>(false);
|
|
1673
|
-
var _useState1 = _sliced_to_array$
|
|
1693
|
+
var _useState1 = _sliced_to_array$f(useState(false), 2), isHighlighted = _useState1[0], setIsHighlighted = _useState1[1];
|
|
1674
1694
|
var valueRef = useRef(null);
|
|
1675
1695
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
1676
1696
|
// Sets up listeners to handle changes on the backend
|
|
@@ -1814,15 +1834,15 @@ var SliderType = /*#__PURE__*/ function(SliderType) {
|
|
|
1814
1834
|
return SliderType;
|
|
1815
1835
|
}({});
|
|
1816
1836
|
|
|
1817
|
-
function _array_like_to_array$
|
|
1837
|
+
function _array_like_to_array$e(arr, len) {
|
|
1818
1838
|
if (len == null || len > arr.length) len = arr.length;
|
|
1819
1839
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1820
1840
|
return arr2;
|
|
1821
1841
|
}
|
|
1822
|
-
function _array_with_holes$
|
|
1842
|
+
function _array_with_holes$e(arr) {
|
|
1823
1843
|
if (Array.isArray(arr)) return arr;
|
|
1824
1844
|
}
|
|
1825
|
-
function _iterable_to_array_limit$
|
|
1845
|
+
function _iterable_to_array_limit$e(arr, i) {
|
|
1826
1846
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1827
1847
|
if (_i == null) return;
|
|
1828
1848
|
var _arr = [];
|
|
@@ -1846,19 +1866,19 @@ function _iterable_to_array_limit$c(arr, i) {
|
|
|
1846
1866
|
}
|
|
1847
1867
|
return _arr;
|
|
1848
1868
|
}
|
|
1849
|
-
function _non_iterable_rest$
|
|
1869
|
+
function _non_iterable_rest$e() {
|
|
1850
1870
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1851
1871
|
}
|
|
1852
|
-
function _sliced_to_array$
|
|
1853
|
-
return _array_with_holes$
|
|
1872
|
+
function _sliced_to_array$e(arr, i) {
|
|
1873
|
+
return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$e(arr, i) || _non_iterable_rest$e();
|
|
1854
1874
|
}
|
|
1855
|
-
function _unsupported_iterable_to_array$
|
|
1875
|
+
function _unsupported_iterable_to_array$e(o, minLen) {
|
|
1856
1876
|
if (!o) return;
|
|
1857
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1877
|
+
if (typeof o === "string") return _array_like_to_array$e(o, minLen);
|
|
1858
1878
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1859
1879
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1860
1880
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1861
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1881
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
|
|
1862
1882
|
}
|
|
1863
1883
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
1864
1884
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
@@ -1869,34 +1889,6 @@ var useSlider = function(param) {
|
|
|
1869
1889
|
interval: 0.1,
|
|
1870
1890
|
skew: 0.7
|
|
1871
1891
|
} : _param_mockProperties, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, _param_orientation = param.orientation, orientation = _param_orientation === void 0 ? Orientation.vertical : _param_orientation, _param_dragOrientation = param.dragOrientation, dragOrientation = _param_dragOrientation === void 0 ? Orientation.vertical : _param_dragOrientation, _param_mockInitialNormalisedValue = param.mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0.0 : _param_mockInitialNormalisedValue, onChange = param.onChange; param.sliderElementRef; var _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled;
|
|
1872
|
-
var clickListener = function clickListener(event) {
|
|
1873
|
-
var _event_target_closest;
|
|
1874
|
-
if (((_event_target_closest = event.target.closest('.Slider')) === null || _event_target_closest === void 0 ? void 0 : _event_target_closest.id) === id) {
|
|
1875
|
-
var // Update the preview mod slot target selection in the mod matrix.
|
|
1876
|
-
// This selection will be saved to the back end when a modifier is set for the target.
|
|
1877
|
-
_document_getElementById;
|
|
1878
|
-
setIsActive(true);
|
|
1879
|
-
(_document_getElementById = document.getElementById(id)) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.focus();
|
|
1880
|
-
event.stopPropagation();
|
|
1881
|
-
} else {
|
|
1882
|
-
var _document_getElementById1;
|
|
1883
|
-
setIsActive(false);
|
|
1884
|
-
(_document_getElementById1 = document.getElementById(id)) === null || _document_getElementById1 === void 0 ? void 0 : _document_getElementById1.blur();
|
|
1885
|
-
event.stopPropagation();
|
|
1886
|
-
}
|
|
1887
|
-
};
|
|
1888
|
-
var keyDownListener = function keyDownListener(event) {
|
|
1889
|
-
if (isActive) {
|
|
1890
|
-
if (event.key === 'ArrowLeft') {
|
|
1891
|
-
event.preventDefault();
|
|
1892
|
-
decrementValue();
|
|
1893
|
-
}
|
|
1894
|
-
if (event.key === 'ArrowRight') {
|
|
1895
|
-
event.preventDefault();
|
|
1896
|
-
incrementValue();
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
};
|
|
1900
1892
|
// const sliderState: JuceSlider = Juce.getSliderState(id);
|
|
1901
1893
|
// if isLocalhost is true, the front end app is running outside of JUCE in a browser.
|
|
1902
1894
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
@@ -1909,30 +1901,16 @@ var useSlider = function(param) {
|
|
|
1909
1901
|
* AudioProcessorParameter::getValue() (C++).
|
|
1910
1902
|
*/ // See https://github.com/juce-framework/JUCE/blob/51d11a2be6d5c97ccf12b4e5e827006e19f0555a/modules/juce_gui_extra/native/javascript/index.js#L230C1-L238C6
|
|
1911
1903
|
// NOTE: We can think of this as a percentage value, in 0 to 1 format
|
|
1912
|
-
var _useState = _sliced_to_array$
|
|
1904
|
+
var _useState = _sliced_to_array$e(useState(0), 2), scaledValue = _useState[0], setScaledValue = _useState[1];
|
|
1913
1905
|
// const [normalisedValue, setNormalisedValue] = useState(0);
|
|
1914
|
-
var _useState1 = _sliced_to_array$
|
|
1906
|
+
var _useState1 = _sliced_to_array$e(useState(), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
1915
1907
|
var scaledValueRef = useRef(null);
|
|
1916
1908
|
var normalisedValueRef = useRef(null);
|
|
1917
1909
|
var sliderState = Juce.getSliderState(id);
|
|
1918
1910
|
var prevValueRef = useRef(null);
|
|
1919
1911
|
// const randomValueSetCounter = useRef<number>(null);
|
|
1920
|
-
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged, setDefaultParameter = _useGlobalContext.setDefaultParameter, setModSlotRowTargetAsPreview = _useGlobalContext.setModSlotRowTargetAsPreview,
|
|
1921
|
-
|
|
1922
|
-
var _useState2 = _sliced_to_array$c(useState(false), 2), isActive = _useState2[0], setIsActive = _useState2[1];
|
|
1923
|
-
useEffect(function() {
|
|
1924
|
-
document.addEventListener('click', clickListener);
|
|
1925
|
-
document.addEventListener('keydown', keyDownListener);
|
|
1926
|
-
return function() {
|
|
1927
|
-
document.removeEventListener('click', clickListener);
|
|
1928
|
-
document.removeEventListener('keydown', keyDownListener);
|
|
1929
|
-
};
|
|
1930
|
-
}, [
|
|
1931
|
-
window,
|
|
1932
|
-
isActive,
|
|
1933
|
-
automatableParamsList,
|
|
1934
|
-
modSlotTargets
|
|
1935
|
-
]);
|
|
1912
|
+
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged, setDefaultParameter = _useGlobalContext.setDefaultParameter, setModSlotRowTargetAsPreview = _useGlobalContext.setModSlotRowTargetAsPreview, // setModSlotRowTarget,
|
|
1913
|
+
modSlotPreview = _useGlobalContext.globalState.modSlotPreview;
|
|
1936
1914
|
// Set the initial state
|
|
1937
1915
|
//@ts-expect-error
|
|
1938
1916
|
useEffect(function() {
|
|
@@ -2020,34 +1998,6 @@ var useSlider = function(param) {
|
|
|
2020
1998
|
normalisedValueRef.current = fixedNewValue;
|
|
2021
1999
|
}
|
|
2022
2000
|
};
|
|
2023
|
-
var updateValue = function(changeVal) {
|
|
2024
|
-
var getNormalisedInterval = function() {
|
|
2025
|
-
if (properties === null || properties === void 0 ? void 0 : properties.interval) {
|
|
2026
|
-
if ((properties === null || properties === void 0 ? void 0 : properties.interval) >= 1) {
|
|
2027
|
-
return (properties === null || properties === void 0 ? void 0 : properties.interval) * 0.01;
|
|
2028
|
-
} else {
|
|
2029
|
-
return properties === null || properties === void 0 ? void 0 : properties.interval;
|
|
2030
|
-
}
|
|
2031
|
-
} else {
|
|
2032
|
-
return 0.01;
|
|
2033
|
-
}
|
|
2034
|
-
};
|
|
2035
|
-
var normalisedInterval = getNormalisedInterval();
|
|
2036
|
-
var _normalisedValueRef_current;
|
|
2037
|
-
var newValue = ((_normalisedValueRef_current = normalisedValueRef.current) !== null && _normalisedValueRef_current !== void 0 ? _normalisedValueRef_current : 0) + changeVal * // (properties?.interval && properties?.interval.toString().length > 4
|
|
2038
|
-
// ? 4
|
|
2039
|
-
// : 0.4) *
|
|
2040
|
-
normalisedInterval;
|
|
2041
|
-
return clamp(newValue);
|
|
2042
|
-
};
|
|
2043
|
-
var incrementValue = function() {
|
|
2044
|
-
var newValue = updateValue(10);
|
|
2045
|
-
setNormalisedState(newValue);
|
|
2046
|
-
};
|
|
2047
|
-
var decrementValue = function() {
|
|
2048
|
-
var newValue = updateValue(-10);
|
|
2049
|
-
setNormalisedState(newValue);
|
|
2050
|
-
};
|
|
2051
2001
|
var setScaledState = function(newValue) {
|
|
2052
2002
|
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== newValue) {
|
|
2053
2003
|
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2;
|
|
@@ -2076,7 +2026,11 @@ var useSlider = function(param) {
|
|
|
2076
2026
|
onDrag: function(param) {
|
|
2077
2027
|
param.event; var delta = param.delta;
|
|
2078
2028
|
var deltaVal = delta[1] * -1;
|
|
2079
|
-
var newValue =
|
|
2029
|
+
var newValue = incrementValue({
|
|
2030
|
+
incomingVal: deltaVal,
|
|
2031
|
+
prevVal: normalisedValueRef.current || 0,
|
|
2032
|
+
interval: properties === null || properties === void 0 ? void 0 : properties.interval
|
|
2033
|
+
});
|
|
2080
2034
|
setNormalisedState(newValue);
|
|
2081
2035
|
},
|
|
2082
2036
|
onMouseUp: function(param) {
|
|
@@ -2175,9 +2129,6 @@ var useSlider = function(param) {
|
|
|
2175
2129
|
setNormalisedState: setNormalisedState,
|
|
2176
2130
|
setScaledState: setScaledState,
|
|
2177
2131
|
setToDefaultState: setToDefaultState,
|
|
2178
|
-
incrementValue: incrementValue,
|
|
2179
|
-
decrementValue: decrementValue,
|
|
2180
|
-
isActive: isActive,
|
|
2181
2132
|
scaledToNormalised: scaledToNormalised,
|
|
2182
2133
|
bindBarSliderDrag: bindBarSliderDrag,
|
|
2183
2134
|
bindSequenceBarSliderDrag: bindSequenceBarSliderDrag,
|
|
@@ -2188,9 +2139,140 @@ var useSlider = function(param) {
|
|
|
2188
2139
|
};
|
|
2189
2140
|
};
|
|
2190
2141
|
|
|
2191
|
-
var css_248z$
|
|
2142
|
+
var css_248z$7 = ".RotarySlider {\n /* position: relative; */\n /* border-radius: 50%; */\n display: flex;\n flex-direction: column;\n justify-content: center;\n aspect-ratio: 1 / 1;\n border: 1px solid transparent;\n}\n\n.RotarySlider-Inner {\n height: 100%;\n width: 100%;\n right: 0;\n top: 0;\n bottom: 0;\n left: 0;\n background-color: var(--bg-popover);\n border-radius: 50%;\n}\n\n.RotarySlider-Indicator {\n position: absolute;\n top: 0;\n right: 0;\n left: 50%;\n width: var(--spacing-xs);\n height: 50%;\n transform: translate(-50%, 0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);\n}\n\n.RotarySlider-center-marker {\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 0 5px 8px 5px;\n transform: rotate(180deg);\n padding-bottom: var(--spacing-sm);\n}\n\n.ProgressCircle-wrapper {\n position: relative;\n}\n.ProgressCircle {\n fill: none;\n pointer-events: none;\n}\n\n.ProgressCircle-value {\n text-align: center;\n margin-top: -3px;\n height: 0.8rem;\n line-height: 0.8rem;\n}\n\n.ProgressCircle-bg {\n stroke-width: 3px;\n transform-origin: center;\n transform: rotate(135deg);\n stroke-linecap: round;\n font-size: var(--text-sm);\n pointer-events: none;\n}\n.ProgressCircle-fg {\n stroke-width: 3px;\n /* stroke-dasharray: 75; */\n /* stroke-dashoffset: calc(880 - (660 * 0) / 100); */\n transform-origin: center;\n stroke-linecap: round;\n pointer-events: none;\n}\n\n.corner-border {\n --b: 1px; /* thickness of the border */\n --c: var(--color-gray-500); /* color of the border */\n --w: 5px; /* width of border */\n\n border: var(--b) solid #0000; /* space for the border */\n --_g: #0000 90deg, var(--c) 0;\n --_p: var(--w) var(--w) border-box no-repeat;\n background:\n conic-gradient(from 90deg at top var(--b) left var(--b), var(--_g)) 0 0 /\n var(--_p),\n conic-gradient(from 180deg at top var(--b) right var(--b), var(--_g)) 100% 0 /\n var(--_p),\n conic-gradient(from 0deg at bottom var(--b) left var(--b), var(--_g)) 0 100% /\n var(--_p),\n conic-gradient(from -90deg at bottom var(--b) right var(--b), var(--_g))\n 100% 100% / var(--_p);\n}\n";
|
|
2143
|
+
styleInject(css_248z$7);
|
|
2144
|
+
|
|
2145
|
+
var css_248z$6 = "";
|
|
2192
2146
|
styleInject(css_248z$6);
|
|
2193
2147
|
|
|
2148
|
+
function _array_like_to_array$d(arr, len) {
|
|
2149
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
2150
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2151
|
+
return arr2;
|
|
2152
|
+
}
|
|
2153
|
+
function _array_with_holes$d(arr) {
|
|
2154
|
+
if (Array.isArray(arr)) return arr;
|
|
2155
|
+
}
|
|
2156
|
+
function _iterable_to_array_limit$d(arr, i) {
|
|
2157
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2158
|
+
if (_i == null) return;
|
|
2159
|
+
var _arr = [];
|
|
2160
|
+
var _n = true;
|
|
2161
|
+
var _d = false;
|
|
2162
|
+
var _s, _e;
|
|
2163
|
+
try {
|
|
2164
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
2165
|
+
_arr.push(_s.value);
|
|
2166
|
+
if (i && _arr.length === i) break;
|
|
2167
|
+
}
|
|
2168
|
+
} catch (err) {
|
|
2169
|
+
_d = true;
|
|
2170
|
+
_e = err;
|
|
2171
|
+
} finally{
|
|
2172
|
+
try {
|
|
2173
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
2174
|
+
} finally{
|
|
2175
|
+
if (_d) throw _e;
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
return _arr;
|
|
2179
|
+
}
|
|
2180
|
+
function _non_iterable_rest$d() {
|
|
2181
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2182
|
+
}
|
|
2183
|
+
function _sliced_to_array$d(arr, i) {
|
|
2184
|
+
return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$d();
|
|
2185
|
+
}
|
|
2186
|
+
function _unsupported_iterable_to_array$d(o, minLen) {
|
|
2187
|
+
if (!o) return;
|
|
2188
|
+
if (typeof o === "string") return _array_like_to_array$d(o, minLen);
|
|
2189
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2190
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2191
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2192
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
|
|
2193
|
+
}
|
|
2194
|
+
function ControlGroup(param) {
|
|
2195
|
+
var id = param.id, isDisabled = param.isDisabled, className = param.className, onChangeActiveState = param.onChangeActiveState, children = param.children;
|
|
2196
|
+
// EXAMPLE CONTROL GROUP STRUCTURE
|
|
2197
|
+
// <ControlGroup id={id-control-group} is-active>
|
|
2198
|
+
// <Slider id={id}></Slider>
|
|
2199
|
+
// <Input id={id-input}></Input>
|
|
2200
|
+
// </ControlGroup>
|
|
2201
|
+
var groupId = "".concat(id, "-control-group");
|
|
2202
|
+
var _useState = _sliced_to_array$d(useState(false), 2), isActive = _useState[0], setIsActive = _useState[1];
|
|
2203
|
+
var sliderState = Juce.getSliderState(id);
|
|
2204
|
+
var clickListener = function(event) {
|
|
2205
|
+
if (!isDisabled) {
|
|
2206
|
+
var _event_target_closest;
|
|
2207
|
+
document.getElementById("".concat(id, "-input")).disabled = false;
|
|
2208
|
+
if (((_event_target_closest = event.target.closest('.controlGroup')) === null || _event_target_closest === void 0 ? void 0 : _event_target_closest.id) === groupId) {
|
|
2209
|
+
var _document_getElementById, _document_getElementById1;
|
|
2210
|
+
setIsActive(true);
|
|
2211
|
+
onChangeActiveState && onChangeActiveState(true);
|
|
2212
|
+
(_document_getElementById = document.getElementById("".concat(id, "-input"))) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.focus();
|
|
2213
|
+
(_document_getElementById1 = document.getElementById("".concat(id, "-input"))) === null || _document_getElementById1 === void 0 ? void 0 : _document_getElementById1.select();
|
|
2214
|
+
// event.stopPropagation();
|
|
2215
|
+
} else {
|
|
2216
|
+
var _document_getElementById2;
|
|
2217
|
+
setIsActive(false);
|
|
2218
|
+
onChangeActiveState && onChangeActiveState(false);
|
|
2219
|
+
(_document_getElementById2 = document.getElementById("".concat(id, "-input"))) === null || _document_getElementById2 === void 0 ? void 0 : _document_getElementById2.blur();
|
|
2220
|
+
// event.stopPropagation();
|
|
2221
|
+
}
|
|
2222
|
+
} else {
|
|
2223
|
+
document.getElementById("".concat(id, "-input")).disabled = true;
|
|
2224
|
+
}
|
|
2225
|
+
};
|
|
2226
|
+
var increment = function() {
|
|
2227
|
+
var _sliderState_properties;
|
|
2228
|
+
var normalisedVal = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
2229
|
+
var newValue = incrementValue({
|
|
2230
|
+
incomingVal: 10,
|
|
2231
|
+
prevVal: normalisedVal,
|
|
2232
|
+
interval: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.interval
|
|
2233
|
+
});
|
|
2234
|
+
sliderState.setNormalisedValue(newValue);
|
|
2235
|
+
};
|
|
2236
|
+
var decrement = function() {
|
|
2237
|
+
var _sliderState_properties;
|
|
2238
|
+
var normalisedVal = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
2239
|
+
var newValue = incrementValue({
|
|
2240
|
+
incomingVal: -10,
|
|
2241
|
+
prevVal: normalisedVal,
|
|
2242
|
+
interval: sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.interval
|
|
2243
|
+
});
|
|
2244
|
+
sliderState === null || sliderState === void 0 ? void 0 : sliderState.setNormalisedValue(newValue);
|
|
2245
|
+
};
|
|
2246
|
+
function keyDownListener(event) {
|
|
2247
|
+
if (isActive && !isDisabled) {
|
|
2248
|
+
if (event.key === 'ArrowLeft') {
|
|
2249
|
+
event.preventDefault();
|
|
2250
|
+
decrement();
|
|
2251
|
+
}
|
|
2252
|
+
if (event.key === 'ArrowRight') {
|
|
2253
|
+
event.preventDefault();
|
|
2254
|
+
increment();
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
useEffect(function() {
|
|
2259
|
+
document.addEventListener('click', clickListener);
|
|
2260
|
+
document.addEventListener('keydown', keyDownListener);
|
|
2261
|
+
return function() {
|
|
2262
|
+
document.removeEventListener('click', clickListener);
|
|
2263
|
+
document.removeEventListener('keydown', keyDownListener);
|
|
2264
|
+
};
|
|
2265
|
+
}, [
|
|
2266
|
+
window,
|
|
2267
|
+
isActive,
|
|
2268
|
+
isDisabled
|
|
2269
|
+
]);
|
|
2270
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
2271
|
+
id: groupId,
|
|
2272
|
+
className: "controlGroup ".concat(isActive ? 'isActive' : '', " ").concat(isDisabled ? 'isDisabled' : '', " ").concat(className)
|
|
2273
|
+
}, children);
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2194
2276
|
function _define_property$e(obj, key, value) {
|
|
2195
2277
|
if (key in obj) {
|
|
2196
2278
|
Object.defineProperty(obj, key, {
|
|
@@ -2309,7 +2391,9 @@ function RotarySlider(param) {
|
|
|
2309
2391
|
}), bindDrag = _useSlider.bindDrag, normalisedValue = _useSlider.normalisedValue, scaledValue = _useSlider.scaledValue, // onMouseEnter,
|
|
2310
2392
|
setToDefaultState = _useSlider.setToDefaultState, setNormalisedState = _useSlider.setNormalisedState, // isActive,
|
|
2311
2393
|
properties = _useSlider.properties;
|
|
2312
|
-
return /*#__PURE__*/ React__default.createElement(
|
|
2394
|
+
return /*#__PURE__*/ React__default.createElement(ControlGroup, {
|
|
2395
|
+
id: id
|
|
2396
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
2313
2397
|
className: "RotarySlider-wrapper",
|
|
2314
2398
|
flexDirection: Box.flexDirection.column,
|
|
2315
2399
|
gap: Box.gap.none,
|
|
@@ -2370,7 +2454,7 @@ function RotarySlider(param) {
|
|
|
2370
2454
|
],
|
|
2371
2455
|
fontSize: Label.fontSize.xSmall,
|
|
2372
2456
|
value: label
|
|
2373
|
-
}));
|
|
2457
|
+
})));
|
|
2374
2458
|
}
|
|
2375
2459
|
RotarySlider.sliderPolarity = Polarity;
|
|
2376
2460
|
|
|
@@ -2546,15 +2630,15 @@ Heading.fontSize = FontSizes;
|
|
|
2546
2630
|
Heading.tag = HeadingTags;
|
|
2547
2631
|
Heading.padding = Spacing;
|
|
2548
2632
|
|
|
2549
|
-
function _array_like_to_array$
|
|
2633
|
+
function _array_like_to_array$c(arr, len) {
|
|
2550
2634
|
if (len == null || len > arr.length) len = arr.length;
|
|
2551
2635
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2552
2636
|
return arr2;
|
|
2553
2637
|
}
|
|
2554
|
-
function _array_with_holes$
|
|
2638
|
+
function _array_with_holes$c(arr) {
|
|
2555
2639
|
if (Array.isArray(arr)) return arr;
|
|
2556
2640
|
}
|
|
2557
|
-
function _iterable_to_array_limit$
|
|
2641
|
+
function _iterable_to_array_limit$c(arr, i) {
|
|
2558
2642
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2559
2643
|
if (_i == null) return;
|
|
2560
2644
|
var _arr = [];
|
|
@@ -2578,26 +2662,26 @@ function _iterable_to_array_limit$b(arr, i) {
|
|
|
2578
2662
|
}
|
|
2579
2663
|
return _arr;
|
|
2580
2664
|
}
|
|
2581
|
-
function _non_iterable_rest$
|
|
2665
|
+
function _non_iterable_rest$c() {
|
|
2582
2666
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2583
2667
|
}
|
|
2584
|
-
function _sliced_to_array$
|
|
2585
|
-
return _array_with_holes$
|
|
2668
|
+
function _sliced_to_array$c(arr, i) {
|
|
2669
|
+
return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$c();
|
|
2586
2670
|
}
|
|
2587
|
-
function _unsupported_iterable_to_array$
|
|
2671
|
+
function _unsupported_iterable_to_array$c(o, minLen) {
|
|
2588
2672
|
if (!o) return;
|
|
2589
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2673
|
+
if (typeof o === "string") return _array_like_to_array$c(o, minLen);
|
|
2590
2674
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2591
2675
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2592
2676
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2593
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2677
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
|
|
2594
2678
|
}
|
|
2595
2679
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
2596
2680
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
2597
2681
|
var useIndicator = function(param) {
|
|
2598
2682
|
var id = param.id;
|
|
2599
2683
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
2600
|
-
var _useState = _sliced_to_array$
|
|
2684
|
+
var _useState = _sliced_to_array$c(useState(0), 2), isActive = _useState[0], setIsActive = _useState[1];
|
|
2601
2685
|
// Set the initial state
|
|
2602
2686
|
useEffect(function() {
|
|
2603
2687
|
if (!isLocalhost) {
|
|
@@ -3180,12 +3264,12 @@ function LinePlot(param) {
|
|
|
3180
3264
|
var css_248z$4 = ".Oscilloscope {\n background: #0EAC8B;\n box-shadow: inset 0 0 20px #086350;\n height: 200px;\n };";
|
|
3181
3265
|
styleInject(css_248z$4);
|
|
3182
3266
|
|
|
3183
|
-
function _array_like_to_array$
|
|
3267
|
+
function _array_like_to_array$b(arr, len) {
|
|
3184
3268
|
if (len == null || len > arr.length) len = arr.length;
|
|
3185
3269
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3186
3270
|
return arr2;
|
|
3187
3271
|
}
|
|
3188
|
-
function _array_with_holes$
|
|
3272
|
+
function _array_with_holes$b(arr) {
|
|
3189
3273
|
if (Array.isArray(arr)) return arr;
|
|
3190
3274
|
}
|
|
3191
3275
|
function _define_property$7(obj, key, value) {
|
|
@@ -3201,7 +3285,7 @@ function _define_property$7(obj, key, value) {
|
|
|
3201
3285
|
}
|
|
3202
3286
|
return obj;
|
|
3203
3287
|
}
|
|
3204
|
-
function _iterable_to_array_limit$
|
|
3288
|
+
function _iterable_to_array_limit$b(arr, i) {
|
|
3205
3289
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3206
3290
|
if (_i == null) return;
|
|
3207
3291
|
var _arr = [];
|
|
@@ -3225,7 +3309,7 @@ function _iterable_to_array_limit$a(arr, i) {
|
|
|
3225
3309
|
}
|
|
3226
3310
|
return _arr;
|
|
3227
3311
|
}
|
|
3228
|
-
function _non_iterable_rest$
|
|
3312
|
+
function _non_iterable_rest$b() {
|
|
3229
3313
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3230
3314
|
}
|
|
3231
3315
|
function _object_spread$7(target) {
|
|
@@ -3243,20 +3327,20 @@ function _object_spread$7(target) {
|
|
|
3243
3327
|
}
|
|
3244
3328
|
return target;
|
|
3245
3329
|
}
|
|
3246
|
-
function _sliced_to_array$
|
|
3247
|
-
return _array_with_holes$
|
|
3330
|
+
function _sliced_to_array$b(arr, i) {
|
|
3331
|
+
return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$b();
|
|
3248
3332
|
}
|
|
3249
|
-
function _unsupported_iterable_to_array$
|
|
3333
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
3250
3334
|
if (!o) return;
|
|
3251
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3335
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
3252
3336
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3253
3337
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3254
3338
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3255
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3339
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
3256
3340
|
}
|
|
3257
3341
|
function Oscilloscope(param) {
|
|
3258
3342
|
var width = param.width, height = param.height, className = param.className, style = param.style, id = param.id;
|
|
3259
|
-
var _useState = _sliced_to_array$
|
|
3343
|
+
var _useState = _sliced_to_array$b(useState([]), 2), viewData = _useState[0], setViewData = _useState[1];
|
|
3260
3344
|
var cycleLength = useRef(0);
|
|
3261
3345
|
useEffect(function() {
|
|
3262
3346
|
//@ts-expect-error
|
|
@@ -3300,12 +3384,12 @@ styleInject(css_248z$3);
|
|
|
3300
3384
|
var css_248z$2 = ".PresetManagerContainer {\n width: 100%;\n height: 100%;\n background-color: var(--bg-page);\n color: var(--color-text);\n}\n\n.PresetManagerButton {\n width: 100%;\n height: 100%;\n max-width: 300px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n cursor: pointer;\n font-family: var(--font-leagueSpartan);\n}\n.PresetManagerButtonLabel {\n cursor: pointer;\n text-align: center;\n font-family: var(--font-leagueSpartan);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 225px;\n display: inline-block;\n vertical-align: middle;\n height: 1rem;\n line-height: 1.25;\n /* position: relative; */\n &:hover,\n &:active {\n background: var(--color-gray-900);\n }\n /* &.isDirty {\n &::after {\n content: '*';\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n } */\n}\n\n.PresetManagerButtonLabelContainer.isDirty::after {\n content: '*';\n position: absolute;\n height: 1rem;\n width: 1rem;\n right: -0.75rem;\n top: 0;\n}\n\n.PresetManagerButtonLabelOuterContainer {\n position: relative;\n width: auto;\n}\n\n[data-headlessui-state='open active'] .PresetManagerButtonLabel {\n background: var(--color-gray-900);\n}\n.PresetManagerPanel {\n position: absolute;\n font-family: var(--font-leagueSpartan);\n right: 0px;\n left: 0px;\n width: 100%;\n max-width: 400px !important;\n color: var(--color-text);\n background: var(--bg-popover);\n}\n\n.PresetManagerPanel:focus,\n.PresetManagerPanel:focus-visible {\n outline: none;\n}\n\n/* .PresetManagerCategoryItem {\n font-family: var(--font-leagueSpartan);\n cursor: pointer;\n background: var(--color-gray-800);\n text-transform: uppercase;\n &:hover,\n &.isSelected {\n background: var(--bg-selected);\n }\n} */\n\n.PresetManagerListItem {\n cursor: pointer;\n background: var(--color-gray-800);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n}\n\n.PresetManagerListItem:hover,\n.PresetManagerListItem.isSelected {\n background: var(--bg-selected);\n}\n\n.PresetManagerListItemText {\n display: inline-block;\n vertical-align: middle;\n height: 1.5rem;\n line-height: 1.75;\n}\n";
|
|
3301
3385
|
styleInject(css_248z$2);
|
|
3302
3386
|
|
|
3303
|
-
function _array_like_to_array$
|
|
3387
|
+
function _array_like_to_array$a(arr, len) {
|
|
3304
3388
|
if (len == null || len > arr.length) len = arr.length;
|
|
3305
3389
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3306
3390
|
return arr2;
|
|
3307
3391
|
}
|
|
3308
|
-
function _array_with_holes$
|
|
3392
|
+
function _array_with_holes$a(arr) {
|
|
3309
3393
|
if (Array.isArray(arr)) return arr;
|
|
3310
3394
|
}
|
|
3311
3395
|
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -3337,7 +3421,7 @@ function _async_to_generator$3(fn) {
|
|
|
3337
3421
|
});
|
|
3338
3422
|
};
|
|
3339
3423
|
}
|
|
3340
|
-
function _iterable_to_array_limit$
|
|
3424
|
+
function _iterable_to_array_limit$a(arr, i) {
|
|
3341
3425
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3342
3426
|
if (_i == null) return;
|
|
3343
3427
|
var _arr = [];
|
|
@@ -3361,23 +3445,23 @@ function _iterable_to_array_limit$9(arr, i) {
|
|
|
3361
3445
|
}
|
|
3362
3446
|
return _arr;
|
|
3363
3447
|
}
|
|
3364
|
-
function _non_iterable_rest$
|
|
3448
|
+
function _non_iterable_rest$a() {
|
|
3365
3449
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3366
3450
|
}
|
|
3367
3451
|
function _object_destructuring_empty(o) {
|
|
3368
3452
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
3369
3453
|
return o;
|
|
3370
3454
|
}
|
|
3371
|
-
function _sliced_to_array$
|
|
3372
|
-
return _array_with_holes$
|
|
3455
|
+
function _sliced_to_array$a(arr, i) {
|
|
3456
|
+
return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$a();
|
|
3373
3457
|
}
|
|
3374
|
-
function _unsupported_iterable_to_array$
|
|
3458
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
3375
3459
|
if (!o) return;
|
|
3376
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3460
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
3377
3461
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3378
3462
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3379
3463
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3380
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3464
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
3381
3465
|
}
|
|
3382
3466
|
function _ts_generator$3(thisArg, body) {
|
|
3383
3467
|
var f, y, t, _ = {
|
|
@@ -3472,16 +3556,16 @@ function _ts_generator$3(thisArg, body) {
|
|
|
3472
3556
|
}
|
|
3473
3557
|
function PresetManager(param) {
|
|
3474
3558
|
_object_destructuring_empty(param);
|
|
3475
|
-
var _useState = _sliced_to_array$
|
|
3476
|
-
var _useState1 = _sliced_to_array$
|
|
3559
|
+
var _useState = _sliced_to_array$a(useState([]), 2), presetList = _useState[0], setPresetList = _useState[1];
|
|
3560
|
+
var _useState1 = _sliced_to_array$a(useState(false), 2); _useState1[0]; var setIsSaving = _useState1[1];
|
|
3477
3561
|
var savePresetFunc = Juce.getNativeFunction('savePreset');
|
|
3478
3562
|
var loadPresetFunc = Juce.getNativeFunction('loadPreset');
|
|
3479
3563
|
var getAllPresetsFunc = Juce.getNativeFunction('getAllPresets');
|
|
3480
3564
|
var getCurrentPresetFunc = Juce.getNativeFunction('getCurrentPreset');
|
|
3481
3565
|
var isDirtyFunc = Juce.getNativeFunction('canUndo');
|
|
3482
|
-
var _useState2 = _sliced_to_array$
|
|
3566
|
+
var _useState2 = _sliced_to_array$a(useState(), 2), selectedPreset = _useState2[0], setSelectedPreset = _useState2[1];
|
|
3483
3567
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
3484
|
-
var _useState3 = _sliced_to_array$
|
|
3568
|
+
var _useState3 = _sliced_to_array$a(useState(false), 2), isDirty = _useState3[0], setIsDirty = _useState3[1];
|
|
3485
3569
|
useEffect(function() {
|
|
3486
3570
|
if (!isLocalhost) {
|
|
3487
3571
|
var isDirtyListenerId = //@ts-expect-error
|
|
@@ -3757,12 +3841,12 @@ function PresetManager(param) {
|
|
|
3757
3841
|
}))))));
|
|
3758
3842
|
}
|
|
3759
3843
|
|
|
3760
|
-
function _array_like_to_array$
|
|
3844
|
+
function _array_like_to_array$9(arr, len) {
|
|
3761
3845
|
if (len == null || len > arr.length) len = arr.length;
|
|
3762
3846
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3763
3847
|
return arr2;
|
|
3764
3848
|
}
|
|
3765
|
-
function _array_with_holes$
|
|
3849
|
+
function _array_with_holes$9(arr) {
|
|
3766
3850
|
if (Array.isArray(arr)) return arr;
|
|
3767
3851
|
}
|
|
3768
3852
|
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -3807,7 +3891,7 @@ function _define_property$6(obj, key, value) {
|
|
|
3807
3891
|
}
|
|
3808
3892
|
return obj;
|
|
3809
3893
|
}
|
|
3810
|
-
function _iterable_to_array_limit$
|
|
3894
|
+
function _iterable_to_array_limit$9(arr, i) {
|
|
3811
3895
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3812
3896
|
if (_i == null) return;
|
|
3813
3897
|
var _arr = [];
|
|
@@ -3831,7 +3915,7 @@ function _iterable_to_array_limit$8(arr, i) {
|
|
|
3831
3915
|
}
|
|
3832
3916
|
return _arr;
|
|
3833
3917
|
}
|
|
3834
|
-
function _non_iterable_rest$
|
|
3918
|
+
function _non_iterable_rest$9() {
|
|
3835
3919
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3836
3920
|
}
|
|
3837
3921
|
function _object_spread$6(target) {
|
|
@@ -3849,16 +3933,16 @@ function _object_spread$6(target) {
|
|
|
3849
3933
|
}
|
|
3850
3934
|
return target;
|
|
3851
3935
|
}
|
|
3852
|
-
function _sliced_to_array$
|
|
3853
|
-
return _array_with_holes$
|
|
3936
|
+
function _sliced_to_array$9(arr, i) {
|
|
3937
|
+
return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$9();
|
|
3854
3938
|
}
|
|
3855
|
-
function _unsupported_iterable_to_array$
|
|
3939
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
3856
3940
|
if (!o) return;
|
|
3857
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3941
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
3858
3942
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3859
3943
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3860
3944
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3861
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3945
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
3862
3946
|
}
|
|
3863
3947
|
function _ts_generator$2(thisArg, body) {
|
|
3864
3948
|
var f, y, t, _ = {
|
|
@@ -4041,8 +4125,8 @@ function ModuleHeader(param) {
|
|
|
4041
4125
|
}, [
|
|
4042
4126
|
window
|
|
4043
4127
|
]);
|
|
4044
|
-
var _useState = _sliced_to_array$
|
|
4045
|
-
var _useState1 = _sliced_to_array$
|
|
4128
|
+
var _useState = _sliced_to_array$9(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
4129
|
+
var _useState1 = _sliced_to_array$9(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
4046
4130
|
var handleUndo = function() {
|
|
4047
4131
|
undo();
|
|
4048
4132
|
};
|
|
@@ -4280,7 +4364,7 @@ function ModuleHeader(param) {
|
|
|
4280
4364
|
}, "Advanced")))));
|
|
4281
4365
|
}
|
|
4282
4366
|
|
|
4283
|
-
var css_248z$1 = ".ModMatrix {\n color: var(--color-text);\n font-size: var(--text-ms);\n}\n\n.ModMatrixCell {\n background: #252429;\n position: relative;\n}\n\n.ModMatrixCell.isDisabled {\n /* background: var(--bg-muted);\n color: var(--color-gray-400); */\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.ModMatrixToggleCell {\n cursor: pointer;\n}\n\n.ModMatrixComboboxCell {\n background: #252429;\n cursor: pointer;\n}\n\n.ModMatrixComboboxItems {\n position: absolute;\n z-index: 50;\n bottom: -151px;\n left: 0px;\n height: 150px;\n width: 100%;\n background: var(--color-gray-500);\n color: var(--color-text);\n font-family: var(--font-leagueSpartan);\n overflow-y: auto;\n overflow-x: hidden;\n cursor: pointer;\n}\n\n.ModMatrixComboboxItem:hover,\n.ModMatrixComboboxItem:active,\n.ModMatrixComboboxItem[data-selected] {\n background: var(--color-gray-600);\n}\n\n.ModMatrixComboboxItem {\n padding: var(--spacing-md) var(--spacing-lg);\n width: 100%;\n}\n.ModMatrixComboboxButton {\n cursor: pointer;\n}\n";
|
|
4367
|
+
var css_248z$1 = ".ModMatrix {\n color: var(--color-text);\n font-size: var(--text-ms);\n}\n\n.ModMatrixCell {\n background: #252429;\n position: relative;\n}\n\n.ModMatrixCell.isDisabled {\n /* background: var(--bg-muted);\n color: var(--color-gray-400); */\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n/* .isActive .ModMatrixCell {\n background: var(--color-gray-600);\n} */\n\n.ModMatrixToggleCell {\n cursor: pointer;\n}\n\n.ModMatrixComboboxCell {\n background: #252429;\n cursor: pointer;\n}\n\n.ModMatrixComboboxItems {\n position: absolute;\n z-index: 50;\n bottom: -151px;\n left: 0px;\n height: 150px;\n width: 100%;\n background: var(--color-gray-500);\n color: var(--color-text);\n font-family: var(--font-leagueSpartan);\n overflow-y: auto;\n overflow-x: hidden;\n cursor: pointer;\n}\n\n.ModMatrixComboboxItem:hover,\n.ModMatrixComboboxItem:active,\n.ModMatrixComboboxItem[data-selected] {\n background: var(--color-gray-600);\n}\n\n.ModMatrixComboboxItem {\n padding: var(--spacing-md) var(--spacing-lg);\n width: 100%;\n}\n.ModMatrixComboboxButton {\n cursor: pointer;\n}\n\n.ModMatrixInput {\n text-align: center;\n height: 0.8rem;\n}\n";
|
|
4284
4368
|
styleInject(css_248z$1);
|
|
4285
4369
|
|
|
4286
4370
|
var targetColors = [
|
|
@@ -4296,15 +4380,15 @@ var targetColors = [
|
|
|
4296
4380
|
var ComboboxCellWidth = '217px';
|
|
4297
4381
|
var DeleteButtonCellWidth = '50px';
|
|
4298
4382
|
|
|
4299
|
-
function _array_like_to_array$
|
|
4383
|
+
function _array_like_to_array$8(arr, len) {
|
|
4300
4384
|
if (len == null || len > arr.length) len = arr.length;
|
|
4301
4385
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4302
4386
|
return arr2;
|
|
4303
4387
|
}
|
|
4304
|
-
function _array_with_holes$
|
|
4388
|
+
function _array_with_holes$8(arr) {
|
|
4305
4389
|
if (Array.isArray(arr)) return arr;
|
|
4306
4390
|
}
|
|
4307
|
-
function _iterable_to_array_limit$
|
|
4391
|
+
function _iterable_to_array_limit$8(arr, i) {
|
|
4308
4392
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4309
4393
|
if (_i == null) return;
|
|
4310
4394
|
var _arr = [];
|
|
@@ -4328,26 +4412,26 @@ function _iterable_to_array_limit$7(arr, i) {
|
|
|
4328
4412
|
}
|
|
4329
4413
|
return _arr;
|
|
4330
4414
|
}
|
|
4331
|
-
function _non_iterable_rest$
|
|
4415
|
+
function _non_iterable_rest$8() {
|
|
4332
4416
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4333
4417
|
}
|
|
4334
|
-
function _sliced_to_array$
|
|
4335
|
-
return _array_with_holes$
|
|
4418
|
+
function _sliced_to_array$8(arr, i) {
|
|
4419
|
+
return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$8();
|
|
4336
4420
|
}
|
|
4337
|
-
function _unsupported_iterable_to_array$
|
|
4421
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
4338
4422
|
if (!o) return;
|
|
4339
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4423
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
4340
4424
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4341
4425
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4342
4426
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4343
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
4427
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
4344
4428
|
}
|
|
4345
4429
|
var useCombobox = function(param) {
|
|
4346
4430
|
var id = param.id, filter = param.filter;
|
|
4347
4431
|
var _Object_values;
|
|
4348
4432
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
4349
|
-
var _useState = _sliced_to_array$
|
|
4350
|
-
var _useState1 = _sliced_to_array$
|
|
4433
|
+
var _useState = _sliced_to_array$8(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
4434
|
+
var _useState1 = _sliced_to_array$8(useState(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
4351
4435
|
var prevValue = useRef(null);
|
|
4352
4436
|
var _useGlobalContext = useGlobalContext(); _useGlobalContext.highlightedItemChanged; var setModSlotRowTargetAsPreview = _useGlobalContext.setModSlotRowTargetAsPreview, _useGlobalContext_globalState = _useGlobalContext.globalState, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels, modSlotTargets = _useGlobalContext_globalState.modSlotTargets, modSlotPreview = _useGlobalContext_globalState.modSlotPreview;
|
|
4353
4437
|
//TODO: Filter choices for subsequent rows
|
|
@@ -4435,12 +4519,12 @@ var useCombobox = function(param) {
|
|
|
4435
4519
|
};
|
|
4436
4520
|
};
|
|
4437
4521
|
|
|
4438
|
-
function _array_like_to_array$
|
|
4522
|
+
function _array_like_to_array$7(arr, len) {
|
|
4439
4523
|
if (len == null || len > arr.length) len = arr.length;
|
|
4440
4524
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4441
4525
|
return arr2;
|
|
4442
4526
|
}
|
|
4443
|
-
function _array_with_holes$
|
|
4527
|
+
function _array_with_holes$7(arr) {
|
|
4444
4528
|
if (Array.isArray(arr)) return arr;
|
|
4445
4529
|
}
|
|
4446
4530
|
function _define_property$5(obj, key, value) {
|
|
@@ -4456,7 +4540,7 @@ function _define_property$5(obj, key, value) {
|
|
|
4456
4540
|
}
|
|
4457
4541
|
return obj;
|
|
4458
4542
|
}
|
|
4459
|
-
function _iterable_to_array_limit$
|
|
4543
|
+
function _iterable_to_array_limit$7(arr, i) {
|
|
4460
4544
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4461
4545
|
if (_i == null) return;
|
|
4462
4546
|
var _arr = [];
|
|
@@ -4480,7 +4564,7 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
4480
4564
|
}
|
|
4481
4565
|
return _arr;
|
|
4482
4566
|
}
|
|
4483
|
-
function _non_iterable_rest$
|
|
4567
|
+
function _non_iterable_rest$7() {
|
|
4484
4568
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4485
4569
|
}
|
|
4486
4570
|
function _object_spread$5(target) {
|
|
@@ -4498,20 +4582,20 @@ function _object_spread$5(target) {
|
|
|
4498
4582
|
}
|
|
4499
4583
|
return target;
|
|
4500
4584
|
}
|
|
4501
|
-
function _sliced_to_array$
|
|
4502
|
-
return _array_with_holes$
|
|
4585
|
+
function _sliced_to_array$7(arr, i) {
|
|
4586
|
+
return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$7();
|
|
4503
4587
|
}
|
|
4504
|
-
function _unsupported_iterable_to_array$
|
|
4588
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
4505
4589
|
if (!o) return;
|
|
4506
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
4590
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
4507
4591
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4508
4592
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4509
4593
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4510
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
4594
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
4511
4595
|
}
|
|
4512
4596
|
function ModMatrixComboboxCell(param) {
|
|
4513
4597
|
var rowId = param.rowId, key = param.key, color = param.color, style = param.style;
|
|
4514
|
-
var _useState = _sliced_to_array$
|
|
4598
|
+
var _useState = _sliced_to_array$7(useState(''), 2), filterString = _useState[0], setFilterString = _useState[1];
|
|
4515
4599
|
var _useGlobalContext = useGlobalContext(), updateModSlotRowTarget = _useGlobalContext.updateModSlotRowTarget, setModSlotRowTargetAsPreview = _useGlobalContext.setModSlotRowTargetAsPreview, clearModSlotPreview = _useGlobalContext.clearModSlotPreview, setNewModSlotPreview = _useGlobalContext.setNewModSlotPreview, _useGlobalContext_globalState = _useGlobalContext.globalState, modSlotPreview = _useGlobalContext_globalState.modSlotPreview, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels;
|
|
4516
4600
|
var _useCombobox = useCombobox({
|
|
4517
4601
|
id: rowId,
|
|
@@ -4686,19 +4770,20 @@ function _object_spread$3(target) {
|
|
|
4686
4770
|
return target;
|
|
4687
4771
|
}
|
|
4688
4772
|
function SingleBarViz(param) {
|
|
4689
|
-
var
|
|
4773
|
+
var _param_backgroundColor = param.backgroundColor, backgroundColor = _param_backgroundColor === void 0 ? 'var(--color-gray-600)' : _param_backgroundColor, _param_sliderColor = param.sliderColor, sliderColor = _param_sliderColor === void 0 ? 'var(--color-brand)' : _param_sliderColor, _param_height = param.height, height = _param_height === void 0 ? '6px' : _param_height, _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? Polarity.unipolar : _param_polarity, _param_orientation = param.orientation, orientation = _param_orientation === void 0 ? Orientation.horizontal : _param_orientation, value = param.value, className = param.className, style = param.style;
|
|
4690
4774
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
4691
4775
|
className: className,
|
|
4692
4776
|
style: {
|
|
4693
4777
|
width: '100%',
|
|
4694
4778
|
height: height,
|
|
4695
|
-
|
|
4696
|
-
|
|
4779
|
+
position: 'relative',
|
|
4780
|
+
background: backgroundColor
|
|
4697
4781
|
}
|
|
4698
4782
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
4783
|
+
className: "SingleBarViz",
|
|
4699
4784
|
style: _object_spread$3({
|
|
4700
4785
|
position: 'absolute',
|
|
4701
|
-
background:
|
|
4786
|
+
background: sliderColor
|
|
4702
4787
|
}, getBarTransformStyles({
|
|
4703
4788
|
polarity: polarity,
|
|
4704
4789
|
orientation: orientation,
|
|
@@ -4708,6 +4793,14 @@ function SingleBarViz(param) {
|
|
|
4708
4793
|
}
|
|
4709
4794
|
SingleBarViz.polarity = Polarity;
|
|
4710
4795
|
|
|
4796
|
+
function _array_like_to_array$6(arr, len) {
|
|
4797
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4798
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4799
|
+
return arr2;
|
|
4800
|
+
}
|
|
4801
|
+
function _array_with_holes$6(arr) {
|
|
4802
|
+
if (Array.isArray(arr)) return arr;
|
|
4803
|
+
}
|
|
4711
4804
|
function _define_property$2(obj, key, value) {
|
|
4712
4805
|
if (key in obj) {
|
|
4713
4806
|
Object.defineProperty(obj, key, {
|
|
@@ -4721,6 +4814,33 @@ function _define_property$2(obj, key, value) {
|
|
|
4721
4814
|
}
|
|
4722
4815
|
return obj;
|
|
4723
4816
|
}
|
|
4817
|
+
function _iterable_to_array_limit$6(arr, i) {
|
|
4818
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4819
|
+
if (_i == null) return;
|
|
4820
|
+
var _arr = [];
|
|
4821
|
+
var _n = true;
|
|
4822
|
+
var _d = false;
|
|
4823
|
+
var _s, _e;
|
|
4824
|
+
try {
|
|
4825
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
4826
|
+
_arr.push(_s.value);
|
|
4827
|
+
if (i && _arr.length === i) break;
|
|
4828
|
+
}
|
|
4829
|
+
} catch (err) {
|
|
4830
|
+
_d = true;
|
|
4831
|
+
_e = err;
|
|
4832
|
+
} finally{
|
|
4833
|
+
try {
|
|
4834
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
4835
|
+
} finally{
|
|
4836
|
+
if (_d) throw _e;
|
|
4837
|
+
}
|
|
4838
|
+
}
|
|
4839
|
+
return _arr;
|
|
4840
|
+
}
|
|
4841
|
+
function _non_iterable_rest$6() {
|
|
4842
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4843
|
+
}
|
|
4724
4844
|
function _object_spread$2(target) {
|
|
4725
4845
|
for(var i = 1; i < arguments.length; i++){
|
|
4726
4846
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -4755,10 +4875,22 @@ function _object_spread_props(target, source) {
|
|
|
4755
4875
|
}
|
|
4756
4876
|
return target;
|
|
4757
4877
|
}
|
|
4878
|
+
function _sliced_to_array$6(arr, i) {
|
|
4879
|
+
return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$6();
|
|
4880
|
+
}
|
|
4881
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
4882
|
+
if (!o) return;
|
|
4883
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
4884
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4885
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4886
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4887
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
4888
|
+
}
|
|
4758
4889
|
function ModMatrixCell(param) {
|
|
4759
4890
|
var modifier = param.modifier, rowId = param.rowId, isDisabled = param.isDisabled, color = param.color, style = param.style;
|
|
4760
4891
|
var _SingleBarViz_polarity;
|
|
4761
4892
|
var _useGlobalContext = useGlobalContext(), setDefaultParameter = _useGlobalContext.setDefaultParameter, saveModSlotPreviewRowTargetToBackend = _useGlobalContext.saveModSlotPreviewRowTargetToBackend;
|
|
4893
|
+
var _useState = _sliced_to_array$6(useState(false), 2); _useState[0]; var setIsActive = _useState[1];
|
|
4762
4894
|
var _useSlider = useSlider({
|
|
4763
4895
|
id: modifier,
|
|
4764
4896
|
rowId: rowId,
|
|
@@ -4767,8 +4899,15 @@ function ModMatrixCell(param) {
|
|
|
4767
4899
|
dragOrientation: Orientation.vertical,
|
|
4768
4900
|
onChange: saveModSlotPreviewRowTargetToBackend,
|
|
4769
4901
|
isDisabled: isDisabled
|
|
4770
|
-
}), bindBarSliderDrag = _useSlider.bindBarSliderDrag, normalisedValue = _useSlider.normalisedValue, scaledValue = _useSlider.scaledValue;
|
|
4771
|
-
return /*#__PURE__*/ React__default.createElement(
|
|
4902
|
+
}), bindBarSliderDrag = _useSlider.bindBarSliderDrag, normalisedValue = _useSlider.normalisedValue, scaledValue = _useSlider.scaledValue, properties = _useSlider.properties, setNormalisedState = _useSlider.setNormalisedState;
|
|
4903
|
+
return /*#__PURE__*/ React__default.createElement(ControlGroup, {
|
|
4904
|
+
id: modifier,
|
|
4905
|
+
className: "ModMatrixCell-Wrapper",
|
|
4906
|
+
isDisabled: isDisabled,
|
|
4907
|
+
onChangeActiveState: function(isActive) {
|
|
4908
|
+
return setIsActive(isActive);
|
|
4909
|
+
}
|
|
4910
|
+
}, /*#__PURE__*/ React__default.createElement(Box, _object_spread_props(_object_spread$2({
|
|
4772
4911
|
className: "ModMatrixCell ".concat(isDisabled ? 'isDisabled' : ''),
|
|
4773
4912
|
justifyContent: Box.justifyContent.flexEnd,
|
|
4774
4913
|
alignItems: Box.alignItems.flexStart,
|
|
@@ -4787,7 +4926,29 @@ function ModMatrixCell(param) {
|
|
|
4787
4926
|
style: {
|
|
4788
4927
|
pointerEvents: 'none'
|
|
4789
4928
|
}
|
|
4790
|
-
}, /*#__PURE__*/ React__default.createElement(
|
|
4929
|
+
}, /*#__PURE__*/ React__default.createElement(Input, {
|
|
4930
|
+
className: "ModMatrixInput",
|
|
4931
|
+
value: scaledValue,
|
|
4932
|
+
id: modifier,
|
|
4933
|
+
min: (properties === null || properties === void 0 ? void 0 : properties.start) || 0,
|
|
4934
|
+
max: (properties === null || properties === void 0 ? void 0 : properties.end) || 0,
|
|
4935
|
+
type: Input.type.number,
|
|
4936
|
+
style: {
|
|
4937
|
+
fontWeight: 'bold',
|
|
4938
|
+
width: '100%',
|
|
4939
|
+
// maxWidth: `${width}px`,
|
|
4940
|
+
marginBottom: 'var(--spacing-sm)'
|
|
4941
|
+
},
|
|
4942
|
+
onComplete: function(value) {
|
|
4943
|
+
var normalisedVal = properties && scaledToNormalised({
|
|
4944
|
+
scaledValue: value,
|
|
4945
|
+
start: properties === null || properties === void 0 ? void 0 : properties.start,
|
|
4946
|
+
end: properties === null || properties === void 0 ? void 0 : properties.end,
|
|
4947
|
+
skew: properties === null || properties === void 0 ? void 0 : properties.skew
|
|
4948
|
+
});
|
|
4949
|
+
normalisedVal !== undefined && setNormalisedState(normalisedVal);
|
|
4950
|
+
}
|
|
4951
|
+
})), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4791
4952
|
style: {
|
|
4792
4953
|
alignSelf: 'flex-end',
|
|
4793
4954
|
pointerEvents: 'none'
|
|
@@ -4795,7 +4956,10 @@ function ModMatrixCell(param) {
|
|
|
4795
4956
|
}, /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
4796
4957
|
value: (modifier === null || modifier === void 0 ? void 0 : modifier.value) || 0,
|
|
4797
4958
|
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.bipolar,
|
|
4798
|
-
|
|
4959
|
+
// backgroundColor={
|
|
4960
|
+
// isActive ? 'var(--color-gray-500)' : 'var(--color-gray-600)'
|
|
4961
|
+
// }
|
|
4962
|
+
sliderColor: color,
|
|
4799
4963
|
style: _object_spread$2({
|
|
4800
4964
|
alignSelf: 'flex-end',
|
|
4801
4965
|
pointerEvents: 'none'
|
|
@@ -4804,7 +4968,7 @@ function ModMatrixCell(param) {
|
|
|
4804
4968
|
polarity: Polarity === null || Polarity === void 0 ? void 0 : Polarity.bipolar,
|
|
4805
4969
|
normalisedValue: normalisedValue
|
|
4806
4970
|
}))
|
|
4807
|
-
})));
|
|
4971
|
+
}))));
|
|
4808
4972
|
}
|
|
4809
4973
|
|
|
4810
4974
|
function ModMatrixRow(param) {
|