@antimatter-audio/antimatter-ui 10.2.0 → 10.3.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/ModMatrix/ModMatrix.d.ts +2 -2
- package/dist/advanced/ModMatrix/ModMatrix.d.ts.map +1 -1
- package/dist/advanced/ModMatrix/ModMatrixComboboxCell.d.ts +3 -2
- package/dist/advanced/ModMatrix/ModMatrixComboboxCell.d.ts.map +1 -1
- package/dist/advanced/ModMatrix/ModMatrixRow.d.ts +3 -2
- package/dist/advanced/ModMatrix/ModMatrixRow.d.ts.map +1 -1
- package/dist/advanced/ModMatrix/ModMatrixToggleCell.d.ts +9 -0
- package/dist/advanced/ModMatrix/ModMatrixToggleCell.d.ts.map +1 -0
- package/dist/advanced/ModMatrix/constants.d.ts.map +1 -1
- package/dist/context/GlobalContextProvider.d.ts +16 -11
- package/dist/context/GlobalContextProvider.d.ts.map +1 -1
- package/dist/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/core/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/hooks/useCombobox.d.ts +1 -2
- package/dist/hooks/useCombobox.d.ts.map +1 -1
- package/dist/hooks/useDropdown.d.ts +18 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -0
- package/dist/hooks/useSlider.d.ts.map +1 -1
- package/dist/index.js +494 -316
- package/dist/index.js.map +1 -1
- package/dist/src/advanced/ModMatrix/ModMatrix.d.ts +2 -2
- package/dist/src/advanced/ModMatrix/ModMatrix.d.ts.map +1 -1
- package/dist/src/advanced/ModMatrix/ModMatrixCell.d.ts +1 -3
- package/dist/src/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -1
- package/dist/src/advanced/ModMatrix/ModMatrixComboboxCell.d.ts +3 -2
- package/dist/src/advanced/ModMatrix/ModMatrixComboboxCell.d.ts.map +1 -1
- package/dist/src/advanced/ModMatrix/ModMatrixRow.d.ts +3 -2
- package/dist/src/advanced/ModMatrix/ModMatrixRow.d.ts.map +1 -1
- package/dist/src/advanced/ModMatrix/ModMatrixToggleCell.d.ts +9 -0
- package/dist/src/advanced/ModMatrix/ModMatrixToggleCell.d.ts.map +1 -0
- package/dist/src/advanced/ModMatrix/constants.d.ts.map +1 -1
- package/dist/src/context/GlobalContextProvider.d.ts +16 -11
- package/dist/src/context/GlobalContextProvider.d.ts.map +1 -1
- package/dist/src/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/core/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/hooks/useCombobox.d.ts +1 -2
- package/dist/src/hooks/useCombobox.d.ts.map +1 -1
- package/dist/src/hooks/useDropdown.d.ts +18 -0
- package/dist/src/hooks/useDropdown.d.ts.map +1 -0
- package/dist/src/hooks/useSlider.d.ts.map +1 -1
- package/dist/src/hooks/useTabs.d.ts +6 -9
- package/dist/src/hooks/useTabs.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useState, useEffect, useRef, useReducer, useCallback, createContext, useContext
|
|
2
|
+
import React__default, { useState, useEffect, useRef, useReducer, useCallback, createContext, useContext } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { TabGroup, TabList, Tab, Listbox, ListboxButton, ListboxOptions, ListboxOption, Combobox, ComboboxInput, ComboboxButton, ComboboxOptions, ComboboxOption } from '@headlessui/react';
|
|
5
5
|
import * as Juce from 'juce-framework-frontend';
|
|
@@ -218,7 +218,7 @@ function _array_like_to_array$c(arr, len) {
|
|
|
218
218
|
function _array_with_holes$c(arr) {
|
|
219
219
|
if (Array.isArray(arr)) return arr;
|
|
220
220
|
}
|
|
221
|
-
function _define_property$
|
|
221
|
+
function _define_property$j(obj, key, value) {
|
|
222
222
|
if (key in obj) {
|
|
223
223
|
Object.defineProperty(obj, key, {
|
|
224
224
|
value: value,
|
|
@@ -258,7 +258,7 @@ function _iterable_to_array_limit$c(arr, i) {
|
|
|
258
258
|
function _non_iterable_rest$c() {
|
|
259
259
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
260
260
|
}
|
|
261
|
-
function _object_spread$
|
|
261
|
+
function _object_spread$j(target) {
|
|
262
262
|
for(var i = 1; i < arguments.length; i++){
|
|
263
263
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
264
264
|
var ownKeys = Object.keys(source);
|
|
@@ -268,7 +268,7 @@ function _object_spread$i(target) {
|
|
|
268
268
|
}));
|
|
269
269
|
}
|
|
270
270
|
ownKeys.forEach(function(key) {
|
|
271
|
-
_define_property$
|
|
271
|
+
_define_property$j(target, key, source[key]);
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
return target;
|
|
@@ -347,7 +347,7 @@ function Button(param) {
|
|
|
347
347
|
onMouseDown: handleMouseDown,
|
|
348
348
|
disabled: disabled,
|
|
349
349
|
onClick: onClick && onClick,
|
|
350
|
-
style: _object_spread$
|
|
350
|
+
style: _object_spread$j({
|
|
351
351
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
352
352
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
353
353
|
paddingBottom: "var(--p-".concat((_padding_1 = padding[2]) !== null && _padding_1 !== void 0 ? _padding_1 : padding[0], ")"),
|
|
@@ -416,7 +416,7 @@ function _array_like_to_array$b(arr, len) {
|
|
|
416
416
|
function _array_with_holes$b(arr) {
|
|
417
417
|
if (Array.isArray(arr)) return arr;
|
|
418
418
|
}
|
|
419
|
-
function _define_property$
|
|
419
|
+
function _define_property$i(obj, key, value) {
|
|
420
420
|
if (key in obj) {
|
|
421
421
|
Object.defineProperty(obj, key, {
|
|
422
422
|
value: value,
|
|
@@ -456,7 +456,7 @@ function _iterable_to_array_limit$b(arr, i) {
|
|
|
456
456
|
function _non_iterable_rest$b() {
|
|
457
457
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
458
458
|
}
|
|
459
|
-
function _object_spread$
|
|
459
|
+
function _object_spread$i(target) {
|
|
460
460
|
for(var i = 1; i < arguments.length; i++){
|
|
461
461
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
462
462
|
var ownKeys = Object.keys(source);
|
|
@@ -466,7 +466,7 @@ function _object_spread$h(target) {
|
|
|
466
466
|
}));
|
|
467
467
|
}
|
|
468
468
|
ownKeys.forEach(function(key) {
|
|
469
|
-
_define_property$
|
|
469
|
+
_define_property$i(target, key, source[key]);
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
return target;
|
|
@@ -507,9 +507,9 @@ var defaultGlobalStateValue = {
|
|
|
507
507
|
label: 'Antimatter Audio',
|
|
508
508
|
value: 0
|
|
509
509
|
},
|
|
510
|
-
|
|
510
|
+
automatableParamsList: [],
|
|
511
511
|
automatableParamLabels: [],
|
|
512
|
-
modSlots:
|
|
512
|
+
modSlots: {},
|
|
513
513
|
modSlotParams: [],
|
|
514
514
|
modSlotParamLabels: [],
|
|
515
515
|
advancedView: false
|
|
@@ -517,33 +517,41 @@ var defaultGlobalStateValue = {
|
|
|
517
517
|
// Reducer function to handle state updates
|
|
518
518
|
var reducer = function(state, action) {
|
|
519
519
|
switch(action.type){
|
|
520
|
-
case '
|
|
521
|
-
return _object_spread_props$3(_object_spread$
|
|
520
|
+
case 'HIGHLIGHTED_ITEM_CHANGED':
|
|
521
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
522
522
|
highlightedItem: action.payload
|
|
523
523
|
});
|
|
524
|
-
case '
|
|
525
|
-
return _object_spread_props$3(_object_spread$
|
|
524
|
+
case 'ADVANCED_VIEW_TOGGLED':
|
|
525
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
526
526
|
advancedView: action.payload
|
|
527
527
|
});
|
|
528
|
-
case '
|
|
529
|
-
return _object_spread_props$3(_object_spread$
|
|
530
|
-
|
|
528
|
+
case 'AUTOMATABLE_PARAMS_LIST_RECEIVED':
|
|
529
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
530
|
+
automatableParamsList: action.payload
|
|
531
531
|
});
|
|
532
|
-
case '
|
|
533
|
-
return _object_spread_props$3(_object_spread$
|
|
532
|
+
case 'AUTOMATABLE_PARAM_LABELS_RECEIVED':
|
|
533
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
534
534
|
automatableParamLabels: action.payload
|
|
535
535
|
});
|
|
536
|
-
case '
|
|
537
|
-
|
|
538
|
-
|
|
536
|
+
case 'MOD_SLOTS_RECEIVED':
|
|
537
|
+
var _action_payload;
|
|
538
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
539
|
+
modSlots: action === null || action === void 0 ? void 0 : (_action_payload = action.payload) === null || _action_payload === void 0 ? void 0 : _action_payload.reduce(function(acc, val) {
|
|
540
|
+
return _object_spread_props$3(_object_spread$i({}, acc), _define_property$i({}, val[0], val[1]));
|
|
541
|
+
}, {})
|
|
542
|
+
});
|
|
543
|
+
case 'MOD_SLOT_UPDATED':
|
|
544
|
+
var _action_payload1, _action_payload2;
|
|
545
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
546
|
+
modSlots: _object_spread_props$3(_object_spread$i({}, state === null || state === void 0 ? void 0 : state.modSlots), _define_property$i({}, (_action_payload1 = action.payload) === null || _action_payload1 === void 0 ? void 0 : _action_payload1[0], action === null || action === void 0 ? void 0 : (_action_payload2 = action.payload) === null || _action_payload2 === void 0 ? void 0 : _action_payload2[1]))
|
|
539
547
|
});
|
|
540
|
-
case '
|
|
541
|
-
return _object_spread_props$3(_object_spread$
|
|
542
|
-
modSlotParams: action.payload
|
|
548
|
+
case 'MOD_SLOT_PARAMS_LIST_RECEIVED':
|
|
549
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
550
|
+
modSlotParams: action === null || action === void 0 ? void 0 : action.payload
|
|
543
551
|
});
|
|
544
|
-
case '
|
|
545
|
-
return _object_spread_props$3(_object_spread$
|
|
546
|
-
modSlotParamLabels: action.payload
|
|
552
|
+
case 'MOD_SLOT_PARAM_LABELS_RECIEVED':
|
|
553
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
554
|
+
modSlotParamLabels: action === null || action === void 0 ? void 0 : action.payload
|
|
547
555
|
});
|
|
548
556
|
default:
|
|
549
557
|
return state;
|
|
@@ -562,45 +570,51 @@ function useGlobalContext(selector) {
|
|
|
562
570
|
function GlobalContextProvider(param) {
|
|
563
571
|
var children = param.children;
|
|
564
572
|
var _useReducer = _sliced_to_array$b(useReducer(reducer, defaultGlobalStateValue), 2), state = _useReducer[0], dispatch = _useReducer[1];
|
|
565
|
-
var
|
|
573
|
+
var highlightedItemChanged = useCallback(function(highlightedItem) {
|
|
566
574
|
dispatch({
|
|
567
|
-
type: '
|
|
575
|
+
type: 'HIGHLIGHTED_ITEM_CHANGED',
|
|
568
576
|
payload: highlightedItem
|
|
569
577
|
});
|
|
570
578
|
}, []);
|
|
571
|
-
var
|
|
579
|
+
var advancedViewToggled = useCallback(function(advancedView) {
|
|
572
580
|
dispatch({
|
|
573
|
-
type: '
|
|
581
|
+
type: 'ADVANCED_VIEW_TOGGLED',
|
|
574
582
|
payload: advancedView
|
|
575
583
|
});
|
|
576
584
|
}, []);
|
|
577
|
-
var
|
|
585
|
+
var automatableParamsListReceived = useCallback(function(automatableParamsList) {
|
|
578
586
|
dispatch({
|
|
579
|
-
type: '
|
|
580
|
-
payload:
|
|
587
|
+
type: 'AUTOMATABLE_PARAMS_LIST_RECEIVED',
|
|
588
|
+
payload: automatableParamsList
|
|
581
589
|
});
|
|
582
590
|
}, []);
|
|
583
|
-
var
|
|
591
|
+
var automatableParamLabelsReceived = useCallback(function(automatableParamLabels) {
|
|
584
592
|
dispatch({
|
|
585
|
-
type: '
|
|
593
|
+
type: 'AUTOMATABLE_PARAM_LABELS_RECEIVED',
|
|
586
594
|
payload: automatableParamLabels
|
|
587
595
|
});
|
|
588
596
|
}, []);
|
|
589
|
-
var
|
|
597
|
+
var modSlotsReceived = useCallback(function(modSlots) {
|
|
590
598
|
dispatch({
|
|
591
|
-
type: '
|
|
599
|
+
type: 'MOD_SLOTS_RECEIVED',
|
|
592
600
|
payload: modSlots
|
|
593
601
|
});
|
|
594
602
|
}, []);
|
|
595
|
-
var
|
|
603
|
+
var modSlotUpdated = useCallback(function(modSlot) {
|
|
604
|
+
dispatch({
|
|
605
|
+
type: 'MOD_SLOT_UPDATED',
|
|
606
|
+
payload: modSlot
|
|
607
|
+
});
|
|
608
|
+
}, []);
|
|
609
|
+
var modSlotParamsListReceived = useCallback(function(modSlotParams) {
|
|
596
610
|
dispatch({
|
|
597
|
-
type: '
|
|
611
|
+
type: 'MOD_SLOT_PARAMS_LIST_RECEIVED',
|
|
598
612
|
payload: modSlotParams
|
|
599
613
|
});
|
|
600
614
|
}, []);
|
|
601
|
-
var
|
|
615
|
+
var modSlotParamLabelsReceived = useCallback(function(modSlotParamLables) {
|
|
602
616
|
dispatch({
|
|
603
|
-
type: '
|
|
617
|
+
type: 'MOD_SLOT_PARAM_LABELS_RECIEVED',
|
|
604
618
|
payload: modSlotParamLables
|
|
605
619
|
});
|
|
606
620
|
}, []);
|
|
@@ -613,13 +627,14 @@ function GlobalContextProvider(param) {
|
|
|
613
627
|
});
|
|
614
628
|
var value = {
|
|
615
629
|
globalState: state,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
630
|
+
highlightedItemChanged: highlightedItemChanged,
|
|
631
|
+
advancedViewToggled: advancedViewToggled,
|
|
632
|
+
automatableParamsListReceived: automatableParamsListReceived,
|
|
633
|
+
automatableParamLabelsReceived: automatableParamLabelsReceived,
|
|
634
|
+
modSlotsReceived: modSlotsReceived,
|
|
635
|
+
modSlotUpdated: modSlotUpdated,
|
|
636
|
+
modSlotParamsListReceived: modSlotParamsListReceived,
|
|
637
|
+
modSlotParamLabelsReceived: modSlotParamLabelsReceived,
|
|
623
638
|
useRandom: useRandom
|
|
624
639
|
};
|
|
625
640
|
return /*#__PURE__*/ React__default.createElement(GlobalContext.Provider, {
|
|
@@ -673,7 +688,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
|
|
|
673
688
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
674
689
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
675
690
|
}
|
|
676
|
-
var
|
|
691
|
+
var useDropdown = function(param) {
|
|
677
692
|
var id = param.id, label = param.label, _param_items = param.items, items = _param_items === void 0 ? [] : _param_items, filter = param.filter, onChange = param.onChange, _param_displayValInHeader = param.displayValInHeader, displayValInHeader = _param_displayValInHeader === void 0 ? true : _param_displayValInHeader;
|
|
678
693
|
var _properties_choices;
|
|
679
694
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
@@ -687,21 +702,19 @@ var useCombobox = function(param) {
|
|
|
687
702
|
}) : choices;
|
|
688
703
|
var prevIndex = useRef(null);
|
|
689
704
|
var handleChange = function(value) {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
if (index !== prevIndex.current) {
|
|
693
|
-
comboBoxState.setChoiceIndex(index);
|
|
705
|
+
if (value !== prevIndex.current) {
|
|
706
|
+
comboBoxState.setChoiceIndex(value);
|
|
694
707
|
setValue(value);
|
|
695
|
-
onChange && onChange(
|
|
708
|
+
onChange && onChange(value);
|
|
696
709
|
// //@ts-expect-error
|
|
697
710
|
// window.__JUCE__.backend.emitEvent('undoableActionOccurred', {});
|
|
698
711
|
if (displayValInHeader) {
|
|
699
712
|
setHighlightedItem({
|
|
700
713
|
label: label,
|
|
701
|
-
value: choices === null || choices === void 0 ? void 0 : choices[
|
|
714
|
+
value: choices === null || choices === void 0 ? void 0 : choices[value]
|
|
702
715
|
});
|
|
703
716
|
}
|
|
704
|
-
prevIndex.current =
|
|
717
|
+
prevIndex.current = value;
|
|
705
718
|
}
|
|
706
719
|
};
|
|
707
720
|
useEffect(function() {
|
|
@@ -744,17 +757,12 @@ var useCombobox = function(param) {
|
|
|
744
757
|
};
|
|
745
758
|
|
|
746
759
|
function Dropdown(param) {
|
|
747
|
-
var
|
|
748
|
-
|
|
749
|
-
'Mock Item 2',
|
|
750
|
-
'Mock Item 3'
|
|
751
|
-
] : _param_items, label = param.label, className = param.className, onChange = param.onChange, id = param.id, style = param.style;
|
|
752
|
-
var _useCombobox = useCombobox({
|
|
760
|
+
var label = param.label, className = param.className, onChange = param.onChange, id = param.id, style = param.style;
|
|
761
|
+
var _useDropdown = useDropdown({
|
|
753
762
|
id: id,
|
|
754
763
|
label: label,
|
|
755
|
-
items: items,
|
|
756
764
|
onChange: onChange
|
|
757
|
-
}), value =
|
|
765
|
+
}), value = _useDropdown.value, choices = _useDropdown.choices, onMouseEnter = _useDropdown.onMouseEnter, handleChange = _useDropdown.handleChange;
|
|
758
766
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
759
767
|
onMouseEnter: onMouseEnter
|
|
760
768
|
}, /*#__PURE__*/ React__default.createElement(Listbox, {
|
|
@@ -767,11 +775,11 @@ function Dropdown(param) {
|
|
|
767
775
|
onChange: function(value) {
|
|
768
776
|
return console.log(value);
|
|
769
777
|
}
|
|
770
|
-
},
|
|
778
|
+
}, value), /*#__PURE__*/ React__default.createElement(ListboxOptions, {
|
|
771
779
|
anchor: "bottom",
|
|
772
780
|
portal: false,
|
|
773
781
|
className: "Dropdown-items z-10"
|
|
774
|
-
}, choices.map(function(item, i) {
|
|
782
|
+
}, choices === null || choices === void 0 ? void 0 : choices.map(function(item, i) {
|
|
775
783
|
return /*#__PURE__*/ React__default.createElement(ListboxOption, {
|
|
776
784
|
className: classnames('Dropdown-item'),
|
|
777
785
|
key: item,
|
|
@@ -863,7 +871,7 @@ function _array_like_to_array$9(arr, len) {
|
|
|
863
871
|
function _array_with_holes$9(arr) {
|
|
864
872
|
if (Array.isArray(arr)) return arr;
|
|
865
873
|
}
|
|
866
|
-
function _define_property$
|
|
874
|
+
function _define_property$h(obj, key, value) {
|
|
867
875
|
if (key in obj) {
|
|
868
876
|
Object.defineProperty(obj, key, {
|
|
869
877
|
value: value,
|
|
@@ -903,7 +911,7 @@ function _iterable_to_array_limit$9(arr, i) {
|
|
|
903
911
|
function _non_iterable_rest$9() {
|
|
904
912
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
905
913
|
}
|
|
906
|
-
function _object_spread$
|
|
914
|
+
function _object_spread$h(target) {
|
|
907
915
|
for(var i = 1; i < arguments.length; i++){
|
|
908
916
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
909
917
|
var ownKeys = Object.keys(source);
|
|
@@ -913,7 +921,7 @@ function _object_spread$g(target) {
|
|
|
913
921
|
}));
|
|
914
922
|
}
|
|
915
923
|
ownKeys.forEach(function(key) {
|
|
916
|
-
_define_property$
|
|
924
|
+
_define_property$h(target, key, source[key]);
|
|
917
925
|
});
|
|
918
926
|
}
|
|
919
927
|
return target;
|
|
@@ -1045,7 +1053,7 @@ function Input(param) {
|
|
|
1045
1053
|
id: id,
|
|
1046
1054
|
ref: inputRef,
|
|
1047
1055
|
className: classnames('TextInput', hasIncompleteValue || hasError ? 'is-blinking' : '', className),
|
|
1048
|
-
style: _object_spread$
|
|
1056
|
+
style: _object_spread$h({
|
|
1049
1057
|
// TODO
|
|
1050
1058
|
// color: hasError ? 'red' : hasIncompleteValue ? '#999' : textColor
|
|
1051
1059
|
color: hasError ? 'red' : textColor,
|
|
@@ -1184,7 +1192,7 @@ var useSlider = function(param) {
|
|
|
1184
1192
|
var scaledValueRef = useRef(null);
|
|
1185
1193
|
var normalisedValueRef = useRef(null);
|
|
1186
1194
|
// const randomValueSetCounter = useRef<number>(null);
|
|
1187
|
-
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom,
|
|
1195
|
+
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged;
|
|
1188
1196
|
// Set the initial state
|
|
1189
1197
|
//@ts-expect-error
|
|
1190
1198
|
useEffect(function() {
|
|
@@ -1248,7 +1256,7 @@ var useSlider = function(param) {
|
|
|
1248
1256
|
setScaledValue(scaledValue);
|
|
1249
1257
|
onChange && onChange(parseFloat(scaledValueFromState.toFixed(2)));
|
|
1250
1258
|
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1251
|
-
|
|
1259
|
+
highlightedItemChanged({
|
|
1252
1260
|
label: label,
|
|
1253
1261
|
value: scaledValue
|
|
1254
1262
|
});
|
|
@@ -1358,21 +1366,12 @@ var useSlider = function(param) {
|
|
|
1358
1366
|
};
|
|
1359
1367
|
var onMouseEnter = function() {
|
|
1360
1368
|
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1361
|
-
|
|
1369
|
+
highlightedItemChanged({
|
|
1362
1370
|
label: label,
|
|
1363
1371
|
value: scaledValue
|
|
1364
1372
|
});
|
|
1365
1373
|
}
|
|
1366
1374
|
};
|
|
1367
|
-
// TODO: Refactor
|
|
1368
|
-
// const onChangeStarted = () => sliderState.sliderDragStarted();
|
|
1369
|
-
// const onChangeCommitted = () => sliderState.sliderDragEnded();
|
|
1370
|
-
// useEffect(() => {
|
|
1371
|
-
// console.log(
|
|
1372
|
-
// normalisedValueRef.current,
|
|
1373
|
-
// 'normalisedValueRef.currentnormalisedValueRef.currentnormalisedValueRef.currentnormalisedValueRef.currentnormalisedValueRef.currentnormalisedValueRef.current',
|
|
1374
|
-
// );
|
|
1375
|
-
// }, [normalisedValueRef.current]);
|
|
1376
1375
|
return {
|
|
1377
1376
|
setNormalisedState: setNormalisedState,
|
|
1378
1377
|
setScaledState: setScaledState,
|
|
@@ -1415,7 +1414,7 @@ var LayoutTags = /*#__PURE__*/ function(LayoutTags) {
|
|
|
1415
1414
|
return LayoutTags;
|
|
1416
1415
|
}({});
|
|
1417
1416
|
|
|
1418
|
-
function _define_property$
|
|
1417
|
+
function _define_property$g(obj, key, value) {
|
|
1419
1418
|
if (key in obj) {
|
|
1420
1419
|
Object.defineProperty(obj, key, {
|
|
1421
1420
|
value: value,
|
|
@@ -1428,7 +1427,7 @@ function _define_property$f(obj, key, value) {
|
|
|
1428
1427
|
}
|
|
1429
1428
|
return obj;
|
|
1430
1429
|
}
|
|
1431
|
-
function _object_spread$
|
|
1430
|
+
function _object_spread$g(target) {
|
|
1432
1431
|
for(var i = 1; i < arguments.length; i++){
|
|
1433
1432
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1434
1433
|
var ownKeys = Object.keys(source);
|
|
@@ -1438,7 +1437,7 @@ function _object_spread$f(target) {
|
|
|
1438
1437
|
}));
|
|
1439
1438
|
}
|
|
1440
1439
|
ownKeys.forEach(function(key) {
|
|
1441
|
-
_define_property$
|
|
1440
|
+
_define_property$g(target, key, source[key]);
|
|
1442
1441
|
});
|
|
1443
1442
|
}
|
|
1444
1443
|
return target;
|
|
@@ -1521,13 +1520,13 @@ function Box(_param) {
|
|
|
1521
1520
|
]);
|
|
1522
1521
|
var Tag = tag;
|
|
1523
1522
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1524
|
-
return /*#__PURE__*/ React__default.createElement(Tag, _object_spread_props$2(_object_spread$
|
|
1523
|
+
return /*#__PURE__*/ React__default.createElement(Tag, _object_spread_props$2(_object_spread$g({
|
|
1525
1524
|
// id="globalValues"
|
|
1526
1525
|
key: key,
|
|
1527
1526
|
className: className,
|
|
1528
1527
|
onClick: onClick
|
|
1529
1528
|
}, rest), {
|
|
1530
|
-
style: _object_spread$
|
|
1529
|
+
style: _object_spread$g({
|
|
1531
1530
|
flexWrap: flexWrap,
|
|
1532
1531
|
display: display,
|
|
1533
1532
|
gap: "var(--gap-".concat(gap, ")"),
|
|
@@ -1558,7 +1557,7 @@ Box.padding = Spacing;
|
|
|
1558
1557
|
Box.flexWrap = FlexWrap;
|
|
1559
1558
|
Box.tag = LayoutTags;
|
|
1560
1559
|
|
|
1561
|
-
function _define_property$
|
|
1560
|
+
function _define_property$f(obj, key, value) {
|
|
1562
1561
|
if (key in obj) {
|
|
1563
1562
|
Object.defineProperty(obj, key, {
|
|
1564
1563
|
value: value,
|
|
@@ -1571,7 +1570,7 @@ function _define_property$e(obj, key, value) {
|
|
|
1571
1570
|
}
|
|
1572
1571
|
return obj;
|
|
1573
1572
|
}
|
|
1574
|
-
function _object_spread$
|
|
1573
|
+
function _object_spread$f(target) {
|
|
1575
1574
|
for(var i = 1; i < arguments.length; i++){
|
|
1576
1575
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1577
1576
|
var ownKeys = Object.keys(source);
|
|
@@ -1581,7 +1580,7 @@ function _object_spread$e(target) {
|
|
|
1581
1580
|
}));
|
|
1582
1581
|
}
|
|
1583
1582
|
ownKeys.forEach(function(key) {
|
|
1584
|
-
_define_property$
|
|
1583
|
+
_define_property$f(target, key, source[key]);
|
|
1585
1584
|
});
|
|
1586
1585
|
}
|
|
1587
1586
|
return target;
|
|
@@ -1594,7 +1593,7 @@ function Label(param) {
|
|
|
1594
1593
|
return /*#__PURE__*/ React.createElement("label", {
|
|
1595
1594
|
id: id,
|
|
1596
1595
|
htmlFor: htmlFor,
|
|
1597
|
-
style: _object_spread$
|
|
1596
|
+
style: _object_spread$f({
|
|
1598
1597
|
fontSize: "var(--text-".concat(fontSize),
|
|
1599
1598
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1600
1599
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1612,7 +1611,7 @@ Label.fontSize = FontSizes;
|
|
|
1612
1611
|
var css_248z$6 = ".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";
|
|
1613
1612
|
styleInject(css_248z$6);
|
|
1614
1613
|
|
|
1615
|
-
function _define_property$
|
|
1614
|
+
function _define_property$e(obj, key, value) {
|
|
1616
1615
|
if (key in obj) {
|
|
1617
1616
|
Object.defineProperty(obj, key, {
|
|
1618
1617
|
value: value,
|
|
@@ -1625,7 +1624,7 @@ function _define_property$d(obj, key, value) {
|
|
|
1625
1624
|
}
|
|
1626
1625
|
return obj;
|
|
1627
1626
|
}
|
|
1628
|
-
function _object_spread$
|
|
1627
|
+
function _object_spread$e(target) {
|
|
1629
1628
|
for(var i = 1; i < arguments.length; i++){
|
|
1630
1629
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1631
1630
|
var ownKeys = Object.keys(source);
|
|
@@ -1635,7 +1634,7 @@ function _object_spread$d(target) {
|
|
|
1635
1634
|
}));
|
|
1636
1635
|
}
|
|
1637
1636
|
ownKeys.forEach(function(key) {
|
|
1638
|
-
_define_property$
|
|
1637
|
+
_define_property$e(target, key, source[key]);
|
|
1639
1638
|
});
|
|
1640
1639
|
}
|
|
1641
1640
|
return target;
|
|
@@ -1679,11 +1678,11 @@ function RotarySlider(param) {
|
|
|
1679
1678
|
flexDirection: Box.flexDirection.column
|
|
1680
1679
|
}, polarity === Polarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1681
1680
|
className: classnames('RotarySlider-center-marker')
|
|
1682
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$
|
|
1681
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$e({
|
|
1683
1682
|
className: classnames('RotarySlider', polarity === Polarity.linear ? 'Slider-polarity-linear' : 'Slider-polarity-bipolar', className)
|
|
1684
1683
|
}, bindDrag()), {
|
|
1685
1684
|
onMouseEnter: onMouseEnter,
|
|
1686
|
-
style: _object_spread$
|
|
1685
|
+
style: _object_spread$e({
|
|
1687
1686
|
touchAction: 'none'
|
|
1688
1687
|
}, style)
|
|
1689
1688
|
}), normalisedValue !== null ? /*#__PURE__*/ React__default.createElement("div", {
|
|
@@ -1693,7 +1692,7 @@ function RotarySlider(param) {
|
|
|
1693
1692
|
}
|
|
1694
1693
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
1695
1694
|
className: classnames('RotarySlider-Indicator'),
|
|
1696
|
-
style: _object_spread$
|
|
1695
|
+
style: _object_spread$e({
|
|
1697
1696
|
backgroundColor: color
|
|
1698
1697
|
}, style)
|
|
1699
1698
|
})) : ''), /*#__PURE__*/ React__default.createElement(Label, {
|
|
@@ -1706,7 +1705,7 @@ function RotarySlider(param) {
|
|
|
1706
1705
|
}
|
|
1707
1706
|
RotarySlider.sliderPolarity = Polarity;
|
|
1708
1707
|
|
|
1709
|
-
function _define_property$
|
|
1708
|
+
function _define_property$d(obj, key, value) {
|
|
1710
1709
|
if (key in obj) {
|
|
1711
1710
|
Object.defineProperty(obj, key, {
|
|
1712
1711
|
value: value,
|
|
@@ -1719,7 +1718,7 @@ function _define_property$c(obj, key, value) {
|
|
|
1719
1718
|
}
|
|
1720
1719
|
return obj;
|
|
1721
1720
|
}
|
|
1722
|
-
function _object_spread$
|
|
1721
|
+
function _object_spread$d(target) {
|
|
1723
1722
|
for(var i = 1; i < arguments.length; i++){
|
|
1724
1723
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1725
1724
|
var ownKeys = Object.keys(source);
|
|
@@ -1729,7 +1728,7 @@ function _object_spread$c(target) {
|
|
|
1729
1728
|
}));
|
|
1730
1729
|
}
|
|
1731
1730
|
ownKeys.forEach(function(key) {
|
|
1732
|
-
_define_property$
|
|
1731
|
+
_define_property$d(target, key, source[key]);
|
|
1733
1732
|
});
|
|
1734
1733
|
}
|
|
1735
1734
|
return target;
|
|
@@ -1775,11 +1774,11 @@ function Slider(param) {
|
|
|
1775
1774
|
className: classnames(className)
|
|
1776
1775
|
}, polarity === Polarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1777
1776
|
className: 'Slider-center-marker'
|
|
1778
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$
|
|
1777
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$d({
|
|
1779
1778
|
className: classnames('Slider-bar', 'relative')
|
|
1780
1779
|
}, bindBarSliderDrag()), {
|
|
1781
1780
|
onMouseEnter: onMouseEnter,
|
|
1782
|
-
style: _object_spread$
|
|
1781
|
+
style: _object_spread$d({
|
|
1783
1782
|
touchAction: 'none',
|
|
1784
1783
|
backgroundColor: 'var(--bg-input)',
|
|
1785
1784
|
minWidth: sliderOrientation === Orientation.horizontal ? '100px' : '20px',
|
|
@@ -1788,7 +1787,7 @@ function Slider(param) {
|
|
|
1788
1787
|
}), normalisedValue ? /*#__PURE__*/ React__default.createElement("div", {
|
|
1789
1788
|
// TODO: Why aren't the Tailwind classes working?
|
|
1790
1789
|
// className={classnames('h-full', 'w-full', 'absolute', 'bg-input')}
|
|
1791
|
-
style: _object_spread$
|
|
1790
|
+
style: _object_spread$d({
|
|
1792
1791
|
position: 'absolute',
|
|
1793
1792
|
backgroundColor: color,
|
|
1794
1793
|
pointerEvents: 'none'
|
|
@@ -1835,7 +1834,7 @@ var HeadingTags = /*#__PURE__*/ function(HeadingTags) {
|
|
|
1835
1834
|
return HeadingTags;
|
|
1836
1835
|
}({});
|
|
1837
1836
|
|
|
1838
|
-
function _define_property$
|
|
1837
|
+
function _define_property$c(obj, key, value) {
|
|
1839
1838
|
if (key in obj) {
|
|
1840
1839
|
Object.defineProperty(obj, key, {
|
|
1841
1840
|
value: value,
|
|
@@ -1848,7 +1847,7 @@ function _define_property$b(obj, key, value) {
|
|
|
1848
1847
|
}
|
|
1849
1848
|
return obj;
|
|
1850
1849
|
}
|
|
1851
|
-
function _object_spread$
|
|
1850
|
+
function _object_spread$c(target) {
|
|
1852
1851
|
for(var i = 1; i < arguments.length; i++){
|
|
1853
1852
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1854
1853
|
var ownKeys = Object.keys(source);
|
|
@@ -1858,7 +1857,7 @@ function _object_spread$b(target) {
|
|
|
1858
1857
|
}));
|
|
1859
1858
|
}
|
|
1860
1859
|
ownKeys.forEach(function(key) {
|
|
1861
|
-
_define_property$
|
|
1860
|
+
_define_property$c(target, key, source[key]);
|
|
1862
1861
|
});
|
|
1863
1862
|
}
|
|
1864
1863
|
return target;
|
|
@@ -1871,7 +1870,7 @@ function Heading(param) {
|
|
|
1871
1870
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1872
1871
|
return /*#__PURE__*/ React.createElement(Tag, {
|
|
1873
1872
|
id: id,
|
|
1874
|
-
style: _object_spread$
|
|
1873
|
+
style: _object_spread$c({
|
|
1875
1874
|
fontSize: "var(--text-".concat(fontSize),
|
|
1876
1875
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1877
1876
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1972,7 +1971,7 @@ var useIndicator = function(param) {
|
|
|
1972
1971
|
};
|
|
1973
1972
|
};
|
|
1974
1973
|
|
|
1975
|
-
function _define_property$
|
|
1974
|
+
function _define_property$b(obj, key, value) {
|
|
1976
1975
|
if (key in obj) {
|
|
1977
1976
|
Object.defineProperty(obj, key, {
|
|
1978
1977
|
value: value,
|
|
@@ -1985,7 +1984,7 @@ function _define_property$a(obj, key, value) {
|
|
|
1985
1984
|
}
|
|
1986
1985
|
return obj;
|
|
1987
1986
|
}
|
|
1988
|
-
function _object_spread$
|
|
1987
|
+
function _object_spread$b(target) {
|
|
1989
1988
|
for(var i = 1; i < arguments.length; i++){
|
|
1990
1989
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1991
1990
|
var ownKeys = Object.keys(source);
|
|
@@ -1995,7 +1994,7 @@ function _object_spread$a(target) {
|
|
|
1995
1994
|
}));
|
|
1996
1995
|
}
|
|
1997
1996
|
ownKeys.forEach(function(key) {
|
|
1998
|
-
_define_property$
|
|
1997
|
+
_define_property$b(target, key, source[key]);
|
|
1999
1998
|
});
|
|
2000
1999
|
}
|
|
2001
2000
|
return target;
|
|
@@ -2012,7 +2011,7 @@ function IndicatorLight(param) {
|
|
|
2012
2011
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
2013
2012
|
id: id,
|
|
2014
2013
|
className: classnames('IndicatorLight', 'bg-input', className),
|
|
2015
|
-
style: _object_spread$
|
|
2014
|
+
style: _object_spread$b({
|
|
2016
2015
|
width: '12px',
|
|
2017
2016
|
height: '12px',
|
|
2018
2017
|
background: isActive ? color : ''
|
|
@@ -2025,7 +2024,7 @@ function IndicatorLight(param) {
|
|
|
2025
2024
|
var css_248z$5 = ".IconButton:hover:not(:disabled) {\n filter: brightness(80%);\n}\n\nsvg {\n height: 100%;\n width: 100%;\n}\n";
|
|
2026
2025
|
styleInject(css_248z$5);
|
|
2027
2026
|
|
|
2028
|
-
function _define_property$
|
|
2027
|
+
function _define_property$a(obj, key, value) {
|
|
2029
2028
|
if (key in obj) {
|
|
2030
2029
|
Object.defineProperty(obj, key, {
|
|
2031
2030
|
value: value,
|
|
@@ -2038,7 +2037,7 @@ function _define_property$9(obj, key, value) {
|
|
|
2038
2037
|
}
|
|
2039
2038
|
return obj;
|
|
2040
2039
|
}
|
|
2041
|
-
function _object_spread$
|
|
2040
|
+
function _object_spread$a(target) {
|
|
2042
2041
|
for(var i = 1; i < arguments.length; i++){
|
|
2043
2042
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2044
2043
|
var ownKeys = Object.keys(source);
|
|
@@ -2048,7 +2047,7 @@ function _object_spread$9(target) {
|
|
|
2048
2047
|
}));
|
|
2049
2048
|
}
|
|
2050
2049
|
ownKeys.forEach(function(key) {
|
|
2051
|
-
_define_property$
|
|
2050
|
+
_define_property$a(target, key, source[key]);
|
|
2052
2051
|
});
|
|
2053
2052
|
}
|
|
2054
2053
|
return target;
|
|
@@ -2292,7 +2291,7 @@ function Icon(param) {
|
|
|
2292
2291
|
className: "Icon ".concat(className),
|
|
2293
2292
|
onClick: onClick,
|
|
2294
2293
|
padding: padding,
|
|
2295
|
-
style: _object_spread$
|
|
2294
|
+
style: _object_spread$a({
|
|
2296
2295
|
width: width,
|
|
2297
2296
|
height: height
|
|
2298
2297
|
}, style)
|
|
@@ -2305,7 +2304,7 @@ Icon.icon = Icons;
|
|
|
2305
2304
|
Icon.padding = Spacing;
|
|
2306
2305
|
Icon.margin = Spacing;
|
|
2307
2306
|
|
|
2308
|
-
function _define_property$
|
|
2307
|
+
function _define_property$9(obj, key, value) {
|
|
2309
2308
|
if (key in obj) {
|
|
2310
2309
|
Object.defineProperty(obj, key, {
|
|
2311
2310
|
value: value,
|
|
@@ -2318,7 +2317,7 @@ function _define_property$8(obj, key, value) {
|
|
|
2318
2317
|
}
|
|
2319
2318
|
return obj;
|
|
2320
2319
|
}
|
|
2321
|
-
function _object_spread$
|
|
2320
|
+
function _object_spread$9(target) {
|
|
2322
2321
|
for(var i = 1; i < arguments.length; i++){
|
|
2323
2322
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2324
2323
|
var ownKeys = Object.keys(source);
|
|
@@ -2328,7 +2327,7 @@ function _object_spread$8(target) {
|
|
|
2328
2327
|
}));
|
|
2329
2328
|
}
|
|
2330
2329
|
ownKeys.forEach(function(key) {
|
|
2331
|
-
_define_property$
|
|
2330
|
+
_define_property$9(target, key, source[key]);
|
|
2332
2331
|
});
|
|
2333
2332
|
}
|
|
2334
2333
|
return target;
|
|
@@ -2347,7 +2346,7 @@ function IconButton(param) {
|
|
|
2347
2346
|
padding: padding,
|
|
2348
2347
|
margin: margin,
|
|
2349
2348
|
disabled: disabled,
|
|
2350
|
-
style: _object_spread$
|
|
2349
|
+
style: _object_spread$9({
|
|
2351
2350
|
backgroundColor: backgroundColor,
|
|
2352
2351
|
width: width,
|
|
2353
2352
|
height: height
|
|
@@ -2361,7 +2360,7 @@ IconButton.icon = Icons;
|
|
|
2361
2360
|
IconButton.padding = Spacing;
|
|
2362
2361
|
IconButton.margin = Spacing;
|
|
2363
2362
|
|
|
2364
|
-
function _define_property$
|
|
2363
|
+
function _define_property$8(obj, key, value) {
|
|
2365
2364
|
if (key in obj) {
|
|
2366
2365
|
Object.defineProperty(obj, key, {
|
|
2367
2366
|
value: value,
|
|
@@ -2374,7 +2373,7 @@ function _define_property$7(obj, key, value) {
|
|
|
2374
2373
|
}
|
|
2375
2374
|
return obj;
|
|
2376
2375
|
}
|
|
2377
|
-
function _object_spread$
|
|
2376
|
+
function _object_spread$8(target) {
|
|
2378
2377
|
for(var i = 1; i < arguments.length; i++){
|
|
2379
2378
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2380
2379
|
var ownKeys = Object.keys(source);
|
|
@@ -2384,7 +2383,7 @@ function _object_spread$7(target) {
|
|
|
2384
2383
|
}));
|
|
2385
2384
|
}
|
|
2386
2385
|
ownKeys.forEach(function(key) {
|
|
2387
|
-
_define_property$
|
|
2386
|
+
_define_property$8(target, key, source[key]);
|
|
2388
2387
|
});
|
|
2389
2388
|
}
|
|
2390
2389
|
return target;
|
|
@@ -2396,7 +2395,7 @@ function KeyValueDisplayScreen(param) {
|
|
|
2396
2395
|
// justifyContent={Box.justifyContent.flexStart}
|
|
2397
2396
|
alignItems: Box.alignItems.flexStart,
|
|
2398
2397
|
gap: Box.gap.small,
|
|
2399
|
-
style: _object_spread$
|
|
2398
|
+
style: _object_spread$8({}, style),
|
|
2400
2399
|
padding: [
|
|
2401
2400
|
Box.padding.small,
|
|
2402
2401
|
Box.padding.none,
|
|
@@ -2509,7 +2508,7 @@ function _array_like_to_array$6(arr, len) {
|
|
|
2509
2508
|
function _array_with_holes$6(arr) {
|
|
2510
2509
|
if (Array.isArray(arr)) return arr;
|
|
2511
2510
|
}
|
|
2512
|
-
function _define_property$
|
|
2511
|
+
function _define_property$7(obj, key, value) {
|
|
2513
2512
|
if (key in obj) {
|
|
2514
2513
|
Object.defineProperty(obj, key, {
|
|
2515
2514
|
value: value,
|
|
@@ -2549,7 +2548,7 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
2549
2548
|
function _non_iterable_rest$6() {
|
|
2550
2549
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2551
2550
|
}
|
|
2552
|
-
function _object_spread$
|
|
2551
|
+
function _object_spread$7(target) {
|
|
2553
2552
|
for(var i = 1; i < arguments.length; i++){
|
|
2554
2553
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2555
2554
|
var ownKeys = Object.keys(source);
|
|
@@ -2559,7 +2558,7 @@ function _object_spread$6(target) {
|
|
|
2559
2558
|
}));
|
|
2560
2559
|
}
|
|
2561
2560
|
ownKeys.forEach(function(key) {
|
|
2562
|
-
_define_property$
|
|
2561
|
+
_define_property$7(target, key, source[key]);
|
|
2563
2562
|
});
|
|
2564
2563
|
}
|
|
2565
2564
|
return target;
|
|
@@ -2595,7 +2594,7 @@ function Oscilloscope(param) {
|
|
|
2595
2594
|
}, []);
|
|
2596
2595
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
2597
2596
|
id: id,
|
|
2598
|
-
style: _object_spread$
|
|
2597
|
+
style: _object_spread$7({
|
|
2599
2598
|
height: height
|
|
2600
2599
|
}, style),
|
|
2601
2600
|
className: classnames('Oscilloscope', className)
|
|
@@ -3106,7 +3105,7 @@ function _async_to_generator$2(fn) {
|
|
|
3106
3105
|
});
|
|
3107
3106
|
};
|
|
3108
3107
|
}
|
|
3109
|
-
function _define_property$
|
|
3108
|
+
function _define_property$6(obj, key, value) {
|
|
3110
3109
|
if (key in obj) {
|
|
3111
3110
|
Object.defineProperty(obj, key, {
|
|
3112
3111
|
value: value,
|
|
@@ -3146,7 +3145,7 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
3146
3145
|
function _non_iterable_rest$4() {
|
|
3147
3146
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3148
3147
|
}
|
|
3149
|
-
function _object_spread$
|
|
3148
|
+
function _object_spread$6(target) {
|
|
3150
3149
|
for(var i = 1; i < arguments.length; i++){
|
|
3151
3150
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3152
3151
|
var ownKeys = Object.keys(source);
|
|
@@ -3156,7 +3155,7 @@ function _object_spread$5(target) {
|
|
|
3156
3155
|
}));
|
|
3157
3156
|
}
|
|
3158
3157
|
ownKeys.forEach(function(key) {
|
|
3159
|
-
_define_property$
|
|
3158
|
+
_define_property$6(target, key, source[key]);
|
|
3160
3159
|
});
|
|
3161
3160
|
}
|
|
3162
3161
|
return target;
|
|
@@ -3275,7 +3274,7 @@ function ModuleHeader(param) {
|
|
|
3275
3274
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
3276
3275
|
var _useState = _sliced_to_array$4(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
3277
3276
|
var _useState1 = _sliced_to_array$4(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
3278
|
-
var _useGlobalContext = useGlobalContext(), globalState = _useGlobalContext.globalState,
|
|
3277
|
+
var _useGlobalContext = useGlobalContext(), globalState = _useGlobalContext.globalState, advancedViewToggled = _useGlobalContext.advancedViewToggled;
|
|
3279
3278
|
var handleUndo = function() {
|
|
3280
3279
|
undo();
|
|
3281
3280
|
};
|
|
@@ -3302,7 +3301,7 @@ function ModuleHeader(param) {
|
|
|
3302
3301
|
case 1:
|
|
3303
3302
|
advancedViewStatus = _state.sent();
|
|
3304
3303
|
setAdvancedViewFunc(!advancedViewStatus);
|
|
3305
|
-
|
|
3304
|
+
advancedViewToggled(!advancedViewStatus);
|
|
3306
3305
|
return [
|
|
3307
3306
|
3,
|
|
3308
3307
|
3
|
|
@@ -3352,7 +3351,7 @@ function ModuleHeader(param) {
|
|
|
3352
3351
|
];
|
|
3353
3352
|
case 1:
|
|
3354
3353
|
advancedViewStatus = _state.sent();
|
|
3355
|
-
|
|
3354
|
+
advancedViewToggled(advancedViewStatus);
|
|
3356
3355
|
return [
|
|
3357
3356
|
3,
|
|
3358
3357
|
3
|
|
@@ -3441,7 +3440,7 @@ function ModuleHeader(param) {
|
|
|
3441
3440
|
Box.padding.large
|
|
3442
3441
|
],
|
|
3443
3442
|
className: classnames('ModuleHeader', className),
|
|
3444
|
-
style: _object_spread$
|
|
3443
|
+
style: _object_spread$6({}, style)
|
|
3445
3444
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3446
3445
|
style: {
|
|
3447
3446
|
width: '1000px'
|
|
@@ -3513,7 +3512,7 @@ function ModuleHeader(param) {
|
|
|
3513
3512
|
}, "Advanced")))));
|
|
3514
3513
|
}
|
|
3515
3514
|
|
|
3516
|
-
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.ModMatrixComboboxCell {\n background: #252429;\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}\n\n.ModMatrixComboboxItem:hover,\n.ModMatrixComboboxItem:active {\n background: var(--color-gray-600);\n}\n\n.ModMatrixComboboxItem {\n padding: var(--spacing-md) var(--spacing-lg);\n width: 100%;\n}\n
|
|
3515
|
+
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 cursor: grab;\n}\n\n.ModMatrixCell:active {\n cursor: grabbing;\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";
|
|
3517
3516
|
styleInject(css_248z$1);
|
|
3518
3517
|
|
|
3519
3518
|
var targetColors = [
|
|
@@ -3523,11 +3522,12 @@ var targetColors = [
|
|
|
3523
3522
|
'#ce5847',
|
|
3524
3523
|
'#d98368',
|
|
3525
3524
|
'#E0859D',
|
|
3526
|
-
'#4DA1CB'
|
|
3525
|
+
'#4DA1CB',
|
|
3526
|
+
'#cb4d62'
|
|
3527
3527
|
];
|
|
3528
3528
|
var ComboboxCellWidth = '217px';
|
|
3529
3529
|
|
|
3530
|
-
function _define_property$
|
|
3530
|
+
function _define_property$5(obj, key, value) {
|
|
3531
3531
|
if (key in obj) {
|
|
3532
3532
|
Object.defineProperty(obj, key, {
|
|
3533
3533
|
value: value,
|
|
@@ -3540,7 +3540,7 @@ function _define_property$4(obj, key, value) {
|
|
|
3540
3540
|
}
|
|
3541
3541
|
return obj;
|
|
3542
3542
|
}
|
|
3543
|
-
function _object_spread$
|
|
3543
|
+
function _object_spread$5(target) {
|
|
3544
3544
|
for(var i = 1; i < arguments.length; i++){
|
|
3545
3545
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3546
3546
|
var ownKeys = Object.keys(source);
|
|
@@ -3550,7 +3550,7 @@ function _object_spread$4(target) {
|
|
|
3550
3550
|
}));
|
|
3551
3551
|
}
|
|
3552
3552
|
ownKeys.forEach(function(key) {
|
|
3553
|
-
_define_property$
|
|
3553
|
+
_define_property$5(target, key, source[key]);
|
|
3554
3554
|
});
|
|
3555
3555
|
}
|
|
3556
3556
|
return target;
|
|
@@ -3566,7 +3566,7 @@ function SingleBarViz(param) {
|
|
|
3566
3566
|
position: 'relative'
|
|
3567
3567
|
}
|
|
3568
3568
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
3569
|
-
style: _object_spread$
|
|
3569
|
+
style: _object_spread$5({
|
|
3570
3570
|
position: 'absolute',
|
|
3571
3571
|
background: background
|
|
3572
3572
|
}, getBarTransformStyles({
|
|
@@ -3586,7 +3586,122 @@ function _array_like_to_array$3(arr, len) {
|
|
|
3586
3586
|
function _array_with_holes$3(arr) {
|
|
3587
3587
|
if (Array.isArray(arr)) return arr;
|
|
3588
3588
|
}
|
|
3589
|
-
function
|
|
3589
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
3590
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3591
|
+
if (_i == null) return;
|
|
3592
|
+
var _arr = [];
|
|
3593
|
+
var _n = true;
|
|
3594
|
+
var _d = false;
|
|
3595
|
+
var _s, _e;
|
|
3596
|
+
try {
|
|
3597
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
3598
|
+
_arr.push(_s.value);
|
|
3599
|
+
if (i && _arr.length === i) break;
|
|
3600
|
+
}
|
|
3601
|
+
} catch (err) {
|
|
3602
|
+
_d = true;
|
|
3603
|
+
_e = err;
|
|
3604
|
+
} finally{
|
|
3605
|
+
try {
|
|
3606
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3607
|
+
} finally{
|
|
3608
|
+
if (_d) throw _e;
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
return _arr;
|
|
3612
|
+
}
|
|
3613
|
+
function _non_iterable_rest$3() {
|
|
3614
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3615
|
+
}
|
|
3616
|
+
function _sliced_to_array$3(arr, i) {
|
|
3617
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
3618
|
+
}
|
|
3619
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
3620
|
+
if (!o) return;
|
|
3621
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
3622
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3623
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3624
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3625
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
3626
|
+
}
|
|
3627
|
+
var useCombobox = function(param) {
|
|
3628
|
+
var id = param.id, filter = param.filter, onChange = param.onChange;
|
|
3629
|
+
var _Object_values;
|
|
3630
|
+
var comboBoxState = Juce.getComboBoxState(id);
|
|
3631
|
+
var _useState = _sliced_to_array$3(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
3632
|
+
var _useState1 = _sliced_to_array$3(useState(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
3633
|
+
var _useGlobalContext = useGlobalContext(); _useGlobalContext.highlightedItemChanged; var _useGlobalContext_globalState = _useGlobalContext.globalState, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3634
|
+
//TODO: Filter choices for subsequent rows
|
|
3635
|
+
// const availableChoices = properties?.choices;
|
|
3636
|
+
useEffect(function() {
|
|
3637
|
+
setValue(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.getChoiceIndex());
|
|
3638
|
+
}, [
|
|
3639
|
+
id
|
|
3640
|
+
]);
|
|
3641
|
+
useEffect(function() {
|
|
3642
|
+
setProperties(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties);
|
|
3643
|
+
});
|
|
3644
|
+
useEffect(function() {
|
|
3645
|
+
var _comboBoxState_valueChangedEvent, _comboBoxState_propertiesChangedEvent;
|
|
3646
|
+
var valueListenerId = comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_valueChangedEvent = comboBoxState.valueChangedEvent) === null || _comboBoxState_valueChangedEvent === void 0 ? void 0 : _comboBoxState_valueChangedEvent.addListener(function() {
|
|
3647
|
+
setValue(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.getChoiceIndex());
|
|
3648
|
+
});
|
|
3649
|
+
var propertiesListenerId = comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_propertiesChangedEvent = comboBoxState.propertiesChangedEvent) === null || _comboBoxState_propertiesChangedEvent === void 0 ? void 0 : _comboBoxState_propertiesChangedEvent.addListener(function() {
|
|
3650
|
+
setProperties(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties);
|
|
3651
|
+
});
|
|
3652
|
+
return function cleanup() {
|
|
3653
|
+
var _comboBoxState_valueChangedEvent, _comboBoxState_propertiesChangedEvent;
|
|
3654
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_valueChangedEvent = comboBoxState.valueChangedEvent) === null || _comboBoxState_valueChangedEvent === void 0 ? void 0 : _comboBoxState_valueChangedEvent.removeListener(valueListenerId);
|
|
3655
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_propertiesChangedEvent = comboBoxState.propertiesChangedEvent) === null || _comboBoxState_propertiesChangedEvent === void 0 ? void 0 : _comboBoxState_propertiesChangedEvent.removeListener(propertiesListenerId);
|
|
3656
|
+
};
|
|
3657
|
+
}, [
|
|
3658
|
+
window
|
|
3659
|
+
]);
|
|
3660
|
+
var selectedChoices = (_Object_values = Object.values(modSlots)) === null || _Object_values === void 0 ? void 0 : _Object_values.filter(function(item) {
|
|
3661
|
+
return item > 0;
|
|
3662
|
+
});
|
|
3663
|
+
var selectedLabels = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.filter(function(item, i) {
|
|
3664
|
+
return selectedChoices === null || selectedChoices === void 0 ? void 0 : selectedChoices.includes(i);
|
|
3665
|
+
});
|
|
3666
|
+
var displayedLabels = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.filter(function(item) {
|
|
3667
|
+
return !(selectedLabels === null || selectedLabels === void 0 ? void 0 : selectedLabels.includes(item)) || item === automatableParamLabels[value];
|
|
3668
|
+
});
|
|
3669
|
+
var filteredChoices = filter && (filter === null || filter === void 0 ? void 0 : filter.length) > 1 ? displayedLabels === null || displayedLabels === void 0 ? void 0 : displayedLabels.filter(function(item) {
|
|
3670
|
+
var _item_toLowerCase;
|
|
3671
|
+
return item === null || item === void 0 ? void 0 : (_item_toLowerCase = item.toLowerCase()) === null || _item_toLowerCase === void 0 ? void 0 : _item_toLowerCase.includes(filter === null || filter === void 0 ? void 0 : filter.toLowerCase());
|
|
3672
|
+
}) : displayedLabels;
|
|
3673
|
+
var prevValue = useRef(null);
|
|
3674
|
+
var handleChange = function(newValue) {
|
|
3675
|
+
if (newValue !== prevValue.current) {
|
|
3676
|
+
var juceIndex = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.indexOf(newValue);
|
|
3677
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.setChoiceIndex(juceIndex);
|
|
3678
|
+
setValue(newValue);
|
|
3679
|
+
onChange && onChange(juceIndex);
|
|
3680
|
+
prevValue.current = juceIndex;
|
|
3681
|
+
}
|
|
3682
|
+
};
|
|
3683
|
+
var onMouseEnter = function() {
|
|
3684
|
+
};
|
|
3685
|
+
return {
|
|
3686
|
+
value: value,
|
|
3687
|
+
valueString: automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels[value],
|
|
3688
|
+
setValue: setValue,
|
|
3689
|
+
choices: properties === null || properties === void 0 ? void 0 : properties.choices,
|
|
3690
|
+
filteredChoices: filteredChoices,
|
|
3691
|
+
onMouseEnter: onMouseEnter,
|
|
3692
|
+
handleChange: handleChange
|
|
3693
|
+
};
|
|
3694
|
+
};
|
|
3695
|
+
|
|
3696
|
+
function _array_like_to_array$2(arr, len) {
|
|
3697
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3698
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3699
|
+
return arr2;
|
|
3700
|
+
}
|
|
3701
|
+
function _array_with_holes$2(arr) {
|
|
3702
|
+
if (Array.isArray(arr)) return arr;
|
|
3703
|
+
}
|
|
3704
|
+
function _define_property$4(obj, key, value) {
|
|
3590
3705
|
if (key in obj) {
|
|
3591
3706
|
Object.defineProperty(obj, key, {
|
|
3592
3707
|
value: value,
|
|
@@ -3599,7 +3714,7 @@ function _define_property$3(obj, key, value) {
|
|
|
3599
3714
|
}
|
|
3600
3715
|
return obj;
|
|
3601
3716
|
}
|
|
3602
|
-
function _iterable_to_array_limit$
|
|
3717
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
3603
3718
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3604
3719
|
if (_i == null) return;
|
|
3605
3720
|
var _arr = [];
|
|
@@ -3623,10 +3738,10 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
3623
3738
|
}
|
|
3624
3739
|
return _arr;
|
|
3625
3740
|
}
|
|
3626
|
-
function _non_iterable_rest$
|
|
3741
|
+
function _non_iterable_rest$2() {
|
|
3627
3742
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3628
3743
|
}
|
|
3629
|
-
function _object_spread$
|
|
3744
|
+
function _object_spread$4(target) {
|
|
3630
3745
|
for(var i = 1; i < arguments.length; i++){
|
|
3631
3746
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3632
3747
|
var ownKeys = Object.keys(source);
|
|
@@ -3636,34 +3751,33 @@ function _object_spread$3(target) {
|
|
|
3636
3751
|
}));
|
|
3637
3752
|
}
|
|
3638
3753
|
ownKeys.forEach(function(key) {
|
|
3639
|
-
_define_property$
|
|
3754
|
+
_define_property$4(target, key, source[key]);
|
|
3640
3755
|
});
|
|
3641
3756
|
}
|
|
3642
3757
|
return target;
|
|
3643
3758
|
}
|
|
3644
|
-
function _sliced_to_array$
|
|
3645
|
-
return _array_with_holes$
|
|
3759
|
+
function _sliced_to_array$2(arr, i) {
|
|
3760
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
3646
3761
|
}
|
|
3647
|
-
function _unsupported_iterable_to_array$
|
|
3762
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
3648
3763
|
if (!o) return;
|
|
3649
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3764
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
3650
3765
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3651
3766
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3652
3767
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3653
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
3768
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
3654
3769
|
}
|
|
3655
3770
|
function ModMatrixComboboxCell(param) {
|
|
3656
|
-
var target = param.target, handleTargetChange = param.handleTargetChange, rowId = param.rowId, color = param.color, style = param.style;
|
|
3657
|
-
var
|
|
3658
|
-
var
|
|
3659
|
-
var
|
|
3771
|
+
var target = param.target, handleTargetChange = param.handleTargetChange, rowId = param.rowId, key = param.key, color = param.color, style = param.style;
|
|
3772
|
+
var _SingleBarViz_polarity;
|
|
3773
|
+
var _useState = _sliced_to_array$2(useState(), 2), targetValue = _useState[0], setTargetValue = _useState[1];
|
|
3774
|
+
var _useState1 = _sliced_to_array$2(useState(''), 2), filterString = _useState1[0], setFilterString = _useState1[1];
|
|
3775
|
+
var _useGlobalContext = useGlobalContext(), automatableParamLabels = _useGlobalContext.globalState.automatableParamLabels;
|
|
3660
3776
|
var _useCombobox = useCombobox({
|
|
3661
3777
|
id: rowId,
|
|
3662
|
-
items: globalState === null || globalState === void 0 ? void 0 : globalState.automatableParams,
|
|
3663
3778
|
filter: filterString,
|
|
3664
|
-
displayValInHeader: false,
|
|
3665
3779
|
onChange: handleTargetChange
|
|
3666
|
-
}), value = _useCombobox.value,
|
|
3780
|
+
}), value = _useCombobox.value, filteredChoices = _useCombobox.filteredChoices, handleChange = _useCombobox.handleChange;
|
|
3667
3781
|
useEffect(function() {
|
|
3668
3782
|
if (target) {
|
|
3669
3783
|
var sliderState = Juce.getSliderState(target);
|
|
@@ -3673,17 +3787,12 @@ function ModMatrixComboboxCell(param) {
|
|
|
3673
3787
|
}, [
|
|
3674
3788
|
target
|
|
3675
3789
|
]);
|
|
3676
|
-
// useEffect(() => {
|
|
3677
|
-
// console.log(
|
|
3678
|
-
// globalState?.automatableParams,
|
|
3679
|
-
// 'globalState?.automatableParams',
|
|
3680
|
-
// );
|
|
3681
|
-
// });
|
|
3682
3790
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3791
|
+
key: key,
|
|
3683
3792
|
className: "ModMatrixCell ModMatrixComboboxCell",
|
|
3684
3793
|
justifyContent: Box.justifyContent.flexEnd,
|
|
3685
3794
|
flexDirection: Box.flexDirection.column,
|
|
3686
|
-
style: _object_spread$
|
|
3795
|
+
style: _object_spread$4({
|
|
3687
3796
|
color: color
|
|
3688
3797
|
}, style),
|
|
3689
3798
|
padding: [
|
|
@@ -3696,13 +3805,15 @@ function ModMatrixComboboxCell(param) {
|
|
|
3696
3805
|
value: value,
|
|
3697
3806
|
onChange: handleChange
|
|
3698
3807
|
}, /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(ComboboxInput, {
|
|
3699
|
-
displayValue: function() {
|
|
3700
|
-
|
|
3701
|
-
return globalState === null || globalState === void 0 ? void 0 : (_globalState_automatableParamLabels = globalState.automatableParamLabels) === null || _globalState_automatableParamLabels === void 0 ? void 0 : _globalState_automatableParamLabels[value];
|
|
3808
|
+
displayValue: function(item) {
|
|
3809
|
+
return value ? automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels[value] : '';
|
|
3702
3810
|
},
|
|
3811
|
+
placeholder: "Select a target...",
|
|
3703
3812
|
onChange: function(e) {
|
|
3704
|
-
|
|
3705
|
-
|
|
3813
|
+
var _e_target;
|
|
3814
|
+
setFilterString(e === null || e === void 0 ? void 0 : (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.value);
|
|
3815
|
+
},
|
|
3816
|
+
autoFocus: true
|
|
3706
3817
|
}), /*#__PURE__*/ React__default.createElement(ComboboxButton, {
|
|
3707
3818
|
className: "ModMatrixComboboxButton"
|
|
3708
3819
|
}, /*#__PURE__*/ React__default.createElement(Icon, {
|
|
@@ -3719,20 +3830,14 @@ function ModMatrixComboboxCell(param) {
|
|
|
3719
3830
|
// anchor="bottom"
|
|
3720
3831
|
transition: true
|
|
3721
3832
|
}, filteredChoices === null || filteredChoices === void 0 ? void 0 : filteredChoices.map(function(item) {
|
|
3722
|
-
|
|
3723
|
-
return(// <Box
|
|
3724
|
-
// padding={[Box.padding.medium, Box.padding.large]}
|
|
3725
|
-
// justifyContent={Box.justifyContent.flexStart}
|
|
3726
|
-
// className="ModMatrixComboboxItemContainer"
|
|
3727
|
-
// >
|
|
3728
|
-
/*#__PURE__*/ React__default.createElement(ComboboxOption, {
|
|
3833
|
+
return /*#__PURE__*/ React__default.createElement(ComboboxOption, {
|
|
3729
3834
|
className: "ModMatrixComboboxItem",
|
|
3730
3835
|
key: item,
|
|
3731
3836
|
value: item
|
|
3732
|
-
}, /*#__PURE__*/ React__default.createElement(Label, null, item
|
|
3837
|
+
}, /*#__PURE__*/ React__default.createElement(Label, null, item));
|
|
3733
3838
|
}))), /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
3734
3839
|
value: targetValue,
|
|
3735
|
-
polarity: SingleBarViz.polarity.linear,
|
|
3840
|
+
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.linear,
|
|
3736
3841
|
background: color,
|
|
3737
3842
|
style: {
|
|
3738
3843
|
alignSelf: 'flex-end'
|
|
@@ -3740,6 +3845,65 @@ function ModMatrixComboboxCell(param) {
|
|
|
3740
3845
|
}));
|
|
3741
3846
|
}
|
|
3742
3847
|
|
|
3848
|
+
function _define_property$3(obj, key, value) {
|
|
3849
|
+
if (key in obj) {
|
|
3850
|
+
Object.defineProperty(obj, key, {
|
|
3851
|
+
value: value,
|
|
3852
|
+
enumerable: true,
|
|
3853
|
+
configurable: true,
|
|
3854
|
+
writable: true
|
|
3855
|
+
});
|
|
3856
|
+
} else {
|
|
3857
|
+
obj[key] = value;
|
|
3858
|
+
}
|
|
3859
|
+
return obj;
|
|
3860
|
+
}
|
|
3861
|
+
function _object_spread$3(target) {
|
|
3862
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3863
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3864
|
+
var ownKeys = Object.keys(source);
|
|
3865
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3866
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3867
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3868
|
+
}));
|
|
3869
|
+
}
|
|
3870
|
+
ownKeys.forEach(function(key) {
|
|
3871
|
+
_define_property$3(target, key, source[key]);
|
|
3872
|
+
});
|
|
3873
|
+
}
|
|
3874
|
+
return target;
|
|
3875
|
+
}
|
|
3876
|
+
function ModMatrixToggleCell(param) {
|
|
3877
|
+
var modifier = param.modifier, color = param.color, style = param.style;
|
|
3878
|
+
var _useDropdown = useDropdown({
|
|
3879
|
+
id: modifier
|
|
3880
|
+
}), value = _useDropdown.value, handleChange = _useDropdown.handleChange;
|
|
3881
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3882
|
+
className: "ModMatrixCell ModMatrixToggleCell",
|
|
3883
|
+
justifyContent: Box.justifyContent.flexEnd,
|
|
3884
|
+
alignItems: Box.alignItems.flexStart,
|
|
3885
|
+
flexDirection: Box.flexDirection.column,
|
|
3886
|
+
style: _object_spread$3({
|
|
3887
|
+
color: color,
|
|
3888
|
+
pointerEvents: 'all'
|
|
3889
|
+
}, style),
|
|
3890
|
+
height: '2.5rem',
|
|
3891
|
+
onClick: function() {
|
|
3892
|
+
var newValue = Math.abs(value - 1);
|
|
3893
|
+
handleChange(newValue);
|
|
3894
|
+
}
|
|
3895
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3896
|
+
flex: "1",
|
|
3897
|
+
style: {
|
|
3898
|
+
pointerEvents: 'none'
|
|
3899
|
+
}
|
|
3900
|
+
}, /*#__PURE__*/ React__default.createElement(Label, {
|
|
3901
|
+
style: {
|
|
3902
|
+
pointerEvents: 'none'
|
|
3903
|
+
}
|
|
3904
|
+
}, Object.keys(Polarity)[value] || '0')));
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3743
3907
|
function _define_property$2(obj, key, value) {
|
|
3744
3908
|
if (key in obj) {
|
|
3745
3909
|
Object.defineProperty(obj, key, {
|
|
@@ -3769,7 +3933,8 @@ function _object_spread$2(target) {
|
|
|
3769
3933
|
return target;
|
|
3770
3934
|
}
|
|
3771
3935
|
function ModMatrixCell(param) {
|
|
3772
|
-
|
|
3936
|
+
var modifier = param.modifier, color = param.color, style = param.style;
|
|
3937
|
+
var _SingleBarViz_polarity;
|
|
3773
3938
|
var _useSlider = useSlider({
|
|
3774
3939
|
id: modifier,
|
|
3775
3940
|
displayValInHeader: false
|
|
@@ -3797,73 +3962,52 @@ function ModMatrixCell(param) {
|
|
|
3797
3962
|
}
|
|
3798
3963
|
}, /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
3799
3964
|
value: (modifier === null || modifier === void 0 ? void 0 : modifier.value) || 0,
|
|
3800
|
-
polarity: SingleBarViz.polarity.linear,
|
|
3965
|
+
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.linear,
|
|
3801
3966
|
background: color,
|
|
3802
3967
|
style: _object_spread$2({
|
|
3803
3968
|
alignSelf: 'flex-end',
|
|
3804
3969
|
pointerEvents: 'none'
|
|
3805
3970
|
}, getBarTransformStyles({
|
|
3806
|
-
orientation: Orientation.horizontal,
|
|
3807
|
-
polarity: Polarity.linear,
|
|
3808
|
-
value: parseFloat(scaledNormalisedValue.toFixed(2))
|
|
3971
|
+
orientation: Orientation === null || Orientation === void 0 ? void 0 : Orientation.horizontal,
|
|
3972
|
+
polarity: Polarity === null || Polarity === void 0 ? void 0 : Polarity.linear,
|
|
3973
|
+
value: parseFloat(scaledNormalisedValue === null || scaledNormalisedValue === void 0 ? void 0 : scaledNormalisedValue.toFixed(2))
|
|
3809
3974
|
}))
|
|
3810
3975
|
})));
|
|
3811
3976
|
}
|
|
3812
3977
|
|
|
3813
|
-
function
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
function
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3978
|
+
function ModMatrixRow(param) {
|
|
3979
|
+
var rowId = param.rowId, key = param.key, _param_isPreview = param.// rowIndex,
|
|
3980
|
+
isPreview, isPreview = _param_isPreview === void 0 ? false : _param_isPreview, setIsPreview = param.setIsPreview;
|
|
3981
|
+
var _Object_keys, _modSlotParams_modSlotIndex;
|
|
3982
|
+
// const [rowTarget, setRowTarget] = useState<number>();
|
|
3983
|
+
// const getModSlotsFunc = Juce.getNativeFunction('getModSlots');
|
|
3984
|
+
var _useGlobalContext = useGlobalContext(), modSlotUpdated = _useGlobalContext.modSlotUpdated, _useGlobalContext_globalState = _useGlobalContext.globalState, modSlotParams = _useGlobalContext_globalState.modSlotParams, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3985
|
+
var modSlotIndex = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.indexOf(rowId);
|
|
3986
|
+
var handleTargetChange = function(newTarget) {
|
|
3987
|
+
if (newTarget > 0) {
|
|
3988
|
+
modSlotUpdated([
|
|
3989
|
+
rowId,
|
|
3990
|
+
newTarget
|
|
3991
|
+
]);
|
|
3992
|
+
} else {
|
|
3993
|
+
var _modSlotParams_modSlotIndex;
|
|
3994
|
+
modSlotUpdated([
|
|
3995
|
+
rowId,
|
|
3996
|
+
0
|
|
3997
|
+
]);
|
|
3998
|
+
modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex.forEach(function(item) {
|
|
3999
|
+
var sliderState = Juce.getSliderState(item);
|
|
4000
|
+
sliderState === null || sliderState === void 0 ? void 0 : sliderState.setNormalisedValue(0);
|
|
4001
|
+
});
|
|
3832
4002
|
}
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
_e = err;
|
|
3836
|
-
} finally{
|
|
3837
|
-
try {
|
|
3838
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
3839
|
-
} finally{
|
|
3840
|
-
if (_d) throw _e;
|
|
4003
|
+
if (isPreview && newTarget) {
|
|
4004
|
+
setIsPreview(false);
|
|
3841
4005
|
}
|
|
3842
|
-
}
|
|
3843
|
-
return _arr;
|
|
3844
|
-
}
|
|
3845
|
-
function _non_iterable_rest$2() {
|
|
3846
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3847
|
-
}
|
|
3848
|
-
function _sliced_to_array$2(arr, i) {
|
|
3849
|
-
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
3850
|
-
}
|
|
3851
|
-
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
3852
|
-
if (!o) return;
|
|
3853
|
-
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
3854
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3855
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3856
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3857
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
3858
|
-
}
|
|
3859
|
-
function ModMatrixRow(param) {
|
|
3860
|
-
var rowId = param.rowId, rowIndex = param.rowIndex; param.isPreview;
|
|
3861
|
-
var _globalState_modSlotParams_rowIndex;
|
|
3862
|
-
var _useState = _sliced_to_array$2(useState(), 2), rowTarget = _useState[0], setRowTarget = _useState[1];
|
|
3863
|
-
var globalState = useGlobalContext().globalState;
|
|
4006
|
+
};
|
|
3864
4007
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3865
4008
|
className: "ModMatrixBodyRow",
|
|
3866
|
-
gap: Box.gap.medium
|
|
4009
|
+
gap: Box.gap.medium,
|
|
4010
|
+
key: key
|
|
3867
4011
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3868
4012
|
className: "ModMatrixBodyCell ModMatrixComboboxCell",
|
|
3869
4013
|
justifyContent: Box.justifyContent.flexStart,
|
|
@@ -3872,24 +4016,28 @@ function ModMatrixRow(param) {
|
|
|
3872
4016
|
color: targetColors[0]
|
|
3873
4017
|
}
|
|
3874
4018
|
}, /*#__PURE__*/ React__default.createElement(ModMatrixComboboxCell, {
|
|
3875
|
-
target:
|
|
3876
|
-
handleTargetChange:
|
|
4019
|
+
target: modSlots[rowId],
|
|
4020
|
+
handleTargetChange: handleTargetChange,
|
|
3877
4021
|
rowId: rowId,
|
|
3878
4022
|
color: targetColors[0],
|
|
3879
4023
|
style: {
|
|
3880
4024
|
width: ComboboxCellWidth
|
|
3881
|
-
}
|
|
3882
|
-
|
|
3883
|
-
|
|
4025
|
+
},
|
|
4026
|
+
key: rowId
|
|
4027
|
+
})), modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex.map(function(item, i, arr) {
|
|
4028
|
+
var _modSlotParams_modSlotIndex, _modSlotParams_modSlotIndex1;
|
|
3884
4029
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3885
4030
|
className: "ModMatrixBodyCell",
|
|
3886
4031
|
flexDirection: Box.flexDirection.column,
|
|
3887
4032
|
style: {
|
|
3888
4033
|
color: targetColors[i + 1]
|
|
3889
|
-
}
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
modifier:
|
|
4034
|
+
},
|
|
4035
|
+
key: item
|
|
4036
|
+
}, i !== arr.length - 1 ? /*#__PURE__*/ React__default.createElement(ModMatrixCell, {
|
|
4037
|
+
modifier: modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex[i],
|
|
4038
|
+
color: targetColors[i + 1]
|
|
4039
|
+
}) : /*#__PURE__*/ React__default.createElement(ModMatrixToggleCell, {
|
|
4040
|
+
modifier: modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex1 = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex1 === void 0 ? void 0 : _modSlotParams_modSlotIndex1[i],
|
|
3893
4041
|
color: targetColors[i + 1]
|
|
3894
4042
|
}));
|
|
3895
4043
|
}));
|
|
@@ -4101,77 +4249,105 @@ function _ts_generator$1(thisArg, body) {
|
|
|
4101
4249
|
};
|
|
4102
4250
|
}
|
|
4103
4251
|
}
|
|
4104
|
-
|
|
4252
|
+
//
|
|
4253
|
+
function ModMatrix(param) {
|
|
4105
4254
|
var className = param.className, style = param.style;
|
|
4106
|
-
var
|
|
4107
|
-
var
|
|
4108
|
-
var
|
|
4109
|
-
var
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4255
|
+
var _Object_keys, _Object_keys1, _Object_keys2;
|
|
4256
|
+
var _useState = _sliced_to_array$1(useState(), 2), previewRowIsActive = _useState[0], setPreviewRowIsActive = _useState[1];
|
|
4257
|
+
var getAutomatableParamsListFunc = Juce.getNativeFunction('getAutomatableParamsList');
|
|
4258
|
+
var getAllModSlotsFunc = Juce.getNativeFunction('getAllModSlots');
|
|
4259
|
+
var getModSlotParamsFunc = Juce.getNativeFunction('getModSlotParams');
|
|
4260
|
+
var _useGlobalContext = useGlobalContext(), automatableParamsListReceived = _useGlobalContext.automatableParamsListReceived, automatableParamLabelsReceived = _useGlobalContext.automatableParamLabelsReceived, modSlotsReceived = _useGlobalContext.modSlotsReceived, modSlotParamsListReceived = _useGlobalContext.modSlotParamsListReceived, modSlotParamLabelsReceived = _useGlobalContext.modSlotParamLabelsReceived, _useGlobalContext_globalState = _useGlobalContext.globalState, modSlotParamLabels = _useGlobalContext_globalState.modSlotParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
4261
|
+
var getAPVTSParams = function() {
|
|
4262
|
+
return _async_to_generator$1(function() {
|
|
4263
|
+
var automatableParamsList, modSlotsData, modSlotParams, e;
|
|
4264
|
+
return _ts_generator$1(this, function(_state) {
|
|
4265
|
+
switch(_state.label){
|
|
4266
|
+
case 0:
|
|
4267
|
+
_state.trys.push([
|
|
4268
|
+
0,
|
|
4269
|
+
4,
|
|
4270
|
+
,
|
|
4271
|
+
5
|
|
4272
|
+
]);
|
|
4273
|
+
return [
|
|
4274
|
+
4,
|
|
4275
|
+
getAutomatableParamsListFunc()
|
|
4276
|
+
];
|
|
4277
|
+
case 1:
|
|
4278
|
+
automatableParamsList = _state.sent();
|
|
4279
|
+
return [
|
|
4280
|
+
4,
|
|
4281
|
+
getAllModSlotsFunc()
|
|
4282
|
+
];
|
|
4283
|
+
case 2:
|
|
4284
|
+
modSlotsData = _state.sent();
|
|
4285
|
+
return [
|
|
4286
|
+
4,
|
|
4287
|
+
getModSlotParamsFunc()
|
|
4288
|
+
];
|
|
4289
|
+
case 3:
|
|
4290
|
+
modSlotParams = _state.sent();
|
|
4291
|
+
automatableParamsListReceived(automatableParamsList === null || automatableParamsList === void 0 ? void 0 : automatableParamsList[0]);
|
|
4292
|
+
automatableParamLabelsReceived(automatableParamsList === null || automatableParamsList === void 0 ? void 0 : automatableParamsList[1]);
|
|
4293
|
+
modSlotsReceived(modSlotsData || []);
|
|
4294
|
+
modSlotParamsListReceived(modSlotParams === null || modSlotParams === void 0 ? void 0 : modSlotParams[0]);
|
|
4295
|
+
modSlotParamLabelsReceived(modSlotParams === null || modSlotParams === void 0 ? void 0 : modSlotParams[1]);
|
|
4296
|
+
return [
|
|
4297
|
+
3,
|
|
4298
|
+
5
|
|
4299
|
+
];
|
|
4300
|
+
case 4:
|
|
4301
|
+
e = _state.sent();
|
|
4302
|
+
console.log(e);
|
|
4303
|
+
return [
|
|
4304
|
+
3,
|
|
4305
|
+
5
|
|
4306
|
+
];
|
|
4307
|
+
case 5:
|
|
4308
|
+
return [
|
|
4309
|
+
2
|
|
4310
|
+
];
|
|
4311
|
+
}
|
|
4312
|
+
});
|
|
4313
|
+
})();
|
|
4314
|
+
};
|
|
4117
4315
|
useEffect(function() {
|
|
4118
|
-
var getAPVTSParams = function() {
|
|
4119
|
-
return _async_to_generator$1(function() {
|
|
4120
|
-
var params, e;
|
|
4121
|
-
return _ts_generator$1(this, function(_state) {
|
|
4122
|
-
switch(_state.label){
|
|
4123
|
-
case 0:
|
|
4124
|
-
_state.trys.push([
|
|
4125
|
-
0,
|
|
4126
|
-
2,
|
|
4127
|
-
,
|
|
4128
|
-
3
|
|
4129
|
-
]);
|
|
4130
|
-
return [
|
|
4131
|
-
4,
|
|
4132
|
-
getAllAPVTSParamsFunc()
|
|
4133
|
-
];
|
|
4134
|
-
case 1:
|
|
4135
|
-
params = _state.sent();
|
|
4136
|
-
setAutomatableParams(params === null || params === void 0 ? void 0 : params[0]);
|
|
4137
|
-
setAutomatableParamLabels(params === null || params === void 0 ? void 0 : params[1]);
|
|
4138
|
-
setModSlots(params === null || params === void 0 ? void 0 : params[2]);
|
|
4139
|
-
setModSlotParams(params === null || params === void 0 ? void 0 : params[3]);
|
|
4140
|
-
setModSlotParamLabels(params === null || params === void 0 ? void 0 : params[4]);
|
|
4141
|
-
return [
|
|
4142
|
-
3,
|
|
4143
|
-
3
|
|
4144
|
-
];
|
|
4145
|
-
case 2:
|
|
4146
|
-
e = _state.sent();
|
|
4147
|
-
console.log(e);
|
|
4148
|
-
return [
|
|
4149
|
-
3,
|
|
4150
|
-
3
|
|
4151
|
-
];
|
|
4152
|
-
case 3:
|
|
4153
|
-
return [
|
|
4154
|
-
2
|
|
4155
|
-
];
|
|
4156
|
-
}
|
|
4157
|
-
});
|
|
4158
|
-
})();
|
|
4159
|
-
};
|
|
4160
4316
|
getAPVTSParams();
|
|
4161
4317
|
}, [
|
|
4162
4318
|
window
|
|
4163
4319
|
]);
|
|
4164
4320
|
useEffect(function() {
|
|
4321
|
+
var _Object_keys;
|
|
4322
|
+
var assignedModSlots = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(item) {
|
|
4323
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0;
|
|
4324
|
+
});
|
|
4165
4325
|
if (!assignedModSlots.length) {
|
|
4166
|
-
|
|
4167
|
-
setPreviewRowId(globalState === null || globalState === void 0 ? void 0 : (_globalState_modSlots = globalState.modSlots) === null || _globalState_modSlots === void 0 ? void 0 : (_globalState_modSlots_ = _globalState_modSlots[0]) === null || _globalState_modSlots_ === void 0 ? void 0 : _globalState_modSlots_[0]);
|
|
4326
|
+
setPreviewRowIsActive(true);
|
|
4168
4327
|
}
|
|
4169
4328
|
}, [
|
|
4170
|
-
|
|
4329
|
+
modSlots
|
|
4171
4330
|
]);
|
|
4172
4331
|
var headers = [
|
|
4173
4332
|
'Target'
|
|
4174
|
-
].concat(_to_consumable_array(
|
|
4333
|
+
].concat(_to_consumable_array(modSlotParamLabels));
|
|
4334
|
+
// [slot2, slot3] unassigned
|
|
4335
|
+
// [slot1] assigned
|
|
4336
|
+
var assignedModSlots = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(item) {
|
|
4337
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0;
|
|
4338
|
+
});
|
|
4339
|
+
var unassignedModSlots = (_Object_keys1 = Object.keys(modSlots)) === null || _Object_keys1 === void 0 ? void 0 : _Object_keys1.filter(function(item) {
|
|
4340
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) === 0;
|
|
4341
|
+
});
|
|
4342
|
+
var displayedModSlots = (_Object_keys2 = Object.keys(modSlots)) === null || _Object_keys2 === void 0 ? void 0 : _Object_keys2.reduce(function(acc, item) {
|
|
4343
|
+
if ((modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0 || previewRowIsActive && item === (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots[0])) {
|
|
4344
|
+
return _to_consumable_array(acc).concat([
|
|
4345
|
+
item
|
|
4346
|
+
]);
|
|
4347
|
+
} else {
|
|
4348
|
+
return _to_consumable_array(acc);
|
|
4349
|
+
}
|
|
4350
|
+
}, []);
|
|
4175
4351
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4176
4352
|
gap: Box.gap.medium,
|
|
4177
4353
|
padding: [
|
|
@@ -4186,12 +4362,13 @@ function ModuleFooter$1(param) {
|
|
|
4186
4362
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
4187
4363
|
className: "ModMatrixHeader",
|
|
4188
4364
|
gap: Box.gap.medium
|
|
4189
|
-
}, headers.map(function(item, i) {
|
|
4365
|
+
}, headers === null || headers === void 0 ? void 0 : headers.map(function(item, i) {
|
|
4190
4366
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4191
4367
|
style: {
|
|
4192
4368
|
color: targetColors[i],
|
|
4193
4369
|
flex: i === 0 ? "0 0 ".concat(ComboboxCellWidth) : 'initial'
|
|
4194
4370
|
},
|
|
4371
|
+
key: item,
|
|
4195
4372
|
className: "ModMatrixHeaderCell",
|
|
4196
4373
|
padding: [
|
|
4197
4374
|
Box.padding.medium,
|
|
@@ -4202,19 +4379,15 @@ function ModuleFooter$1(param) {
|
|
|
4202
4379
|
className: "ModMatrixBody",
|
|
4203
4380
|
gap: Box.gap.medium,
|
|
4204
4381
|
flexDirection: Box.flexDirection.column
|
|
4205
|
-
}, (
|
|
4382
|
+
}, (displayedModSlots === null || displayedModSlots === void 0 ? void 0 : displayedModSlots.length) ? displayedModSlots === null || displayedModSlots === void 0 ? void 0 : displayedModSlots.map(function(item, i) {
|
|
4206
4383
|
return /*#__PURE__*/ React__default.createElement(ModMatrixRow, {
|
|
4207
4384
|
rowId: item,
|
|
4208
|
-
|
|
4385
|
+
key: item,
|
|
4386
|
+
// rowIndex={i}
|
|
4387
|
+
setIsPreview: setPreviewRowIsActive,
|
|
4388
|
+
isPreview: previewRowIsActive && (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.indexOf(item)) === 0
|
|
4209
4389
|
});
|
|
4210
|
-
}) : null,
|
|
4211
|
-
rowId: previewRowId,
|
|
4212
|
-
rowIndex: 0,
|
|
4213
|
-
// onChange={(item: any) =>
|
|
4214
|
-
// setAssignedRowIds([...assignedRowIds, item])
|
|
4215
|
-
// }
|
|
4216
|
-
isPreview: true
|
|
4217
|
-
}) : ''), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4390
|
+
}) : null), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4218
4391
|
justifyContent: Box.justifyContent.flexStart
|
|
4219
4392
|
}, /*#__PURE__*/ React__default.createElement(IconButton, {
|
|
4220
4393
|
id: "addModMatrixRow",
|
|
@@ -4225,13 +4398,18 @@ function ModuleFooter$1(param) {
|
|
|
4225
4398
|
padding: [
|
|
4226
4399
|
IconButton.padding.small
|
|
4227
4400
|
],
|
|
4401
|
+
disabled: (assignedModSlots === null || assignedModSlots === void 0 ? void 0 : assignedModSlots.length) === 0 || (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.length) === 0,
|
|
4228
4402
|
// color="var(--color-gray-500)"
|
|
4229
4403
|
// backgroundColor="transparent"
|
|
4230
|
-
onClick: function(e) {
|
|
4404
|
+
onClick: function(e) {
|
|
4405
|
+
if ((unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.length) > 0) {
|
|
4406
|
+
setPreviewRowIsActive(true);
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4231
4409
|
})));
|
|
4232
4410
|
}
|
|
4233
4411
|
|
|
4234
|
-
var css_248z = "/* Tab styles */\n/* TODO: Refactor to use utility classes? */\n/* TODO: Clean up */\n\n.ModuleFooter .Tabs-item {\n background: transparent;\n color: var(--color-text);\n font-family: var(--font-leagueSpartan);\n background: var(--color-gray-600);\n flex: 1 0 auto;\n}\n\n.ModuleFooter .Tabs-item:hover,\n.ModuleFooter .tabs-item:focus,\n.ModuleFooter .tabs-item:focus-visible {\n background: var(--color-gray-700);\n}\n\n.ModuleFooter .Tabs-item[data-headlessui-state='selected'] {\n background: var(--color-gray-700);\n}\n";
|
|
4412
|
+
var css_248z = "/* Tab styles */\n/* TODO: Refactor to use utility classes? */\n/* TODO: Clean up */\n\n.ModuleFooter {\n overflow-y: scroll;\n}\n\n.ModuleFooter .Tabs-item {\n background: transparent;\n color: var(--color-text);\n font-family: var(--font-leagueSpartan);\n background: var(--color-gray-600);\n flex: 1 0 auto;\n}\n\n.ModuleFooter .Tabs-item:hover,\n.ModuleFooter .tabs-item:focus,\n.ModuleFooter .tabs-item:focus-visible {\n background: var(--color-gray-700);\n}\n\n.ModuleFooter .Tabs-item[data-headlessui-state='selected'] {\n background: var(--color-gray-700);\n}\n";
|
|
4235
4413
|
styleInject(css_248z);
|
|
4236
4414
|
|
|
4237
4415
|
function _array_like_to_array(arr, len) {
|
|
@@ -4437,7 +4615,7 @@ var FooterTabs = /*#__PURE__*/ function(FooterTabs) {
|
|
|
4437
4615
|
return FooterTabs;
|
|
4438
4616
|
}({});
|
|
4439
4617
|
var ModMatrixTab = function() {
|
|
4440
|
-
return /*#__PURE__*/ React__default.createElement(
|
|
4618
|
+
return /*#__PURE__*/ React__default.createElement(ModMatrix, null);
|
|
4441
4619
|
};
|
|
4442
4620
|
var InputModTab = function() {
|
|
4443
4621
|
return /*#__PURE__*/ React__default.createElement(Box, null, "InputModTab");
|