@antimatter-audio/antimatter-ui 9.4.0 → 9.6.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 +331 -132
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -87,15 +87,15 @@ var FontSizes = /*#__PURE__*/ function(FontSizes) {
|
|
|
87
87
|
var css_248z$7 = ".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 font-size: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 1px;\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: 0;\n appearance: none;\n &:hover,\n &:focus-visible {\n outline: none;\n }\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";
|
|
88
88
|
styleInject(css_248z$7);
|
|
89
89
|
|
|
90
|
-
function _array_like_to_array$
|
|
90
|
+
function _array_like_to_array$7(arr, len) {
|
|
91
91
|
if (len == null || len > arr.length) len = arr.length;
|
|
92
92
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
93
93
|
return arr2;
|
|
94
94
|
}
|
|
95
|
-
function _array_with_holes$
|
|
95
|
+
function _array_with_holes$7(arr) {
|
|
96
96
|
if (Array.isArray(arr)) return arr;
|
|
97
97
|
}
|
|
98
|
-
function _iterable_to_array_limit$
|
|
98
|
+
function _iterable_to_array_limit$7(arr, i) {
|
|
99
99
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
100
100
|
if (_i == null) return;
|
|
101
101
|
var _arr = [];
|
|
@@ -119,19 +119,19 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
119
119
|
}
|
|
120
120
|
return _arr;
|
|
121
121
|
}
|
|
122
|
-
function _non_iterable_rest$
|
|
122
|
+
function _non_iterable_rest$7() {
|
|
123
123
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
124
124
|
}
|
|
125
|
-
function _sliced_to_array$
|
|
126
|
-
return _array_with_holes$
|
|
125
|
+
function _sliced_to_array$7(arr, i) {
|
|
126
|
+
return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$7();
|
|
127
127
|
}
|
|
128
|
-
function _unsupported_iterable_to_array$
|
|
128
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
129
129
|
if (!o) return;
|
|
130
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
130
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
131
131
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
132
132
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
133
133
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
134
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
134
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
135
135
|
}
|
|
136
136
|
function Tabs(param) {
|
|
137
137
|
var items = param.items, className = param.className, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
@@ -139,7 +139,7 @@ function Tabs(param) {
|
|
|
139
139
|
] : _param_padding, _param_margin = param.margin, margin = _param_margin === void 0 ? [
|
|
140
140
|
Spacing.none
|
|
141
141
|
] : _param_margin, onChange = param.onChange;
|
|
142
|
-
var _useState = _sliced_to_array$
|
|
142
|
+
var _useState = _sliced_to_array$7(useState(0), 2), selectedItem = _useState[0], setSelectedItem = _useState[1];
|
|
143
143
|
var handleChange = function(index) {
|
|
144
144
|
setSelectedItem(index);
|
|
145
145
|
onChange(index);
|
|
@@ -196,15 +196,15 @@ var ButtonType = /*#__PURE__*/ function(ButtonType) {
|
|
|
196
196
|
return ButtonType;
|
|
197
197
|
}({});
|
|
198
198
|
|
|
199
|
-
function _array_like_to_array$
|
|
199
|
+
function _array_like_to_array$6(arr, len) {
|
|
200
200
|
if (len == null || len > arr.length) len = arr.length;
|
|
201
201
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
202
202
|
return arr2;
|
|
203
203
|
}
|
|
204
|
-
function _array_with_holes$
|
|
204
|
+
function _array_with_holes$6(arr) {
|
|
205
205
|
if (Array.isArray(arr)) return arr;
|
|
206
206
|
}
|
|
207
|
-
function _define_property$
|
|
207
|
+
function _define_property$c(obj, key, value) {
|
|
208
208
|
if (key in obj) {
|
|
209
209
|
Object.defineProperty(obj, key, {
|
|
210
210
|
value: value,
|
|
@@ -217,7 +217,7 @@ function _define_property$b(obj, key, value) {
|
|
|
217
217
|
}
|
|
218
218
|
return obj;
|
|
219
219
|
}
|
|
220
|
-
function _iterable_to_array_limit$
|
|
220
|
+
function _iterable_to_array_limit$6(arr, i) {
|
|
221
221
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
222
222
|
if (_i == null) return;
|
|
223
223
|
var _arr = [];
|
|
@@ -241,10 +241,10 @@ function _iterable_to_array_limit$5(arr, i) {
|
|
|
241
241
|
}
|
|
242
242
|
return _arr;
|
|
243
243
|
}
|
|
244
|
-
function _non_iterable_rest$
|
|
244
|
+
function _non_iterable_rest$6() {
|
|
245
245
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
246
246
|
}
|
|
247
|
-
function _object_spread$
|
|
247
|
+
function _object_spread$c(target) {
|
|
248
248
|
for(var i = 1; i < arguments.length; i++){
|
|
249
249
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
250
250
|
var ownKeys = Object.keys(source);
|
|
@@ -254,27 +254,27 @@ function _object_spread$b(target) {
|
|
|
254
254
|
}));
|
|
255
255
|
}
|
|
256
256
|
ownKeys.forEach(function(key) {
|
|
257
|
-
_define_property$
|
|
257
|
+
_define_property$c(target, key, source[key]);
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
return target;
|
|
261
261
|
}
|
|
262
|
-
function _sliced_to_array$
|
|
263
|
-
return _array_with_holes$
|
|
262
|
+
function _sliced_to_array$6(arr, i) {
|
|
263
|
+
return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$6();
|
|
264
264
|
}
|
|
265
|
-
function _unsupported_iterable_to_array$
|
|
265
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
266
266
|
if (!o) return;
|
|
267
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
267
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
268
268
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
269
269
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
270
270
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
271
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
271
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
272
272
|
}
|
|
273
273
|
function Button(param) {
|
|
274
274
|
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 ? [
|
|
275
275
|
Spacing.small
|
|
276
276
|
] : _param_padding, _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;
|
|
277
|
-
var _React_useState = _sliced_to_array$
|
|
277
|
+
var _React_useState = _sliced_to_array$6(React__default.useState(false), 2), isSelected = _React_useState[0], setIsSelected = _React_useState[1];
|
|
278
278
|
var buttonState = Juce.getToggleState(id);
|
|
279
279
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
280
280
|
// Update the local state when the ID changes
|
|
@@ -331,7 +331,7 @@ function Button(param) {
|
|
|
331
331
|
onMouseDown: handleMouseDown,
|
|
332
332
|
disabled: disabled,
|
|
333
333
|
onClick: onClick && onClick,
|
|
334
|
-
style: _object_spread$
|
|
334
|
+
style: _object_spread$c({
|
|
335
335
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
336
336
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
337
337
|
paddingBottom: "var(--p-".concat((_padding_1 = padding[2]) !== null && _padding_1 !== void 0 ? _padding_1 : padding[0], ")"),
|
|
@@ -347,15 +347,15 @@ Button.size = ButtonSize;
|
|
|
347
347
|
var css_248z$5 = ".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: 0;\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(--bg-input);\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-item {\n background-color: var(--bg-popover);\n padding: var(--spacing-l);\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n &:hover {\n background-color: var(--bg-highlighted);\n }\n &[data-selected] {\n background-color: var(--bg-selected);\n }\n}\n";
|
|
348
348
|
styleInject(css_248z$5);
|
|
349
349
|
|
|
350
|
-
function _array_like_to_array$
|
|
350
|
+
function _array_like_to_array$5(arr, len) {
|
|
351
351
|
if (len == null || len > arr.length) len = arr.length;
|
|
352
352
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
353
353
|
return arr2;
|
|
354
354
|
}
|
|
355
|
-
function _array_with_holes$
|
|
355
|
+
function _array_with_holes$5(arr) {
|
|
356
356
|
if (Array.isArray(arr)) return arr;
|
|
357
357
|
}
|
|
358
|
-
function _iterable_to_array_limit$
|
|
358
|
+
function _iterable_to_array_limit$5(arr, i) {
|
|
359
359
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
360
360
|
if (_i == null) return;
|
|
361
361
|
var _arr = [];
|
|
@@ -379,19 +379,19 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
379
379
|
}
|
|
380
380
|
return _arr;
|
|
381
381
|
}
|
|
382
|
-
function _non_iterable_rest$
|
|
382
|
+
function _non_iterable_rest$5() {
|
|
383
383
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
384
384
|
}
|
|
385
|
-
function _sliced_to_array$
|
|
386
|
-
return _array_with_holes$
|
|
385
|
+
function _sliced_to_array$5(arr, i) {
|
|
386
|
+
return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$5();
|
|
387
387
|
}
|
|
388
|
-
function _unsupported_iterable_to_array$
|
|
388
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
389
389
|
if (!o) return;
|
|
390
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
390
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
391
391
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
392
392
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
393
393
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
394
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
394
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
395
395
|
}
|
|
396
396
|
function Dropdown(param) {
|
|
397
397
|
var _param_items = param.items, items = _param_items === void 0 ? [
|
|
@@ -400,8 +400,8 @@ function Dropdown(param) {
|
|
|
400
400
|
'Mock Item 3'
|
|
401
401
|
] : _param_items, className = param.className, id = param.id, style = param.style;
|
|
402
402
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
403
|
-
var _useState = _sliced_to_array$
|
|
404
|
-
var _useState1 = _sliced_to_array$
|
|
403
|
+
var _useState = _sliced_to_array$5(useState(comboBoxState.getChoiceIndex()), 2), value = _useState[0], setValue = _useState[1];
|
|
404
|
+
var _useState1 = _sliced_to_array$5(useState(comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
405
405
|
var handleChange = function(event) {
|
|
406
406
|
comboBoxState.setChoiceIndex(event);
|
|
407
407
|
setValue(event);
|
|
@@ -476,19 +476,22 @@ var validate = function(param) {
|
|
|
476
476
|
isValid: !errorMessages.length && !isIncomplete
|
|
477
477
|
};
|
|
478
478
|
};
|
|
479
|
+
var randomizeValue = function(min, max) {
|
|
480
|
+
return Math.random() * (max - min) + min;
|
|
481
|
+
};
|
|
479
482
|
|
|
480
483
|
var css_248z$4 = ".TextInput {\n user-select: none;\n -webkit-user-select: none;\n}\n\n.TextInput::-moz-selection {\n background: transparent;\n}\n.TextInput::selection {\n background: transparent;\n}\n";
|
|
481
484
|
styleInject(css_248z$4);
|
|
482
485
|
|
|
483
|
-
function _array_like_to_array$
|
|
486
|
+
function _array_like_to_array$4(arr, len) {
|
|
484
487
|
if (len == null || len > arr.length) len = arr.length;
|
|
485
488
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
486
489
|
return arr2;
|
|
487
490
|
}
|
|
488
|
-
function _array_with_holes$
|
|
491
|
+
function _array_with_holes$4(arr) {
|
|
489
492
|
if (Array.isArray(arr)) return arr;
|
|
490
493
|
}
|
|
491
|
-
function _define_property$
|
|
494
|
+
function _define_property$b(obj, key, value) {
|
|
492
495
|
if (key in obj) {
|
|
493
496
|
Object.defineProperty(obj, key, {
|
|
494
497
|
value: value,
|
|
@@ -501,7 +504,7 @@ function _define_property$a(obj, key, value) {
|
|
|
501
504
|
}
|
|
502
505
|
return obj;
|
|
503
506
|
}
|
|
504
|
-
function _iterable_to_array_limit$
|
|
507
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
505
508
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
506
509
|
if (_i == null) return;
|
|
507
510
|
var _arr = [];
|
|
@@ -525,10 +528,10 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
525
528
|
}
|
|
526
529
|
return _arr;
|
|
527
530
|
}
|
|
528
|
-
function _non_iterable_rest$
|
|
531
|
+
function _non_iterable_rest$4() {
|
|
529
532
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
530
533
|
}
|
|
531
|
-
function _object_spread$
|
|
534
|
+
function _object_spread$b(target) {
|
|
532
535
|
for(var i = 1; i < arguments.length; i++){
|
|
533
536
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
534
537
|
var ownKeys = Object.keys(source);
|
|
@@ -538,21 +541,21 @@ function _object_spread$a(target) {
|
|
|
538
541
|
}));
|
|
539
542
|
}
|
|
540
543
|
ownKeys.forEach(function(key) {
|
|
541
|
-
_define_property$
|
|
544
|
+
_define_property$b(target, key, source[key]);
|
|
542
545
|
});
|
|
543
546
|
}
|
|
544
547
|
return target;
|
|
545
548
|
}
|
|
546
|
-
function _sliced_to_array$
|
|
547
|
-
return _array_with_holes$
|
|
549
|
+
function _sliced_to_array$4(arr, i) {
|
|
550
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
|
|
548
551
|
}
|
|
549
|
-
function _unsupported_iterable_to_array$
|
|
552
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
550
553
|
if (!o) return;
|
|
551
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
554
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
552
555
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
553
556
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
554
557
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
555
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
558
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
556
559
|
}
|
|
557
560
|
// import { decimalToPercent, percentToDecimal } from '../../common/utils';
|
|
558
561
|
// import debounce from 'lodash.debounce';
|
|
@@ -564,9 +567,9 @@ var InputTypes = /*#__PURE__*/ function(InputTypes) {
|
|
|
564
567
|
function Input(param) {
|
|
565
568
|
var onComplete = param.onComplete, value = param.value, min = param.min, max = param.max, _param_type = param.type, type = _param_type === void 0 ? "text" : _param_type, _param_minLength = param.minLength, minLength = _param_minLength === void 0 ? 1 : _param_minLength, _param_maxLength = param.maxLength, maxLength = _param_maxLength === void 0 ? 20 : _param_maxLength, fontSize = param.fontSize, style = param.style, className = param.className, id = param.id, _param_textColor = param.textColor, textColor = _param_textColor === void 0 ? '#999' : _param_textColor;
|
|
566
569
|
var _inputRef_current;
|
|
567
|
-
var _useState = _sliced_to_array$
|
|
568
|
-
var _useState1 = _sliced_to_array$
|
|
569
|
-
var _useState2 = _sliced_to_array$
|
|
570
|
+
var _useState = _sliced_to_array$4(useState(value), 2), internalValue = _useState[0], setInternalValue = _useState[1];
|
|
571
|
+
var _useState1 = _sliced_to_array$4(useState(false), 2), hasError = _useState1[0], setHasError = _useState1[1];
|
|
572
|
+
var _useState2 = _sliced_to_array$4(useState(false), 2), hasIncompleteValue = _useState2[0], setHasIncompleteValue = _useState2[1];
|
|
570
573
|
var valueRef = useRef(null);
|
|
571
574
|
var timer, timeoutVal = 2000;
|
|
572
575
|
// (inputValue === '' || /^-?\d+$/.test(inputValue)
|
|
@@ -672,7 +675,7 @@ function Input(param) {
|
|
|
672
675
|
id: id,
|
|
673
676
|
ref: inputRef,
|
|
674
677
|
className: classnames('TextInput', hasIncompleteValue || hasError ? 'is-blinking' : '', className),
|
|
675
|
-
style: _object_spread$
|
|
678
|
+
style: _object_spread$b({
|
|
676
679
|
// TODO
|
|
677
680
|
// color: hasError ? 'red' : hasIncompleteValue ? '#999' : textColor
|
|
678
681
|
color: hasError ? 'red' : textColor,
|
|
@@ -802,15 +805,15 @@ var getPosition = function(param) {
|
|
|
802
805
|
}
|
|
803
806
|
};
|
|
804
807
|
|
|
805
|
-
function _array_like_to_array$
|
|
808
|
+
function _array_like_to_array$3(arr, len) {
|
|
806
809
|
if (len == null || len > arr.length) len = arr.length;
|
|
807
810
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
808
811
|
return arr2;
|
|
809
812
|
}
|
|
810
|
-
function _array_with_holes$
|
|
813
|
+
function _array_with_holes$3(arr) {
|
|
811
814
|
if (Array.isArray(arr)) return arr;
|
|
812
815
|
}
|
|
813
|
-
function _iterable_to_array_limit$
|
|
816
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
814
817
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
815
818
|
if (_i == null) return;
|
|
816
819
|
var _arr = [];
|
|
@@ -834,19 +837,19 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
834
837
|
}
|
|
835
838
|
return _arr;
|
|
836
839
|
}
|
|
837
|
-
function _non_iterable_rest$
|
|
840
|
+
function _non_iterable_rest$3() {
|
|
838
841
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
839
842
|
}
|
|
840
|
-
function _sliced_to_array$
|
|
841
|
-
return _array_with_holes$
|
|
843
|
+
function _sliced_to_array$3(arr, i) {
|
|
844
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
842
845
|
}
|
|
843
|
-
function _unsupported_iterable_to_array$
|
|
846
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
844
847
|
if (!o) return;
|
|
845
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
848
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
846
849
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
847
850
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
848
851
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
849
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
852
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
850
853
|
}
|
|
851
854
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
852
855
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
@@ -856,7 +859,7 @@ var useSlider = function(param) {
|
|
|
856
859
|
end: 15000,
|
|
857
860
|
interval: 0.1,
|
|
858
861
|
skew: 0.7
|
|
859
|
-
} : _param_mockProperties, _param_mockInitialNormalisedValue = param.mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0.0 : _param_mockInitialNormalisedValue, _param_sliderOrientation = param.sliderOrientation; _param_sliderOrientation === void 0 ? SliderOrientation.vertical : _param_sliderOrientation; var onChange = param.onChange;
|
|
862
|
+
} : _param_mockProperties, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, _param_mockInitialNormalisedValue = param.mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0.0 : _param_mockInitialNormalisedValue, _param_sliderOrientation = param.sliderOrientation; _param_sliderOrientation === void 0 ? SliderOrientation.vertical : _param_sliderOrientation; var onChange = param.onChange;
|
|
860
863
|
// const sliderState: JuceSlider = Juce.getSliderState(id);
|
|
861
864
|
// if isLocalhost is true, the front end app is running outside of JUCE in a browser.
|
|
862
865
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
@@ -869,11 +872,12 @@ var useSlider = function(param) {
|
|
|
869
872
|
* AudioProcessorParameter::getValue() (C++).
|
|
870
873
|
*/ // See https://github.com/juce-framework/JUCE/blob/51d11a2be6d5c97ccf12b4e5e827006e19f0555a/modules/juce_gui_extra/native/javascript/index.js#L230C1-L238C6
|
|
871
874
|
// NOTE: We can think of this as a percentage value, in 0 to 1 format
|
|
872
|
-
var _useState = _sliced_to_array$
|
|
873
|
-
var _useState1 = _sliced_to_array$
|
|
874
|
-
var _useState2 = _sliced_to_array$
|
|
875
|
+
var _useState = _sliced_to_array$3(useState(0), 2), scaledValue = _useState[0], setScaledValue = _useState[1];
|
|
876
|
+
var _useState1 = _sliced_to_array$3(useState(0), 2), normalisedValue = _useState1[0], setNormalisedValue = _useState1[1];
|
|
877
|
+
var _useState2 = _sliced_to_array$3(useState(), 2), properties = _useState2[0], setProperties = _useState2[1];
|
|
875
878
|
var scaledValueRef = useRef(null);
|
|
876
879
|
var normalisedValueRef = useRef(null);
|
|
880
|
+
var randomValueSetCounter = useRef(null);
|
|
877
881
|
// Set the initial state
|
|
878
882
|
useEffect(function() {
|
|
879
883
|
var sliderState = Juce.getSliderState(id);
|
|
@@ -903,14 +907,35 @@ var useSlider = function(param) {
|
|
|
903
907
|
var propertiesListenerId = sliderState === null || sliderState === void 0 ? void 0 : sliderState.propertiesChangedEvent.addListener(function() {
|
|
904
908
|
return setProperties(sliderState === null || sliderState === void 0 ? void 0 : sliderState.properties);
|
|
905
909
|
});
|
|
910
|
+
//@ts-expect-error
|
|
911
|
+
var randomizeListenerId = window.__JUCE__.backend.addEventListener('triggerRandom', function(event) {
|
|
912
|
+
var lastCharInIdAsNumber = parseInt(id.slice(-1), 10);
|
|
913
|
+
var selectedBand = event[1] + 1;
|
|
914
|
+
var idIsNotBandProperty = isNaN(lastCharInIdAsNumber);
|
|
915
|
+
var idBelongsToSelectedBand = isNaN(lastCharInIdAsNumber) === false && lastCharInIdAsNumber === selectedBand;
|
|
916
|
+
if (isRandomizable && event[0] !== randomValueSetCounter.current && (idIsNotBandProperty ? true : idBelongsToSelectedBand)) {
|
|
917
|
+
var _sliderState_properties, _sliderState_properties1, _sliderState_properties2, _sliderState_properties3;
|
|
918
|
+
var randomValue = randomizeValue(sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties = sliderState.properties) === null || _sliderState_properties === void 0 ? void 0 : _sliderState_properties.start, sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties1 = sliderState.properties) === null || _sliderState_properties1 === void 0 ? void 0 : _sliderState_properties1.end);
|
|
919
|
+
var newValue = (sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties2 = sliderState.properties) === null || _sliderState_properties2 === void 0 ? void 0 : _sliderState_properties2.start) === 0 && (sliderState === null || sliderState === void 0 ? void 0 : (_sliderState_properties3 = sliderState.properties) === null || _sliderState_properties3 === void 0 ? void 0 : _sliderState_properties3.end) === 1 ? randomValue : scaledToNormalised({
|
|
920
|
+
scaledValue: randomValue,
|
|
921
|
+
properties: sliderState === null || sliderState === void 0 ? void 0 : sliderState.properties
|
|
922
|
+
});
|
|
923
|
+
setNormalisedState(newValue);
|
|
924
|
+
randomValueSetCounter.current = event;
|
|
925
|
+
}
|
|
926
|
+
});
|
|
906
927
|
return function cleanup() {
|
|
907
928
|
sliderState === null || sliderState === void 0 ? void 0 : sliderState.valueChangedEvent.removeListener(valueListenerId);
|
|
908
929
|
sliderState === null || sliderState === void 0 ? void 0 : sliderState.propertiesChangedEvent.removeListener(propertiesListenerId);
|
|
930
|
+
//@ts-expect-error
|
|
931
|
+
window.__JUCE__.backend.removeEventListener(randomizeListenerId, id);
|
|
909
932
|
};
|
|
910
933
|
} else {
|
|
911
934
|
return;
|
|
912
935
|
}
|
|
913
|
-
}
|
|
936
|
+
}, [
|
|
937
|
+
window
|
|
938
|
+
]);
|
|
914
939
|
// Update the local state from JUCE
|
|
915
940
|
var updateLocalState = function(sliderState) {
|
|
916
941
|
var normalisedValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
@@ -982,7 +1007,7 @@ var useSlider = function(param) {
|
|
|
982
1007
|
var css_248z$3 = ".RotarySlider {\n position: relative;\n height: 50px;\n width: 50px;\n border-radius: 50%;\n aspect-ratio: 1 / 1;\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 border-color: var(--bg-popover) transparent var(--bg-popover) transparent;\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 0 7px 10px 7px;\n transform: rotate(180deg);\n padding-bottom: var(--spacing-sm);\n}\n";
|
|
983
1008
|
styleInject(css_248z$3);
|
|
984
1009
|
|
|
985
|
-
function _define_property$
|
|
1010
|
+
function _define_property$a(obj, key, value) {
|
|
986
1011
|
if (key in obj) {
|
|
987
1012
|
Object.defineProperty(obj, key, {
|
|
988
1013
|
value: value,
|
|
@@ -995,7 +1020,7 @@ function _define_property$9(obj, key, value) {
|
|
|
995
1020
|
}
|
|
996
1021
|
return obj;
|
|
997
1022
|
}
|
|
998
|
-
function _object_spread$
|
|
1023
|
+
function _object_spread$a(target) {
|
|
999
1024
|
for(var i = 1; i < arguments.length; i++){
|
|
1000
1025
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1001
1026
|
var ownKeys = Object.keys(source);
|
|
@@ -1005,7 +1030,7 @@ function _object_spread$9(target) {
|
|
|
1005
1030
|
}));
|
|
1006
1031
|
}
|
|
1007
1032
|
ownKeys.forEach(function(key) {
|
|
1008
|
-
_define_property$
|
|
1033
|
+
_define_property$a(target, key, source[key]);
|
|
1009
1034
|
});
|
|
1010
1035
|
}
|
|
1011
1036
|
return target;
|
|
@@ -1031,7 +1056,7 @@ function _object_spread_props$1(target, source) {
|
|
|
1031
1056
|
}
|
|
1032
1057
|
function RotarySlider(param) {
|
|
1033
1058
|
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? SliderPolarity.linear : _param_polarity, className = param.className, id = param.id, onMouseEnter = param.onMouseEnter, onChange = param.onChange, _param_rotationBehavior = param.rotationBehavior, rotationBehavior = _param_rotationBehavior === void 0 ? SliderRotationBehavior.rotateIndicator : _param_rotationBehavior, _param_mockInitialNormalisedValue = param.// Mocks the initial scaled value of the slider for web veiws outside of JUCE
|
|
1034
|
-
mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0 : _param_mockInitialNormalisedValue, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1059
|
+
mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0 : _param_mockInitialNormalisedValue, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1035
1060
|
start: 20.0,
|
|
1036
1061
|
end: 15000.0,
|
|
1037
1062
|
interval: 0.1,
|
|
@@ -1041,7 +1066,8 @@ function RotarySlider(param) {
|
|
|
1041
1066
|
id: id,
|
|
1042
1067
|
mockProperties: mockProperties,
|
|
1043
1068
|
mockInitialNormalisedValue: mockInitialNormalisedValue,
|
|
1044
|
-
onChange: onChange
|
|
1069
|
+
onChange: onChange,
|
|
1070
|
+
isRandomizable: isRandomizable
|
|
1045
1071
|
}), bindDrag = _useSlider.bindDrag, normalisedValue = _useSlider.normalisedValue, scaledValue = _useSlider.scaledValue;
|
|
1046
1072
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
1047
1073
|
style: {
|
|
@@ -1052,18 +1078,18 @@ function RotarySlider(param) {
|
|
|
1052
1078
|
}
|
|
1053
1079
|
}, polarity === SliderPolarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1054
1080
|
className: classnames('RotarySlider-center-marker')
|
|
1055
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$
|
|
1081
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$a({
|
|
1056
1082
|
className: classnames('RotarySlider', polarity === SliderPolarity.linear ? 'Slider-polarity-linear' : 'Slider-polarity-bipolar', className)
|
|
1057
1083
|
}, bindDrag()), {
|
|
1058
1084
|
onMouseEnter: function() {
|
|
1059
1085
|
return onMouseEnter && onMouseEnter(id, scaledValue);
|
|
1060
1086
|
},
|
|
1061
|
-
style: _object_spread$
|
|
1087
|
+
style: _object_spread$a({
|
|
1062
1088
|
touchAction: 'none'
|
|
1063
1089
|
}, style)
|
|
1064
1090
|
}), normalisedValue !== null ? /*#__PURE__*/ React__default.createElement("div", {
|
|
1065
1091
|
className: classnames('RotarySlider-Inner'),
|
|
1066
|
-
style: _object_spread$
|
|
1092
|
+
style: _object_spread$a({
|
|
1067
1093
|
rotate: rotationBehavior === SliderRotationBehavior.rotateIndicator ? "".concat(polarity === SliderPolarity.linear ? normalisedValue : normalisedValue + 0.5, "turn") : ''
|
|
1068
1094
|
}, getTransformString({
|
|
1069
1095
|
sliderType: SliderType.rotary,
|
|
@@ -1076,14 +1102,14 @@ function RotarySlider(param) {
|
|
|
1076
1102
|
}))
|
|
1077
1103
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
1078
1104
|
className: classnames('RotarySlider-Indicator'),
|
|
1079
|
-
style: _object_spread$
|
|
1105
|
+
style: _object_spread$a({
|
|
1080
1106
|
backgroundColor: color
|
|
1081
1107
|
}, style)
|
|
1082
1108
|
})) : ''));
|
|
1083
1109
|
}
|
|
1084
1110
|
RotarySlider.sliderPolarity = SliderPolarity;
|
|
1085
1111
|
|
|
1086
|
-
function _define_property$
|
|
1112
|
+
function _define_property$9(obj, key, value) {
|
|
1087
1113
|
if (key in obj) {
|
|
1088
1114
|
Object.defineProperty(obj, key, {
|
|
1089
1115
|
value: value,
|
|
@@ -1096,7 +1122,7 @@ function _define_property$8(obj, key, value) {
|
|
|
1096
1122
|
}
|
|
1097
1123
|
return obj;
|
|
1098
1124
|
}
|
|
1099
|
-
function _object_spread$
|
|
1125
|
+
function _object_spread$9(target) {
|
|
1100
1126
|
for(var i = 1; i < arguments.length; i++){
|
|
1101
1127
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1102
1128
|
var ownKeys = Object.keys(source);
|
|
@@ -1106,7 +1132,7 @@ function _object_spread$8(target) {
|
|
|
1106
1132
|
}));
|
|
1107
1133
|
}
|
|
1108
1134
|
ownKeys.forEach(function(key) {
|
|
1109
|
-
_define_property$
|
|
1135
|
+
_define_property$9(target, key, source[key]);
|
|
1110
1136
|
});
|
|
1111
1137
|
}
|
|
1112
1138
|
return target;
|
|
@@ -1119,7 +1145,7 @@ function Label(param) {
|
|
|
1119
1145
|
return /*#__PURE__*/ React.createElement("label", {
|
|
1120
1146
|
id: id,
|
|
1121
1147
|
htmlFor: htmlFor,
|
|
1122
|
-
style: _object_spread$
|
|
1148
|
+
style: _object_spread$9({
|
|
1123
1149
|
fontSize: "var(--text-".concat(fontSize),
|
|
1124
1150
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1125
1151
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1160,7 +1186,7 @@ var LayoutTags = /*#__PURE__*/ function(LayoutTags) {
|
|
|
1160
1186
|
return LayoutTags;
|
|
1161
1187
|
}({});
|
|
1162
1188
|
|
|
1163
|
-
function _define_property$
|
|
1189
|
+
function _define_property$8(obj, key, value) {
|
|
1164
1190
|
if (key in obj) {
|
|
1165
1191
|
Object.defineProperty(obj, key, {
|
|
1166
1192
|
value: value,
|
|
@@ -1173,7 +1199,7 @@ function _define_property$7(obj, key, value) {
|
|
|
1173
1199
|
}
|
|
1174
1200
|
return obj;
|
|
1175
1201
|
}
|
|
1176
|
-
function _object_spread$
|
|
1202
|
+
function _object_spread$8(target) {
|
|
1177
1203
|
for(var i = 1; i < arguments.length; i++){
|
|
1178
1204
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1179
1205
|
var ownKeys = Object.keys(source);
|
|
@@ -1183,7 +1209,7 @@ function _object_spread$7(target) {
|
|
|
1183
1209
|
}));
|
|
1184
1210
|
}
|
|
1185
1211
|
ownKeys.forEach(function(key) {
|
|
1186
|
-
_define_property$
|
|
1212
|
+
_define_property$8(target, key, source[key]);
|
|
1187
1213
|
});
|
|
1188
1214
|
}
|
|
1189
1215
|
return target;
|
|
@@ -1194,7 +1220,7 @@ var BoxDisplay = /*#__PURE__*/ function(BoxDisplay) {
|
|
|
1194
1220
|
return BoxDisplay;
|
|
1195
1221
|
}(BoxDisplay || {});
|
|
1196
1222
|
function Box(param) {
|
|
1197
|
-
var className = param.className, style = param.style, children = param.children, flex = param.flex, _param_alignItems = param.alignItems, alignItems = _param_alignItems === void 0 ? AlignItems.center : _param_alignItems, _param_justifyContent = param.justifyContent, justifyContent = _param_justifyContent === void 0 ? JustifyContent.center : _param_justifyContent, _param_display = param.display, display = _param_display === void 0 ? "flex" : _param_display, _param_width = param.width, width = _param_width === void 0 ? Width.auto : _param_width, _param_flexWrap = param.flexWrap, flexWrap = _param_flexWrap === void 0 ? FlexWrap.noWrap : _param_flexWrap, _param_height = param.height, height = _param_height === void 0 ? Height.auto : _param_height, _param_border = param.border, border = _param_border === void 0 ? false : _param_border, _param_flexDirection = param.flexDirection, flexDirection = _param_flexDirection === void 0 ? FlexDirection.row : _param_flexDirection, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
1223
|
+
var className = param.className, style = param.style, children = param.children, flex = param.flex, key = param.key, _param_alignItems = param.alignItems, alignItems = _param_alignItems === void 0 ? AlignItems.center : _param_alignItems, _param_justifyContent = param.justifyContent, justifyContent = _param_justifyContent === void 0 ? JustifyContent.center : _param_justifyContent, _param_display = param.display, display = _param_display === void 0 ? "flex" : _param_display, _param_width = param.width, width = _param_width === void 0 ? Width.auto : _param_width, _param_flexWrap = param.flexWrap, flexWrap = _param_flexWrap === void 0 ? FlexWrap.noWrap : _param_flexWrap, _param_height = param.height, height = _param_height === void 0 ? Height.auto : _param_height, _param_border = param.border, border = _param_border === void 0 ? false : _param_border, _param_flexDirection = param.flexDirection, flexDirection = _param_flexDirection === void 0 ? FlexDirection.row : _param_flexDirection, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
1198
1224
|
Spacing.none,
|
|
1199
1225
|
Spacing.none,
|
|
1200
1226
|
Spacing.none,
|
|
@@ -1204,8 +1230,9 @@ function Box(param) {
|
|
|
1204
1230
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1205
1231
|
return /*#__PURE__*/ React__default.createElement(Tag, {
|
|
1206
1232
|
// id="globalValues"
|
|
1233
|
+
key: key,
|
|
1207
1234
|
className: className,
|
|
1208
|
-
style: _object_spread$
|
|
1235
|
+
style: _object_spread$8({
|
|
1209
1236
|
flexWrap: flexWrap,
|
|
1210
1237
|
display: display,
|
|
1211
1238
|
gap: "var(--gap-".concat(gap, ")"),
|
|
@@ -1236,7 +1263,7 @@ Box.padding = Spacing;
|
|
|
1236
1263
|
Box.flexWrap = FlexWrap;
|
|
1237
1264
|
Box.tag = LayoutTags;
|
|
1238
1265
|
|
|
1239
|
-
function _define_property$
|
|
1266
|
+
function _define_property$7(obj, key, value) {
|
|
1240
1267
|
if (key in obj) {
|
|
1241
1268
|
Object.defineProperty(obj, key, {
|
|
1242
1269
|
value: value,
|
|
@@ -1249,7 +1276,7 @@ function _define_property$6(obj, key, value) {
|
|
|
1249
1276
|
}
|
|
1250
1277
|
return obj;
|
|
1251
1278
|
}
|
|
1252
|
-
function _object_spread$
|
|
1279
|
+
function _object_spread$7(target) {
|
|
1253
1280
|
for(var i = 1; i < arguments.length; i++){
|
|
1254
1281
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1255
1282
|
var ownKeys = Object.keys(source);
|
|
@@ -1259,7 +1286,7 @@ function _object_spread$6(target) {
|
|
|
1259
1286
|
}));
|
|
1260
1287
|
}
|
|
1261
1288
|
ownKeys.forEach(function(key) {
|
|
1262
|
-
_define_property$
|
|
1289
|
+
_define_property$7(target, key, source[key]);
|
|
1263
1290
|
});
|
|
1264
1291
|
}
|
|
1265
1292
|
return target;
|
|
@@ -1284,7 +1311,7 @@ function _object_spread_props(target, source) {
|
|
|
1284
1311
|
return target;
|
|
1285
1312
|
}
|
|
1286
1313
|
function Slider(param) {
|
|
1287
|
-
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? SliderPolarity.linear : _param_polarity, _param_sliderOrientation = param.sliderOrientation, sliderOrientation = _param_sliderOrientation === void 0 ? SliderOrientation.vertical : _param_sliderOrientation, className = param.className, id = param.id, onMouseEnter = param.onMouseEnter, onChange = param.onChange, style = param.style, color = param.color, label = param.label, _param_mockInitialNormalisedValue = param.// Mocks the initial scaled value of the slider for web veiws outside of JUCE
|
|
1314
|
+
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? SliderPolarity.linear : _param_polarity, _param_sliderOrientation = param.sliderOrientation, sliderOrientation = _param_sliderOrientation === void 0 ? SliderOrientation.vertical : _param_sliderOrientation, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, className = param.className, id = param.id, onMouseEnter = param.onMouseEnter, onChange = param.onChange, style = param.style, color = param.color, label = param.label, _param_mockInitialNormalisedValue = param.// Mocks the initial scaled value of the slider for web veiws outside of JUCE
|
|
1288
1315
|
mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0 : _param_mockInitialNormalisedValue, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1289
1316
|
start: 20.0,
|
|
1290
1317
|
end: 15000.0,
|
|
@@ -1296,7 +1323,8 @@ function Slider(param) {
|
|
|
1296
1323
|
mockProperties: mockProperties,
|
|
1297
1324
|
mockInitialNormalisedValue: mockInitialNormalisedValue,
|
|
1298
1325
|
sliderOrientation: sliderOrientation,
|
|
1299
|
-
onChange: onChange
|
|
1326
|
+
onChange: onChange,
|
|
1327
|
+
isRandomizable: isRandomizable
|
|
1300
1328
|
}), bindBarSliderDrag = _useSlider.bindBarSliderDrag, normalisedValue = _useSlider.normalisedValue, scaledValue = _useSlider.scaledValue;
|
|
1301
1329
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1302
1330
|
flexDirection: Box.flexDirection.column,
|
|
@@ -1304,13 +1332,13 @@ function Slider(param) {
|
|
|
1304
1332
|
className: classnames(className)
|
|
1305
1333
|
}, polarity === SliderPolarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1306
1334
|
className: 'Slider-center-marker'
|
|
1307
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$
|
|
1335
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$7({
|
|
1308
1336
|
className: classnames('Slider-bar', 'relative')
|
|
1309
1337
|
}, bindBarSliderDrag()), {
|
|
1310
1338
|
onMouseEnter: function() {
|
|
1311
1339
|
return onMouseEnter && label && onMouseEnter(label, scaledValue);
|
|
1312
1340
|
},
|
|
1313
|
-
style: _object_spread$
|
|
1341
|
+
style: _object_spread$7({
|
|
1314
1342
|
touchAction: 'none',
|
|
1315
1343
|
backgroundColor: 'var(--bg-input)',
|
|
1316
1344
|
minWidth: sliderOrientation === SliderOrientation.horizontal ? '100px' : '20px',
|
|
@@ -1319,7 +1347,7 @@ function Slider(param) {
|
|
|
1319
1347
|
}), normalisedValue ? /*#__PURE__*/ React__default.createElement("div", {
|
|
1320
1348
|
// TODO: Why aren't the Tailwind classes working?
|
|
1321
1349
|
// className={classnames('h-full', 'w-full', 'absolute', 'bg-input')}
|
|
1322
|
-
style: _object_spread$
|
|
1350
|
+
style: _object_spread$7(_object_spread_props(_object_spread$7({
|
|
1323
1351
|
height: '100%',
|
|
1324
1352
|
width: '100%',
|
|
1325
1353
|
position: 'absolute',
|
|
@@ -1375,7 +1403,7 @@ var HeadingTags = /*#__PURE__*/ function(HeadingTags) {
|
|
|
1375
1403
|
return HeadingTags;
|
|
1376
1404
|
}({});
|
|
1377
1405
|
|
|
1378
|
-
function _define_property$
|
|
1406
|
+
function _define_property$6(obj, key, value) {
|
|
1379
1407
|
if (key in obj) {
|
|
1380
1408
|
Object.defineProperty(obj, key, {
|
|
1381
1409
|
value: value,
|
|
@@ -1388,7 +1416,7 @@ function _define_property$5(obj, key, value) {
|
|
|
1388
1416
|
}
|
|
1389
1417
|
return obj;
|
|
1390
1418
|
}
|
|
1391
|
-
function _object_spread$
|
|
1419
|
+
function _object_spread$6(target) {
|
|
1392
1420
|
for(var i = 1; i < arguments.length; i++){
|
|
1393
1421
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1394
1422
|
var ownKeys = Object.keys(source);
|
|
@@ -1398,7 +1426,7 @@ function _object_spread$5(target) {
|
|
|
1398
1426
|
}));
|
|
1399
1427
|
}
|
|
1400
1428
|
ownKeys.forEach(function(key) {
|
|
1401
|
-
_define_property$
|
|
1429
|
+
_define_property$6(target, key, source[key]);
|
|
1402
1430
|
});
|
|
1403
1431
|
}
|
|
1404
1432
|
return target;
|
|
@@ -1411,7 +1439,7 @@ function Heading(param) {
|
|
|
1411
1439
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1412
1440
|
return /*#__PURE__*/ React.createElement(Tag, {
|
|
1413
1441
|
id: id,
|
|
1414
|
-
style: _object_spread$
|
|
1442
|
+
style: _object_spread$6({
|
|
1415
1443
|
fontSize: "var(--text-".concat(fontSize),
|
|
1416
1444
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1417
1445
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1463,15 +1491,15 @@ var Matrix = function(param) {
|
|
|
1463
1491
|
}));
|
|
1464
1492
|
};
|
|
1465
1493
|
|
|
1466
|
-
function _array_like_to_array$
|
|
1494
|
+
function _array_like_to_array$2(arr, len) {
|
|
1467
1495
|
if (len == null || len > arr.length) len = arr.length;
|
|
1468
1496
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1469
1497
|
return arr2;
|
|
1470
1498
|
}
|
|
1471
|
-
function _array_with_holes$
|
|
1499
|
+
function _array_with_holes$2(arr) {
|
|
1472
1500
|
if (Array.isArray(arr)) return arr;
|
|
1473
1501
|
}
|
|
1474
|
-
function _iterable_to_array_limit$
|
|
1502
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
1475
1503
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1476
1504
|
if (_i == null) return;
|
|
1477
1505
|
var _arr = [];
|
|
@@ -1495,26 +1523,26 @@ function _iterable_to_array_limit$1(arr, i) {
|
|
|
1495
1523
|
}
|
|
1496
1524
|
return _arr;
|
|
1497
1525
|
}
|
|
1498
|
-
function _non_iterable_rest$
|
|
1526
|
+
function _non_iterable_rest$2() {
|
|
1499
1527
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1500
1528
|
}
|
|
1501
|
-
function _sliced_to_array$
|
|
1502
|
-
return _array_with_holes$
|
|
1529
|
+
function _sliced_to_array$2(arr, i) {
|
|
1530
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
1503
1531
|
}
|
|
1504
|
-
function _unsupported_iterable_to_array$
|
|
1532
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
1505
1533
|
if (!o) return;
|
|
1506
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1534
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
1507
1535
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1508
1536
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1509
1537
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1510
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1538
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
1511
1539
|
}
|
|
1512
1540
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
1513
1541
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
1514
1542
|
var useIndicator = function(param) {
|
|
1515
1543
|
var id = param.id;
|
|
1516
1544
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
1517
|
-
var _useState = _sliced_to_array$
|
|
1545
|
+
var _useState = _sliced_to_array$2(useState(0), 2), isActive = _useState[0], setIsActive = _useState[1];
|
|
1518
1546
|
// Set the initial state
|
|
1519
1547
|
useEffect(function() {
|
|
1520
1548
|
if (!isLocalhost) {
|
|
@@ -1548,7 +1576,7 @@ var useIndicator = function(param) {
|
|
|
1548
1576
|
};
|
|
1549
1577
|
};
|
|
1550
1578
|
|
|
1551
|
-
function _define_property$
|
|
1579
|
+
function _define_property$5(obj, key, value) {
|
|
1552
1580
|
if (key in obj) {
|
|
1553
1581
|
Object.defineProperty(obj, key, {
|
|
1554
1582
|
value: value,
|
|
@@ -1561,7 +1589,7 @@ function _define_property$4(obj, key, value) {
|
|
|
1561
1589
|
}
|
|
1562
1590
|
return obj;
|
|
1563
1591
|
}
|
|
1564
|
-
function _object_spread$
|
|
1592
|
+
function _object_spread$5(target) {
|
|
1565
1593
|
for(var i = 1; i < arguments.length; i++){
|
|
1566
1594
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1567
1595
|
var ownKeys = Object.keys(source);
|
|
@@ -1571,7 +1599,7 @@ function _object_spread$4(target) {
|
|
|
1571
1599
|
}));
|
|
1572
1600
|
}
|
|
1573
1601
|
ownKeys.forEach(function(key) {
|
|
1574
|
-
_define_property$
|
|
1602
|
+
_define_property$5(target, key, source[key]);
|
|
1575
1603
|
});
|
|
1576
1604
|
}
|
|
1577
1605
|
return target;
|
|
@@ -1588,7 +1616,7 @@ function IndicatorLight(param) {
|
|
|
1588
1616
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
1589
1617
|
id: id,
|
|
1590
1618
|
className: classnames('IndicatorLight', 'bg-input', className),
|
|
1591
|
-
style: _object_spread$
|
|
1619
|
+
style: _object_spread$5({
|
|
1592
1620
|
width: '12px',
|
|
1593
1621
|
height: '12px',
|
|
1594
1622
|
background: isActive ? color : ''
|
|
@@ -1598,12 +1626,41 @@ function IndicatorLight(param) {
|
|
|
1598
1626
|
}) : null);
|
|
1599
1627
|
}
|
|
1600
1628
|
|
|
1601
|
-
var css_248z$2 = ".IconButton {\n height: 28px;\n
|
|
1629
|
+
var css_248z$2 = ".IconButton {\n height: 28px;\n}\n\n.IconButton:hover {\n filter: brightness(80%);\n}\n";
|
|
1602
1630
|
styleInject(css_248z$2);
|
|
1603
1631
|
|
|
1632
|
+
function _define_property$4(obj, key, value) {
|
|
1633
|
+
if (key in obj) {
|
|
1634
|
+
Object.defineProperty(obj, key, {
|
|
1635
|
+
value: value,
|
|
1636
|
+
enumerable: true,
|
|
1637
|
+
configurable: true,
|
|
1638
|
+
writable: true
|
|
1639
|
+
});
|
|
1640
|
+
} else {
|
|
1641
|
+
obj[key] = value;
|
|
1642
|
+
}
|
|
1643
|
+
return obj;
|
|
1644
|
+
}
|
|
1645
|
+
function _object_spread$4(target) {
|
|
1646
|
+
for(var i = 1; i < arguments.length; i++){
|
|
1647
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1648
|
+
var ownKeys = Object.keys(source);
|
|
1649
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1650
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1651
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1652
|
+
}));
|
|
1653
|
+
}
|
|
1654
|
+
ownKeys.forEach(function(key) {
|
|
1655
|
+
_define_property$4(target, key, source[key]);
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
return target;
|
|
1659
|
+
}
|
|
1604
1660
|
var ButtonIcon = /*#__PURE__*/ function(ButtonIcon) {
|
|
1605
1661
|
ButtonIcon["undo"] = "UndoIcon";
|
|
1606
1662
|
ButtonIcon["redo"] = "RedoIcon";
|
|
1663
|
+
ButtonIcon["random"] = "RandomIcon";
|
|
1607
1664
|
return ButtonIcon;
|
|
1608
1665
|
}(ButtonIcon || {});
|
|
1609
1666
|
var UndoIcon = function(param) {
|
|
@@ -1654,23 +1711,85 @@ var RedoIcon = function(param) {
|
|
|
1654
1711
|
"stroke-linejoin": "round"
|
|
1655
1712
|
}));
|
|
1656
1713
|
};
|
|
1714
|
+
var RandomIcon = function(param) {
|
|
1715
|
+
var color = param.color;
|
|
1716
|
+
return /*#__PURE__*/ React__default.createElement("svg", {
|
|
1717
|
+
width: "24px",
|
|
1718
|
+
height: "24px",
|
|
1719
|
+
viewBox: "0 0 24 24",
|
|
1720
|
+
"stroke-width": "1.5",
|
|
1721
|
+
fill: "none",
|
|
1722
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1723
|
+
color: color
|
|
1724
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
1725
|
+
d: "M11.7 1.1732C11.8856 1.06603 12.1144 1.06603 12.3 1.17321L21.2263 6.3268C21.4119 6.43397 21.5263 6.63205 21.5263 6.84641V17.1536C21.5263 17.3679 21.4119 17.566 21.2263 17.6732L12.3 22.8268C12.1144 22.934 11.8856 22.934 11.7 22.8268L2.77372 17.6732C2.58808 17.566 2.47372 17.3679 2.47372 17.1536V6.84641C2.47372 6.63205 2.58808 6.43397 2.77372 6.32679L11.7 1.1732Z",
|
|
1726
|
+
stroke: color,
|
|
1727
|
+
"stroke-width": "1.5",
|
|
1728
|
+
"stroke-linecap": "round",
|
|
1729
|
+
"stroke-linejoin": "round"
|
|
1730
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1731
|
+
d: "M17 15L7 15L12 7L17 15Z",
|
|
1732
|
+
stroke: color,
|
|
1733
|
+
"stroke-width": "1.5",
|
|
1734
|
+
"stroke-linecap": "round",
|
|
1735
|
+
"stroke-linejoin": "round"
|
|
1736
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1737
|
+
d: "M2.5 6.5L12 7",
|
|
1738
|
+
stroke: color,
|
|
1739
|
+
"stroke-width": "1.5",
|
|
1740
|
+
"stroke-linejoin": "round"
|
|
1741
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1742
|
+
d: "M2.5 6.5L7 15",
|
|
1743
|
+
stroke: color,
|
|
1744
|
+
"stroke-width": "1.5",
|
|
1745
|
+
"stroke-linejoin": "round"
|
|
1746
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1747
|
+
d: "M21.5 6.5L17 15",
|
|
1748
|
+
stroke: color,
|
|
1749
|
+
"stroke-width": "1.5",
|
|
1750
|
+
"stroke-linejoin": "round"
|
|
1751
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1752
|
+
d: "M21.5 6.5L12 6.99995L12 1",
|
|
1753
|
+
stroke: color,
|
|
1754
|
+
"stroke-width": "1.5",
|
|
1755
|
+
"stroke-linejoin": "round"
|
|
1756
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1757
|
+
d: "M21.5 17.5L17 15",
|
|
1758
|
+
stroke: color,
|
|
1759
|
+
"stroke-width": "1.5",
|
|
1760
|
+
"stroke-linejoin": "round"
|
|
1761
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1762
|
+
d: "M2.5 17.5L7 15",
|
|
1763
|
+
stroke: color,
|
|
1764
|
+
"stroke-width": "1.5",
|
|
1765
|
+
"stroke-linejoin": "round"
|
|
1766
|
+
}), /*#__PURE__*/ React__default.createElement("path", {
|
|
1767
|
+
d: "M7 15L12 23L17 15",
|
|
1768
|
+
stroke: color,
|
|
1769
|
+
"stroke-width": "1.5",
|
|
1770
|
+
"stroke-linejoin": "round"
|
|
1771
|
+
}));
|
|
1772
|
+
};
|
|
1657
1773
|
var icons = {
|
|
1658
1774
|
UndoIcon: UndoIcon,
|
|
1659
|
-
RedoIcon: RedoIcon
|
|
1775
|
+
RedoIcon: RedoIcon,
|
|
1776
|
+
RandomIcon: RandomIcon
|
|
1660
1777
|
};
|
|
1661
1778
|
function IconButton(param) {
|
|
1662
|
-
var id = param.id, icon = param.icon, onClick = param.onClick
|
|
1779
|
+
var id = param.id, icon = param.icon, onClick = param.onClick, _param_color = param.color, color = _param_color === void 0 ? 'var(--color-text)' : _param_color, _param_backgroundColor = param.backgroundColor, backgroundColor = _param_backgroundColor === void 0 ? 'var(--bg-page)' : _param_backgroundColor, className = param.className, style = param.style;
|
|
1663
1780
|
var Icon = icons[icon];
|
|
1664
1781
|
return /*#__PURE__*/ React__default.createElement(Button, {
|
|
1665
1782
|
id: id,
|
|
1666
|
-
className:
|
|
1783
|
+
className: "IconButton ".concat(className),
|
|
1667
1784
|
onClick: onClick,
|
|
1668
1785
|
padding: [
|
|
1669
1786
|
Button.padding.medium
|
|
1670
1787
|
],
|
|
1671
|
-
style:
|
|
1788
|
+
style: _object_spread$4({
|
|
1789
|
+
backgroundColor: backgroundColor
|
|
1790
|
+
}, style)
|
|
1672
1791
|
}, /*#__PURE__*/ React__default.createElement(Icon, {
|
|
1673
|
-
color:
|
|
1792
|
+
color: color
|
|
1674
1793
|
}));
|
|
1675
1794
|
}
|
|
1676
1795
|
IconButton.icon = ButtonIcon;
|
|
@@ -1818,12 +1937,12 @@ function LinePlot(param) {
|
|
|
1818
1937
|
var css_248z$1 = ".Oscilloscope {\n background: #0EAC8B;\n box-shadow: inset 0 0 20px #086350;\n height: 200px;\n };";
|
|
1819
1938
|
styleInject(css_248z$1);
|
|
1820
1939
|
|
|
1821
|
-
function _array_like_to_array(arr, len) {
|
|
1940
|
+
function _array_like_to_array$1(arr, len) {
|
|
1822
1941
|
if (len == null || len > arr.length) len = arr.length;
|
|
1823
1942
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1824
1943
|
return arr2;
|
|
1825
1944
|
}
|
|
1826
|
-
function _array_with_holes(arr) {
|
|
1945
|
+
function _array_with_holes$1(arr) {
|
|
1827
1946
|
if (Array.isArray(arr)) return arr;
|
|
1828
1947
|
}
|
|
1829
1948
|
function _define_property$2(obj, key, value) {
|
|
@@ -1839,7 +1958,7 @@ function _define_property$2(obj, key, value) {
|
|
|
1839
1958
|
}
|
|
1840
1959
|
return obj;
|
|
1841
1960
|
}
|
|
1842
|
-
function _iterable_to_array_limit(arr, i) {
|
|
1961
|
+
function _iterable_to_array_limit$1(arr, i) {
|
|
1843
1962
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1844
1963
|
if (_i == null) return;
|
|
1845
1964
|
var _arr = [];
|
|
@@ -1863,7 +1982,7 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
1863
1982
|
}
|
|
1864
1983
|
return _arr;
|
|
1865
1984
|
}
|
|
1866
|
-
function _non_iterable_rest() {
|
|
1985
|
+
function _non_iterable_rest$1() {
|
|
1867
1986
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1868
1987
|
}
|
|
1869
1988
|
function _object_spread$2(target) {
|
|
@@ -1881,20 +2000,20 @@ function _object_spread$2(target) {
|
|
|
1881
2000
|
}
|
|
1882
2001
|
return target;
|
|
1883
2002
|
}
|
|
1884
|
-
function _sliced_to_array(arr, i) {
|
|
1885
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
2003
|
+
function _sliced_to_array$1(arr, i) {
|
|
2004
|
+
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
|
|
1886
2005
|
}
|
|
1887
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
2006
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
1888
2007
|
if (!o) return;
|
|
1889
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
2008
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
1890
2009
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1891
2010
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1892
2011
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1893
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
2012
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
1894
2013
|
}
|
|
1895
2014
|
function Oscilloscope(param) {
|
|
1896
2015
|
var width = param.width, height = param.height, className = param.className, style = param.style, id = param.id;
|
|
1897
|
-
var _useState = _sliced_to_array(useState([]), 2), viewData = _useState[0], setViewData = _useState[1];
|
|
2016
|
+
var _useState = _sliced_to_array$1(useState([]), 2), viewData = _useState[0], setViewData = _useState[1];
|
|
1898
2017
|
useEffect(function() {
|
|
1899
2018
|
//@ts-expect-error
|
|
1900
2019
|
var removalToken = window.__JUCE__.backend.addEventListener('oscData', function() {
|
|
@@ -1997,16 +2116,12 @@ function ModuleHeader(param) {
|
|
|
1997
2116
|
id: "undo",
|
|
1998
2117
|
icon: IconButton.icon.undo,
|
|
1999
2118
|
onClick: function() {
|
|
2000
|
-
|
|
2001
|
-
console.log('undo');
|
|
2002
|
-
});
|
|
2119
|
+
undo();
|
|
2003
2120
|
}
|
|
2004
2121
|
}), /*#__PURE__*/ React__default.createElement(IconButton, {
|
|
2005
2122
|
id: "redo",
|
|
2006
2123
|
onClick: function() {
|
|
2007
|
-
|
|
2008
|
-
console.log('redo');
|
|
2009
|
-
});
|
|
2124
|
+
redo();
|
|
2010
2125
|
},
|
|
2011
2126
|
icon: IconButton.icon.redo
|
|
2012
2127
|
}))));
|
|
@@ -2056,5 +2171,89 @@ function ModuleFooter(param) {
|
|
|
2056
2171
|
});
|
|
2057
2172
|
}
|
|
2058
2173
|
|
|
2059
|
-
|
|
2174
|
+
function _array_like_to_array(arr, len) {
|
|
2175
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
2176
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2177
|
+
return arr2;
|
|
2178
|
+
}
|
|
2179
|
+
function _array_with_holes(arr) {
|
|
2180
|
+
if (Array.isArray(arr)) return arr;
|
|
2181
|
+
}
|
|
2182
|
+
function _array_without_holes(arr) {
|
|
2183
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
2184
|
+
}
|
|
2185
|
+
function _iterable_to_array(iter) {
|
|
2186
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
2187
|
+
}
|
|
2188
|
+
function _iterable_to_array_limit(arr, i) {
|
|
2189
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2190
|
+
if (_i == null) return;
|
|
2191
|
+
var _arr = [];
|
|
2192
|
+
var _n = true;
|
|
2193
|
+
var _d = false;
|
|
2194
|
+
var _s, _e;
|
|
2195
|
+
try {
|
|
2196
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
2197
|
+
_arr.push(_s.value);
|
|
2198
|
+
if (i && _arr.length === i) break;
|
|
2199
|
+
}
|
|
2200
|
+
} catch (err) {
|
|
2201
|
+
_d = true;
|
|
2202
|
+
_e = err;
|
|
2203
|
+
} finally{
|
|
2204
|
+
try {
|
|
2205
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
2206
|
+
} finally{
|
|
2207
|
+
if (_d) throw _e;
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
return _arr;
|
|
2211
|
+
}
|
|
2212
|
+
function _non_iterable_rest() {
|
|
2213
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2214
|
+
}
|
|
2215
|
+
function _non_iterable_spread() {
|
|
2216
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2217
|
+
}
|
|
2218
|
+
function _sliced_to_array(arr, i) {
|
|
2219
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
2220
|
+
}
|
|
2221
|
+
function _to_consumable_array(arr) {
|
|
2222
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
2223
|
+
}
|
|
2224
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
2225
|
+
if (!o) return;
|
|
2226
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
2227
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2228
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2229
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2230
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
2231
|
+
}
|
|
2232
|
+
function useObservable() {
|
|
2233
|
+
var _useState = _sliced_to_array(useState([]), 2), observers = _useState[0], setObservers = _useState[1];
|
|
2234
|
+
var subscribe = function(observer) {
|
|
2235
|
+
if (!observers.includes(observer)) {
|
|
2236
|
+
setObservers(_to_consumable_array(observers).concat([
|
|
2237
|
+
observer
|
|
2238
|
+
]));
|
|
2239
|
+
}
|
|
2240
|
+
};
|
|
2241
|
+
var unsubscribe = function(observer) {
|
|
2242
|
+
setObservers(observers.filter(function(item) {
|
|
2243
|
+
return item !== observer;
|
|
2244
|
+
}));
|
|
2245
|
+
};
|
|
2246
|
+
var fire = function(action) {
|
|
2247
|
+
observers.forEach(function() {
|
|
2248
|
+
return action();
|
|
2249
|
+
});
|
|
2250
|
+
};
|
|
2251
|
+
return {
|
|
2252
|
+
subscribe: subscribe,
|
|
2253
|
+
unsubscribe: unsubscribe,
|
|
2254
|
+
fire: fire
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
export { Slider as BarSlider, Box, Button, Dropdown, FontSizes, Heading, IconButton, IndicatorLight, Input, KeyValueDisplayScreen, Label, Matrix, ModuleFooter, ModuleHeader, Oscilloscope, RotarySlider, SliderValue, Spacing, Tabs, clamp, decimalToPercent, getPosition, getTransformString, normalisedToScaled, percentToDecimal, randomizeValue, scaledToNormalised as scaledTonormalised, useObservable, useSlider };
|
|
2060
2259
|
//# sourceMappingURL=index.js.map
|
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,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO;;AAExD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,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;AAC/C,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B;AACA,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B;;AAEA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD;AACA
|
|
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,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO;;AAExD,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACtE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AAC7C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU;;AAEzB,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;AAC/C,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC7B;AACA,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AAC3B;;AAEA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG;AAClC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AACnD;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|