@antimatter-audio/antimatter-ui 10.2.0 → 10.4.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/ModMatrixCell.d.ts +1 -3
- package/dist/advanced/ModMatrix/ModMatrixCell.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/advanced/ModuleFooter/LFOTab.d.ts +4 -0
- package/dist/advanced/ModuleFooter/LFOTab.d.ts.map +1 -0
- 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 +1197 -888
- 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/advanced/ModuleFooter/LFOTab.d.ts +4 -0
- package/dist/src/advanced/ModuleFooter/LFOTab.d.ts.map +1 -0
- package/dist/src/advanced/ModuleFooter/ModuleFooter.d.ts +0 -1
- package/dist/src/advanced/ModuleFooter/ModuleFooter.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/Box/Box.d.ts +1 -0
- package/dist/src/core/Box/Box.d.ts.map +1 -1
- package/dist/src/core/Dropdown/Dropdown.d.ts +4 -2
- package/dist/src/core/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/core/Slider/RotarySlider.d.ts +2 -1
- package/dist/src/core/Slider/RotarySlider.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/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';
|
|
@@ -33,7 +33,7 @@ function styleInject(css, ref) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var css_248z$b = "@import 'tailwindcss';\n@import 'tailwindcss/base';\n@import 'tailwindcss/utilities';\n\n@theme static {\n --color-brand: #bb68d9;\n --color-alert: #8a0101;\n --color-text: #bab6cf;\n --color-gray-100: #c7c3de;\n --color-gray-200: #9a96ab;\n --color-gray-300: #838091;\n --color-gray-400: #595763;\n --color-gray-500: #4c4a54;\n --color-gray-600: #2e2c33;\n --color-gray-700: #1e1d21;\n --color-gray-800: #101012;\n --color-gray-900: #09090a;\n\n --color-VFDBlue-100: #0d3814;\n --color-VFDBlue-200: #234e4a;\n --color-VFDBlue-300: #128073;\n --color-VFDBlue-400: #138c6e;\n --color-VFDBlue-500: #1abe95;\n --color-VFDBlue-600: #23d8a4;\n --color-VFDBlue-700: #4aeea4;\n --color-VFDBlue-1000: #35edb4;\n --spacing-none: 0px;\n --spacing-xs: 2px;\n --spacing-sm: 4px;\n --spacing-ms: 6px;\n --spacing-md: 8px;\n --spacing-ml: 12px;\n --spacing-lg: 16px;\n --spacing-xl: 20px;\n --m-none: 0px;\n --m-xs: 2px;\n --m-sm: 4px;\n --m-ms: 6px;\n --m-md: 8px;\n --m-ml: 12px;\n --m-lg: 16px;\n --m-xl: 20px;\n --mt-none: 0px;\n --mt-xs: 2px;\n --mt-sm: 4px;\n --mt-ms: 6px;\n --mt-md: 8px;\n --mt-ml: 12px;\n --mt-lg: 16px;\n --mt-xl: 20px;\n --mr-none: 0px;\n --mr-xs: 2px;\n --mr-sm: 4px;\n --mr-ms: 6px;\n --mr-md: 8px;\n --mr-ml: 12px;\n --mr-lg: 16px;\n --mr-xl: 20px;\n --mb-none: 0px;\n --mb-xs: 2px;\n --mb-sm: 4px;\n --mb-ms: 6px;\n --mb-md: 8px;\n --mb-ml: 12px;\n --mb-lg: 16px;\n --mb-xl: 20px;\n --ml-none: 0px;\n --ml-xs: 2px;\n --ml-sm: 4px;\n --ml-ms: 6px;\n --ml-md: 8px;\n --ml-ml: 12px;\n --ml-lg: 16px;\n --ml-xl: 20px;\n --p-none: 0px;\n --p-xs: 2px;\n --p-sm: 4px;\n --p-ms: 6px;\n --p-md: 8px;\n --p-ml: 12px;\n --p-lg: 16px;\n --p-xl: 20px;\n --pt-none: 0px;\n --pt-xs: 2px;\n --pt-sm: 4px;\n --pt-ms: 6px;\n --pt-md: 8px;\n --pt-ml: 12px;\n --pt-lg: 16px;\n --pt-xl: 20px;\n --pr-none: 0px;\n --pr-xs: 2px;\n --pr-sm: 4px;\n --pr-ms: 6px;\n --pr-md: 8px;\n --pr-ml: 12px;\n --pr-lg: 16px;\n --pr-xl: 20px;\n --pb-none: 0px;\n --pb-xs: 2px;\n --pb-sm: 4px;\n --pb-ms: 6px;\n --pb-md: 8px;\n --pb-ml: 12px;\n --pb-lg: 16px;\n --pb-xl: 20px;\n --pl-none: 0px;\n --pl-xs: 2px;\n --pl-sm: 4px;\n --pl-ms: 6px;\n --pl-md: 8px;\n --pl-ml: 12px;\n --pl-lg: 16px;\n --pl-xl: 20px;\n --bg-page: #1e1d21;\n --bg-section: #1e1d21;\n --bg-popover: #09090a;\n --bg-highlighted: #838091;\n --bg-muted: #595763;\n --bg-selected: #2e2c33;\n --bg-input: #1e1d21;\n --font-leagueSpartan: 'LeagueSpartan';\n --text-xs: 0.625rem;\n --text-sm: 0.75rem;\n --text-ms: 0.813rem;\n --text-md: 0.875rem;\n --text-lg: 1rem;\n --text-xl: 1.25rem;\n --text-title: 1.75rem;\n --gap-none: 0px;\n --gap-xs: 2px;\n --gap-sm: 4px;\n --gap-ms: 6px;\n --gap-md: 8px;\n --gap-ml: 12px;\n --gap-lg: 16px;\n --gap-xl: 20px;\n}\n\ninput,\ninput:hover,\ninput:focus,\ninput:focus-visible {\n background: transparent;\n border: none;\n outline: none;\n appearance: textfield;\n}\n\nbutton,\nbutton:hover,\nbutton:focus,\nbutton:focus-visible {\n
|
|
36
|
+
var css_248z$b = "@import 'tailwindcss';\n@import 'tailwindcss/base';\n@import 'tailwindcss/utilities';\n\n@theme static {\n --color-brand: #bb68d9;\n --color-alert: #8a0101;\n --color-text: #bab6cf;\n --color-gray-100: #c7c3de;\n --color-gray-200: #9a96ab;\n --color-gray-300: #838091;\n --color-gray-400: #595763;\n --color-gray-500: #4c4a54;\n --color-gray-600: #2e2c33;\n --color-gray-700: #1e1d21;\n --color-gray-800: #101012;\n --color-gray-900: #09090a;\n\n --color-VFDBlue-100: #0d3814;\n --color-VFDBlue-200: #234e4a;\n --color-VFDBlue-300: #128073;\n --color-VFDBlue-400: #138c6e;\n --color-VFDBlue-500: #1abe95;\n --color-VFDBlue-600: #23d8a4;\n --color-VFDBlue-700: #4aeea4;\n --color-VFDBlue-1000: #35edb4;\n --spacing-none: 0px;\n --spacing-xs: 2px;\n --spacing-sm: 4px;\n --spacing-ms: 6px;\n --spacing-md: 8px;\n --spacing-ml: 12px;\n --spacing-lg: 16px;\n --spacing-xl: 20px;\n --m-none: 0px;\n --m-xs: 2px;\n --m-sm: 4px;\n --m-ms: 6px;\n --m-md: 8px;\n --m-ml: 12px;\n --m-lg: 16px;\n --m-xl: 20px;\n --mt-none: 0px;\n --mt-xs: 2px;\n --mt-sm: 4px;\n --mt-ms: 6px;\n --mt-md: 8px;\n --mt-ml: 12px;\n --mt-lg: 16px;\n --mt-xl: 20px;\n --mr-none: 0px;\n --mr-xs: 2px;\n --mr-sm: 4px;\n --mr-ms: 6px;\n --mr-md: 8px;\n --mr-ml: 12px;\n --mr-lg: 16px;\n --mr-xl: 20px;\n --mb-none: 0px;\n --mb-xs: 2px;\n --mb-sm: 4px;\n --mb-ms: 6px;\n --mb-md: 8px;\n --mb-ml: 12px;\n --mb-lg: 16px;\n --mb-xl: 20px;\n --ml-none: 0px;\n --ml-xs: 2px;\n --ml-sm: 4px;\n --ml-ms: 6px;\n --ml-md: 8px;\n --ml-ml: 12px;\n --ml-lg: 16px;\n --ml-xl: 20px;\n --p-none: 0px;\n --p-xs: 2px;\n --p-sm: 4px;\n --p-ms: 6px;\n --p-md: 8px;\n --p-ml: 12px;\n --p-lg: 16px;\n --p-xl: 20px;\n --pt-none: 0px;\n --pt-xs: 2px;\n --pt-sm: 4px;\n --pt-ms: 6px;\n --pt-md: 8px;\n --pt-ml: 12px;\n --pt-lg: 16px;\n --pt-xl: 20px;\n --pr-none: 0px;\n --pr-xs: 2px;\n --pr-sm: 4px;\n --pr-ms: 6px;\n --pr-md: 8px;\n --pr-ml: 12px;\n --pr-lg: 16px;\n --pr-xl: 20px;\n --pb-none: 0px;\n --pb-xs: 2px;\n --pb-sm: 4px;\n --pb-ms: 6px;\n --pb-md: 8px;\n --pb-ml: 12px;\n --pb-lg: 16px;\n --pb-xl: 20px;\n --pl-none: 0px;\n --pl-xs: 2px;\n --pl-sm: 4px;\n --pl-ms: 6px;\n --pl-md: 8px;\n --pl-ml: 12px;\n --pl-lg: 16px;\n --pl-xl: 20px;\n --bg-page: #1e1d21;\n --bg-section: #1e1d21;\n --bg-popover: #09090a;\n --bg-highlighted: #838091;\n --bg-muted: #595763;\n --bg-selected: #2e2c33;\n --bg-input: #1e1d21;\n --font-leagueSpartan: 'LeagueSpartan';\n --text-xs: 0.625rem;\n --text-sm: 0.75rem;\n --text-ms: 0.813rem;\n --text-md: 0.875rem;\n --text-lg: 1rem;\n --text-xl: 1.25rem;\n --text-title: 1.75rem;\n --gap-none: 0px;\n --gap-xs: 2px;\n --gap-sm: 4px;\n --gap-ms: 6px;\n --gap-md: 8px;\n --gap-ml: 12px;\n --gap-lg: 16px;\n --gap-xl: 20px;\n}\n\ninput,\ninput:hover,\ninput:focus,\ninput:focus-visible {\n background: transparent;\n border: none;\n outline: none;\n appearance: textfield;\n}\n\nbutton,\nbutton:hover,\nbutton:focus,\nbutton:focus-visible {\n outline: none;\n}\n\nbutton:disabled,\ninput:disabled {\n cursor: not-allowed;\n}\n\ndiv:focus,\ndiv:focus-visible {\n outline: none;\n appearance: textfield;\n}\n\n@font-face {\n font-family: LeagueSpartan;\n /* ascent-override: 70%; */\n src: url('./common/assets/fonts/LeagueSpartan-Regular.ttf');\n}\n\n@font-face {\n font-family: LeagueSpartan;\n /* ascent-override: 70%; */\n src: url('./common/assets/fonts/LeagueSpartan-Thin.ttf');\n font-weight: lighter;\n}\n";
|
|
37
37
|
styleInject(css_248z$b);
|
|
38
38
|
|
|
39
39
|
var Spacing = /*#__PURE__*/ function(Spacing) {
|
|
@@ -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$k(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$k(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$k(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$k({
|
|
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], ")"),
|
|
@@ -365,7 +365,7 @@ Button.margin = Spacing;
|
|
|
365
365
|
Button.type = ButtonType;
|
|
366
366
|
Button.size = ButtonSize;
|
|
367
367
|
|
|
368
|
-
var css_248z$8 = ".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
|
|
368
|
+
var css_248z$8 = ".Dropdown-button {\n font-size: var(--text-sm);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--spacing-lg);\n cursor: pointer;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-transform: uppercase;\n text-align: center;\n border-radius: var(--radius-sm);\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n height: var(--spacing-xl);\n background: var(--color-gray-800);\n color: var(--color-text);\n &:hover,\n &:focus,\n &:active {\n outline: none;\n background-color: var(--bg-highlighted);\n }\n &:disabled {\n cursor: not-allowed;\n }\n}\n\n.Dropdown-items {\n border: 2px solid;\n}\n\n.Dropdown-item {\n background-color: var(--bg-page);\n font-size: var(--text-sm);\n padding: var(--spacing-md) var(--spacing-xl);\n min-width: 100px;\n color: var(--color-text);\n cursor: pointer;\n text-align: center;\n text-transform: uppercase;\n font-weight: bold;\n}\n\n.Dropdown-item[data-selected] {\n background-color: var(--bg-popover);\n color: var(--color-text);\n}\n\n.Dropdown-item[data-active] {\n background-color: var(--bg-popover);\n color: var(--color-text);\n}\n";
|
|
369
369
|
styleInject(css_248z$8);
|
|
370
370
|
|
|
371
371
|
function useObservable(param) {
|
|
@@ -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$j(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$j(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$j(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$j({}, 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$j({}, 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$j({}, 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$j({}, 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$j({}, 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$j({}, acc), _define_property$j({}, 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$j({}, state), {
|
|
546
|
+
modSlots: _object_spread_props$3(_object_spread$j({}, state === null || state === void 0 ? void 0 : state.modSlots), _define_property$j({}, (_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$j({}, 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$j({}, 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) {
|
|
596
604
|
dispatch({
|
|
597
|
-
type: '
|
|
605
|
+
type: 'MOD_SLOT_UPDATED',
|
|
606
|
+
payload: modSlot
|
|
607
|
+
});
|
|
608
|
+
}, []);
|
|
609
|
+
var modSlotParamsListReceived = useCallback(function(modSlotParams) {
|
|
610
|
+
dispatch({
|
|
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,11 +688,11 @@ 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);
|
|
680
|
-
var _useState = _sliced_to_array$a(useState(comboBoxState.getChoiceIndex()), 2),
|
|
695
|
+
var _useState = _sliced_to_array$a(useState(comboBoxState.getChoiceIndex()), 2), index = _useState[0], setIndex = _useState[1];
|
|
681
696
|
var _useState1 = _sliced_to_array$a(useState(comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
682
697
|
var setHighlightedItem = useGlobalContext().setHighlightedItem;
|
|
683
698
|
var choices = items.length ? items : (properties === null || properties === void 0 ? void 0 : (_properties_choices = properties.choices) === null || _properties_choices === void 0 ? void 0 : _properties_choices.length) ? properties === null || properties === void 0 ? void 0 : properties.choices : [];
|
|
@@ -687,32 +702,32 @@ var useCombobox = function(param) {
|
|
|
687
702
|
}) : choices;
|
|
688
703
|
var prevIndex = useRef(null);
|
|
689
704
|
var handleChange = function(value) {
|
|
690
|
-
var
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
onChange && onChange(index);
|
|
705
|
+
var choiceIndex = choices.indexOf(value);
|
|
706
|
+
if (choiceIndex !== prevIndex.current) {
|
|
707
|
+
comboBoxState.setChoiceIndex(choiceIndex);
|
|
708
|
+
setIndex(choiceIndex);
|
|
709
|
+
onChange && onChange(choiceIndex);
|
|
696
710
|
// //@ts-expect-error
|
|
697
711
|
// window.__JUCE__.backend.emitEvent('undoableActionOccurred', {});
|
|
698
712
|
if (displayValInHeader) {
|
|
699
|
-
setHighlightedItem({
|
|
713
|
+
setHighlightedItem && setHighlightedItem({
|
|
700
714
|
label: label,
|
|
701
|
-
value:
|
|
715
|
+
value: value
|
|
702
716
|
});
|
|
703
717
|
}
|
|
704
|
-
prevIndex.current =
|
|
718
|
+
prevIndex.current = choiceIndex;
|
|
705
719
|
}
|
|
720
|
+
return choices[choiceIndex];
|
|
706
721
|
};
|
|
707
722
|
useEffect(function() {
|
|
708
723
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
709
|
-
|
|
724
|
+
setIndex(comboBoxState.getChoiceIndex());
|
|
710
725
|
}, [
|
|
711
726
|
id
|
|
712
727
|
]);
|
|
713
728
|
useEffect(function() {
|
|
714
729
|
var valueListenerId = comboBoxState.valueChangedEvent.addListener(function() {
|
|
715
|
-
|
|
730
|
+
setIndex(comboBoxState.getChoiceIndex());
|
|
716
731
|
});
|
|
717
732
|
var propertiesListenerId = comboBoxState.propertiesChangedEvent.addListener(function() {
|
|
718
733
|
setProperties(comboBoxState.properties);
|
|
@@ -726,16 +741,16 @@ var useCombobox = function(param) {
|
|
|
726
741
|
]);
|
|
727
742
|
var onMouseEnter = function() {
|
|
728
743
|
if (displayValInHeader) {
|
|
729
|
-
setHighlightedItem({
|
|
744
|
+
setHighlightedItem && (setHighlightedItem === null || setHighlightedItem === void 0 ? void 0 : setHighlightedItem({
|
|
730
745
|
label: label,
|
|
731
|
-
value: choices === null || choices === void 0 ? void 0 : choices[
|
|
732
|
-
});
|
|
746
|
+
value: choices === null || choices === void 0 ? void 0 : choices[index]
|
|
747
|
+
}));
|
|
733
748
|
}
|
|
734
749
|
};
|
|
735
750
|
return {
|
|
736
|
-
value:
|
|
737
|
-
|
|
738
|
-
|
|
751
|
+
value: choices[index],
|
|
752
|
+
index: index,
|
|
753
|
+
setIndex: setIndex,
|
|
739
754
|
choices: choices,
|
|
740
755
|
filteredChoices: filteredChoices,
|
|
741
756
|
onMouseEnter: onMouseEnter,
|
|
@@ -743,127 +758,35 @@ var useCombobox = function(param) {
|
|
|
743
758
|
};
|
|
744
759
|
};
|
|
745
760
|
|
|
746
|
-
function
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
]
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
className: "Dropdown-items z-10"
|
|
774
|
-
}, choices.map(function(item, i) {
|
|
775
|
-
return /*#__PURE__*/ React__default.createElement(ListboxOption, {
|
|
776
|
-
className: classnames('Dropdown-item'),
|
|
777
|
-
key: item,
|
|
778
|
-
value: i
|
|
779
|
-
}, item);
|
|
780
|
-
}))));
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
var validate = function(param) {
|
|
784
|
-
var value = param.value, minLength = param.minLength, maxLength = param.maxLength, min = param.min, max = param.max, _param_type = param.type, type = _param_type === void 0 ? InputTypes.text : _param_type;
|
|
785
|
-
// TODO: Clean up
|
|
786
|
-
var errorMessages = [];
|
|
787
|
-
var isIncomplete = false;
|
|
788
|
-
var length = value.toString().length;
|
|
789
|
-
if (length > maxLength && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength)) === -1) {
|
|
790
|
-
errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.push(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength);
|
|
791
|
-
}
|
|
792
|
-
if (length < minLength) {
|
|
793
|
-
isIncomplete = true;
|
|
794
|
-
}
|
|
795
|
-
if (type === InputTypes.number) {
|
|
796
|
-
if (!(value === '' || /^-?[\d-.]+$/.test(value.toString()))) {
|
|
797
|
-
errorMessages.push(InputErrorStates.invalidCharacter);
|
|
798
|
-
}
|
|
799
|
-
if (typeof value === 'number') {
|
|
800
|
-
if ((value > max || value < min) && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates.valueOutOfRange)) === -1) {
|
|
801
|
-
errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.push(InputErrorStates.valueOutOfRange);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
return {
|
|
806
|
-
errorMessages: errorMessages,
|
|
807
|
-
isIncomplete: isIncomplete,
|
|
808
|
-
isValid: !errorMessages.length && !isIncomplete
|
|
809
|
-
};
|
|
810
|
-
};
|
|
811
|
-
var getBarTransformStyles = function(param) {
|
|
812
|
-
var polarity = param.polarity, orientation = param.orientation, value = param.value;
|
|
813
|
-
if (polarity === Polarity.linear) {
|
|
814
|
-
return orientation === Orientation.horizontal ? {
|
|
815
|
-
width: value ? "100%" : '1px',
|
|
816
|
-
height: '100%',
|
|
817
|
-
transform: value ? "scale(".concat(Math.ceil(value) * 0.01, ", 1)") : 'none',
|
|
818
|
-
transformOrigin: 'center left',
|
|
819
|
-
top: '0',
|
|
820
|
-
bottom: '0',
|
|
821
|
-
left: '0'
|
|
822
|
-
} : {
|
|
823
|
-
width: "100%",
|
|
824
|
-
height: value ? '100%' : '1px',
|
|
825
|
-
transform: "scale(1, ".concat(Math.ceil(value) * 0.01, ")"),
|
|
826
|
-
transformOrigin: 'bottom center',
|
|
827
|
-
top: '0',
|
|
828
|
-
bottom: '0',
|
|
829
|
-
left: '0'
|
|
830
|
-
};
|
|
831
|
-
} else {
|
|
832
|
-
return orientation === Orientation.horizontal ? {
|
|
833
|
-
width: value ? "100%" : '1px',
|
|
834
|
-
height: '100%',
|
|
835
|
-
transform: value ? "scale(".concat(Math.ceil(value) * 0.01 / 2, ", 1)") : 'none',
|
|
836
|
-
transformOrigin: 'left center',
|
|
837
|
-
top: '0',
|
|
838
|
-
bottom: '0',
|
|
839
|
-
left: '50%'
|
|
840
|
-
} : {
|
|
841
|
-
width: "100%",
|
|
842
|
-
height: value ? '100%' : '1px',
|
|
843
|
-
transform: value ? "scale(1, ".concat(Math.ceil(value) * 0.01 / 2, ")") : 'none',
|
|
844
|
-
transformOrigin: 'bottom center',
|
|
845
|
-
bottom: '50%',
|
|
846
|
-
left: '0',
|
|
847
|
-
right: '0'
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
var randomizeValue = function(min, max) {
|
|
852
|
-
return Math.random() * (max - min) + min;
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
var css_248z$7 = ".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";
|
|
856
|
-
styleInject(css_248z$7);
|
|
761
|
+
var JustifyContent = /*#__PURE__*/ function(JustifyContent) {
|
|
762
|
+
JustifyContent["flexStart"] = "flex-start";
|
|
763
|
+
JustifyContent["flexEnd"] = "flex-end";
|
|
764
|
+
JustifyContent["center"] = "center";
|
|
765
|
+
JustifyContent["spaceBetween"] = "space-between";
|
|
766
|
+
JustifyContent["spaceAround"] = "space-around";
|
|
767
|
+
JustifyContent["spaceEvenly"] = "space-evenly";
|
|
768
|
+
return JustifyContent;
|
|
769
|
+
}({});
|
|
770
|
+
var AlignItems = /*#__PURE__*/ function(AlignItems) {
|
|
771
|
+
AlignItems["flexStart"] = "flex-start";
|
|
772
|
+
AlignItems["flexEnd"] = "flex-end";
|
|
773
|
+
AlignItems["center"] = "center";
|
|
774
|
+
AlignItems["stretch"] = "stretch";
|
|
775
|
+
AlignItems["baseline"] = "baseline";
|
|
776
|
+
return AlignItems;
|
|
777
|
+
}({});
|
|
778
|
+
var LayoutTags = /*#__PURE__*/ function(LayoutTags) {
|
|
779
|
+
LayoutTags["header"] = "header";
|
|
780
|
+
LayoutTags["main"] = "main";
|
|
781
|
+
LayoutTags["section"] = "section";
|
|
782
|
+
LayoutTags["div"] = "div";
|
|
783
|
+
LayoutTags["footer"] = "footer";
|
|
784
|
+
LayoutTags["ul"] = "ul";
|
|
785
|
+
LayoutTags["li"] = "li";
|
|
786
|
+
return LayoutTags;
|
|
787
|
+
}({});
|
|
857
788
|
|
|
858
|
-
function
|
|
859
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
860
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
861
|
-
return arr2;
|
|
862
|
-
}
|
|
863
|
-
function _array_with_holes$9(arr) {
|
|
864
|
-
if (Array.isArray(arr)) return arr;
|
|
865
|
-
}
|
|
866
|
-
function _define_property$g(obj, key, value) {
|
|
789
|
+
function _define_property$i(obj, key, value) {
|
|
867
790
|
if (key in obj) {
|
|
868
791
|
Object.defineProperty(obj, key, {
|
|
869
792
|
value: value,
|
|
@@ -876,34 +799,7 @@ function _define_property$g(obj, key, value) {
|
|
|
876
799
|
}
|
|
877
800
|
return obj;
|
|
878
801
|
}
|
|
879
|
-
function
|
|
880
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
881
|
-
if (_i == null) return;
|
|
882
|
-
var _arr = [];
|
|
883
|
-
var _n = true;
|
|
884
|
-
var _d = false;
|
|
885
|
-
var _s, _e;
|
|
886
|
-
try {
|
|
887
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
888
|
-
_arr.push(_s.value);
|
|
889
|
-
if (i && _arr.length === i) break;
|
|
890
|
-
}
|
|
891
|
-
} catch (err) {
|
|
892
|
-
_d = true;
|
|
893
|
-
_e = err;
|
|
894
|
-
} finally{
|
|
895
|
-
try {
|
|
896
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
897
|
-
} finally{
|
|
898
|
-
if (_d) throw _e;
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
return _arr;
|
|
902
|
-
}
|
|
903
|
-
function _non_iterable_rest$9() {
|
|
904
|
-
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
|
-
}
|
|
906
|
-
function _object_spread$g(target) {
|
|
802
|
+
function _object_spread$i(target) {
|
|
907
803
|
for(var i = 1; i < arguments.length; i++){
|
|
908
804
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
909
805
|
var ownKeys = Object.keys(source);
|
|
@@ -913,60 +809,442 @@ function _object_spread$g(target) {
|
|
|
913
809
|
}));
|
|
914
810
|
}
|
|
915
811
|
ownKeys.forEach(function(key) {
|
|
916
|
-
_define_property$
|
|
812
|
+
_define_property$i(target, key, source[key]);
|
|
917
813
|
});
|
|
918
814
|
}
|
|
919
815
|
return target;
|
|
920
816
|
}
|
|
921
|
-
function
|
|
922
|
-
|
|
817
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
818
|
+
var keys = Object.keys(object);
|
|
819
|
+
if (Object.getOwnPropertySymbols) {
|
|
820
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
821
|
+
keys.push.apply(keys, symbols);
|
|
822
|
+
}
|
|
823
|
+
return keys;
|
|
923
824
|
}
|
|
924
|
-
function
|
|
925
|
-
|
|
926
|
-
if (
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
825
|
+
function _object_spread_props$2(target, source) {
|
|
826
|
+
source = source != null ? source : {};
|
|
827
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
828
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
829
|
+
} else {
|
|
830
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
831
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
return target;
|
|
931
835
|
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
var
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
var _useState1 = _sliced_to_array$9(useState(false), 2), hasError = _useState1[0], setHasError = _useState1[1];
|
|
944
|
-
var _useState2 = _sliced_to_array$9(useState(false), 2), hasIncompleteValue = _useState2[0], setHasIncompleteValue = _useState2[1];
|
|
945
|
-
var valueRef = useRef(null);
|
|
946
|
-
var timer, timeoutVal = 2000;
|
|
947
|
-
// (inputValue === '' || /^-?\d+$/.test(inputValue)
|
|
948
|
-
function handleKeyPress(e) {
|
|
949
|
-
window.clearTimeout(timer);
|
|
950
|
-
var key = e.keyCode || e.which;
|
|
951
|
-
if (key === 13 || key === 9) {
|
|
952
|
-
var newValue = e.target.value;
|
|
953
|
-
var _validate = validate({
|
|
954
|
-
value: newValue,
|
|
955
|
-
type: type,
|
|
956
|
-
minLength: minLength,
|
|
957
|
-
maxLength: maxLength,
|
|
958
|
-
min: min,
|
|
959
|
-
max: max
|
|
960
|
-
}), errorMessages = _validate.errorMessages, isIncomplete = _validate.isIncomplete;
|
|
961
|
-
if (errorMessages.length === 0 && !isIncomplete) {
|
|
962
|
-
setHasIncompleteValue(false);
|
|
963
|
-
setHasError(false);
|
|
964
|
-
}
|
|
836
|
+
function _object_without_properties(source, excluded) {
|
|
837
|
+
if (source == null) return {};
|
|
838
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
839
|
+
var key, i;
|
|
840
|
+
if (Object.getOwnPropertySymbols) {
|
|
841
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
842
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
843
|
+
key = sourceSymbolKeys[i];
|
|
844
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
845
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
846
|
+
target[key] = source[key];
|
|
965
847
|
}
|
|
966
848
|
}
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
849
|
+
return target;
|
|
850
|
+
}
|
|
851
|
+
function _object_without_properties_loose(source, excluded) {
|
|
852
|
+
if (source == null) return {};
|
|
853
|
+
var target = {};
|
|
854
|
+
var sourceKeys = Object.keys(source);
|
|
855
|
+
var key, i;
|
|
856
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
857
|
+
key = sourceKeys[i];
|
|
858
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
859
|
+
target[key] = source[key];
|
|
860
|
+
}
|
|
861
|
+
return target;
|
|
862
|
+
}
|
|
863
|
+
var BoxDisplay = /*#__PURE__*/ function(BoxDisplay) {
|
|
864
|
+
BoxDisplay["flex"] = "flex";
|
|
865
|
+
BoxDisplay["block"] = "block";
|
|
866
|
+
return BoxDisplay;
|
|
867
|
+
}(BoxDisplay || {});
|
|
868
|
+
function Box(_param) {
|
|
869
|
+
var className = _param.className, style = _param.style, children = _param.children, flex = _param.flex, key = _param.key, onClick = _param.onClick, _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 ? [
|
|
870
|
+
Spacing.none,
|
|
871
|
+
Spacing.none,
|
|
872
|
+
Spacing.none,
|
|
873
|
+
Spacing.none
|
|
874
|
+
] : _param_padding, _param_gap = _param.gap, gap = _param_gap === void 0 ? Spacing.xSmall : _param_gap, _param_tag = _param.tag, tag = _param_tag === void 0 ? LayoutTags.div : _param_tag, rest = _object_without_properties(_param, [
|
|
875
|
+
"className",
|
|
876
|
+
"style",
|
|
877
|
+
"children",
|
|
878
|
+
"flex",
|
|
879
|
+
"key",
|
|
880
|
+
"onClick",
|
|
881
|
+
"alignItems",
|
|
882
|
+
"justifyContent",
|
|
883
|
+
"display",
|
|
884
|
+
"width",
|
|
885
|
+
"flexWrap",
|
|
886
|
+
"height",
|
|
887
|
+
"border",
|
|
888
|
+
"flexDirection",
|
|
889
|
+
"padding",
|
|
890
|
+
"gap",
|
|
891
|
+
"tag"
|
|
892
|
+
]);
|
|
893
|
+
var Tag = tag;
|
|
894
|
+
var _padding_, _padding_1, _padding_2, _ref;
|
|
895
|
+
return /*#__PURE__*/ React__default.createElement(Tag, _object_spread_props$2(_object_spread$i({
|
|
896
|
+
// id="globalValues"
|
|
897
|
+
key: key,
|
|
898
|
+
className: className,
|
|
899
|
+
onClick: onClick
|
|
900
|
+
}, rest), {
|
|
901
|
+
style: _object_spread$i({
|
|
902
|
+
flexWrap: flexWrap,
|
|
903
|
+
display: display,
|
|
904
|
+
gap: "var(--gap-".concat(gap, ")"),
|
|
905
|
+
width: '100%',
|
|
906
|
+
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
907
|
+
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
908
|
+
paddingBottom: "var(--p-".concat((_padding_1 = padding[2]) !== null && _padding_1 !== void 0 ? _padding_1 : padding[0], ")"),
|
|
909
|
+
paddingLeft: "var(--p-".concat((_ref = (_padding_2 = padding[3]) !== null && _padding_2 !== void 0 ? _padding_2 : padding[1]) !== null && _ref !== void 0 ? _ref : padding[0], ")"),
|
|
910
|
+
border: border ? '2px solid #999' : '',
|
|
911
|
+
maxWidth: width,
|
|
912
|
+
height: height,
|
|
913
|
+
flexDirection: flexDirection === FlexDirection.row ? FlexDirection.row : FlexDirection.column,
|
|
914
|
+
justifyContent: "".concat(justifyContent),
|
|
915
|
+
alignItems: "".concat(alignItems),
|
|
916
|
+
flex: flex ? flex : ''
|
|
917
|
+
}, style)
|
|
918
|
+
}), children);
|
|
919
|
+
}
|
|
920
|
+
// Object.assign(Layout, width, height, ALIGN, JUSTIFY, DIRECTION, SPACING);
|
|
921
|
+
Box.display = BoxDisplay;
|
|
922
|
+
Box.alignItems = AlignItems;
|
|
923
|
+
Box.justifyContent = JustifyContent;
|
|
924
|
+
Box.gap = Spacing;
|
|
925
|
+
Box.flexDirection = FlexDirection;
|
|
926
|
+
Box.width = Width;
|
|
927
|
+
Box.height = Height;
|
|
928
|
+
Box.padding = Spacing;
|
|
929
|
+
Box.flexWrap = FlexWrap;
|
|
930
|
+
Box.tag = LayoutTags;
|
|
931
|
+
|
|
932
|
+
function _define_property$h(obj, key, value) {
|
|
933
|
+
if (key in obj) {
|
|
934
|
+
Object.defineProperty(obj, key, {
|
|
935
|
+
value: value,
|
|
936
|
+
enumerable: true,
|
|
937
|
+
configurable: true,
|
|
938
|
+
writable: true
|
|
939
|
+
});
|
|
940
|
+
} else {
|
|
941
|
+
obj[key] = value;
|
|
942
|
+
}
|
|
943
|
+
return obj;
|
|
944
|
+
}
|
|
945
|
+
function _object_spread$h(target) {
|
|
946
|
+
for(var i = 1; i < arguments.length; i++){
|
|
947
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
948
|
+
var ownKeys = Object.keys(source);
|
|
949
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
950
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
951
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
952
|
+
}));
|
|
953
|
+
}
|
|
954
|
+
ownKeys.forEach(function(key) {
|
|
955
|
+
_define_property$h(target, key, source[key]);
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
return target;
|
|
959
|
+
}
|
|
960
|
+
function Label(param) {
|
|
961
|
+
var value = param.value, id = param.id, className = param.className, style = param.style, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
962
|
+
Spacing.none
|
|
963
|
+
] : _param_padding, children = param.children, htmlFor = param.htmlFor, _param_fontSize = param.fontSize, fontSize = _param_fontSize === void 0 ? FontSizes.medium : _param_fontSize;
|
|
964
|
+
var _padding_, _padding_1, _padding_2, _ref;
|
|
965
|
+
return /*#__PURE__*/ React.createElement("label", {
|
|
966
|
+
id: id,
|
|
967
|
+
htmlFor: htmlFor,
|
|
968
|
+
style: _object_spread$h({
|
|
969
|
+
fontSize: "var(--text-".concat(fontSize),
|
|
970
|
+
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
971
|
+
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
972
|
+
paddingBottom: "var(--p-".concat((_padding_1 = padding[2]) !== null && _padding_1 !== void 0 ? _padding_1 : padding[0], ")"),
|
|
973
|
+
paddingLeft: "var(--p-".concat((_ref = (_padding_2 = padding[3]) !== null && _padding_2 !== void 0 ? _padding_2 : padding[1]) !== null && _ref !== void 0 ? _ref : padding[0], ")"),
|
|
974
|
+
WebkitUserSelect: 'none',
|
|
975
|
+
userSelect: 'none'
|
|
976
|
+
}, style),
|
|
977
|
+
className: classnames('Label', 'select-none', className)
|
|
978
|
+
}, value ? value : children);
|
|
979
|
+
}
|
|
980
|
+
Label.padding = Spacing;
|
|
981
|
+
Label.fontSize = FontSizes;
|
|
982
|
+
|
|
983
|
+
function _define_property$g(obj, key, value) {
|
|
984
|
+
if (key in obj) {
|
|
985
|
+
Object.defineProperty(obj, key, {
|
|
986
|
+
value: value,
|
|
987
|
+
enumerable: true,
|
|
988
|
+
configurable: true,
|
|
989
|
+
writable: true
|
|
990
|
+
});
|
|
991
|
+
} else {
|
|
992
|
+
obj[key] = value;
|
|
993
|
+
}
|
|
994
|
+
return obj;
|
|
995
|
+
}
|
|
996
|
+
function _object_spread$g(target) {
|
|
997
|
+
for(var i = 1; i < arguments.length; i++){
|
|
998
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
999
|
+
var ownKeys = Object.keys(source);
|
|
1000
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1001
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1002
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1003
|
+
}));
|
|
1004
|
+
}
|
|
1005
|
+
ownKeys.forEach(function(key) {
|
|
1006
|
+
_define_property$g(target, key, source[key]);
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
return target;
|
|
1010
|
+
}
|
|
1011
|
+
function Dropdown(param) {
|
|
1012
|
+
var label = param.label, _param_color = param.color, color = _param_color === void 0 ? 'var(--color-text)' : _param_color, _param_labelColor = param.labelColor, labelColor = _param_labelColor === void 0 ? 'var(--color-text)' : _param_labelColor, className = param.className, onChange = param.onChange, id = param.id, style = param.style;
|
|
1013
|
+
var _useDropdown = useDropdown({
|
|
1014
|
+
id: id,
|
|
1015
|
+
label: label,
|
|
1016
|
+
onChange: onChange
|
|
1017
|
+
}), value = _useDropdown.value, choices = _useDropdown.choices, onMouseEnter = _useDropdown.onMouseEnter, handleChange = _useDropdown.handleChange;
|
|
1018
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1019
|
+
flexDirection: Box.flexDirection.column,
|
|
1020
|
+
onMouseEnter: onMouseEnter
|
|
1021
|
+
}, /*#__PURE__*/ React__default.createElement(Listbox, {
|
|
1022
|
+
value: value,
|
|
1023
|
+
onChange: handleChange
|
|
1024
|
+
}, /*#__PURE__*/ React__default.createElement(ListboxButton, {
|
|
1025
|
+
className: classnames('Dropdown-button', className),
|
|
1026
|
+
style: _object_spread$g({
|
|
1027
|
+
color: "".concat(color ? color : 'initial')
|
|
1028
|
+
}, style),
|
|
1029
|
+
"aria-label": "Assignee",
|
|
1030
|
+
onChange: function(value) {
|
|
1031
|
+
return console.log(value);
|
|
1032
|
+
}
|
|
1033
|
+
}, value), /*#__PURE__*/ React__default.createElement(ListboxOptions, {
|
|
1034
|
+
anchor: "bottom",
|
|
1035
|
+
portal: false,
|
|
1036
|
+
className: "Dropdown-items z-10",
|
|
1037
|
+
style: {
|
|
1038
|
+
color: "".concat(color ? color : 'initial')
|
|
1039
|
+
}
|
|
1040
|
+
}, choices === null || choices === void 0 ? void 0 : choices.map(function(item, i) {
|
|
1041
|
+
return /*#__PURE__*/ React__default.createElement(ListboxOption, {
|
|
1042
|
+
className: classnames('Dropdown-item'),
|
|
1043
|
+
key: item,
|
|
1044
|
+
value: item,
|
|
1045
|
+
style: {
|
|
1046
|
+
color: "".concat(color ? color : 'initial')
|
|
1047
|
+
}
|
|
1048
|
+
}, item);
|
|
1049
|
+
}))), /*#__PURE__*/ React__default.createElement(Label, {
|
|
1050
|
+
padding: [
|
|
1051
|
+
Label.padding.mediumSmall
|
|
1052
|
+
],
|
|
1053
|
+
fontSize: Label.fontSize.small,
|
|
1054
|
+
value: label,
|
|
1055
|
+
style: {
|
|
1056
|
+
color: "".concat(labelColor ? labelColor : 'initial')
|
|
1057
|
+
}
|
|
1058
|
+
}));
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
var validate = function(param) {
|
|
1062
|
+
var value = param.value, minLength = param.minLength, maxLength = param.maxLength, min = param.min, max = param.max, _param_type = param.type, type = _param_type === void 0 ? InputTypes.text : _param_type;
|
|
1063
|
+
// TODO: Clean up
|
|
1064
|
+
var errorMessages = [];
|
|
1065
|
+
var isIncomplete = false;
|
|
1066
|
+
var length = value.toString().length;
|
|
1067
|
+
if (length > maxLength && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength)) === -1) {
|
|
1068
|
+
errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.push(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength);
|
|
1069
|
+
}
|
|
1070
|
+
if (length < minLength) {
|
|
1071
|
+
isIncomplete = true;
|
|
1072
|
+
}
|
|
1073
|
+
if (type === InputTypes.number) {
|
|
1074
|
+
if (!(value === '' || /^-?[\d-.]+$/.test(value.toString()))) {
|
|
1075
|
+
errorMessages.push(InputErrorStates.invalidCharacter);
|
|
1076
|
+
}
|
|
1077
|
+
if (typeof value === 'number') {
|
|
1078
|
+
if ((value > max || value < min) && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates.valueOutOfRange)) === -1) {
|
|
1079
|
+
errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.push(InputErrorStates.valueOutOfRange);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
return {
|
|
1084
|
+
errorMessages: errorMessages,
|
|
1085
|
+
isIncomplete: isIncomplete,
|
|
1086
|
+
isValid: !errorMessages.length && !isIncomplete
|
|
1087
|
+
};
|
|
1088
|
+
};
|
|
1089
|
+
var getBarTransformStyles = function(param) {
|
|
1090
|
+
var polarity = param.polarity, orientation = param.orientation, value = param.value;
|
|
1091
|
+
if (polarity === Polarity.linear) {
|
|
1092
|
+
return orientation === Orientation.horizontal ? {
|
|
1093
|
+
width: value ? "100%" : '1px',
|
|
1094
|
+
height: '100%',
|
|
1095
|
+
transform: value ? "scale(".concat(Math.ceil(value) * 0.01, ", 1)") : 'none',
|
|
1096
|
+
transformOrigin: 'center left',
|
|
1097
|
+
top: '0',
|
|
1098
|
+
bottom: '0',
|
|
1099
|
+
left: '0'
|
|
1100
|
+
} : {
|
|
1101
|
+
width: "100%",
|
|
1102
|
+
height: value ? '100%' : '1px',
|
|
1103
|
+
transform: "scale(1, ".concat(Math.ceil(value) * 0.01, ")"),
|
|
1104
|
+
transformOrigin: 'bottom center',
|
|
1105
|
+
top: '0',
|
|
1106
|
+
bottom: '0',
|
|
1107
|
+
left: '0'
|
|
1108
|
+
};
|
|
1109
|
+
} else {
|
|
1110
|
+
return orientation === Orientation.horizontal ? {
|
|
1111
|
+
width: value ? "100%" : '1px',
|
|
1112
|
+
height: '100%',
|
|
1113
|
+
transform: value ? "scale(".concat(Math.ceil(value) * 0.01 / 2, ", 1)") : 'none',
|
|
1114
|
+
transformOrigin: 'left center',
|
|
1115
|
+
top: '0',
|
|
1116
|
+
bottom: '0',
|
|
1117
|
+
left: '50%'
|
|
1118
|
+
} : {
|
|
1119
|
+
width: "100%",
|
|
1120
|
+
height: value ? '100%' : '1px',
|
|
1121
|
+
transform: value ? "scale(1, ".concat(Math.ceil(value) * 0.01 / 2, ")") : 'none',
|
|
1122
|
+
transformOrigin: 'bottom center',
|
|
1123
|
+
bottom: '50%',
|
|
1124
|
+
left: '0',
|
|
1125
|
+
right: '0'
|
|
1126
|
+
};
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
var randomizeValue = function(min, max) {
|
|
1130
|
+
return Math.random() * (max - min) + min;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
var css_248z$7 = ".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";
|
|
1134
|
+
styleInject(css_248z$7);
|
|
1135
|
+
|
|
1136
|
+
function _array_like_to_array$9(arr, len) {
|
|
1137
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1138
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1139
|
+
return arr2;
|
|
1140
|
+
}
|
|
1141
|
+
function _array_with_holes$9(arr) {
|
|
1142
|
+
if (Array.isArray(arr)) return arr;
|
|
1143
|
+
}
|
|
1144
|
+
function _define_property$f(obj, key, value) {
|
|
1145
|
+
if (key in obj) {
|
|
1146
|
+
Object.defineProperty(obj, key, {
|
|
1147
|
+
value: value,
|
|
1148
|
+
enumerable: true,
|
|
1149
|
+
configurable: true,
|
|
1150
|
+
writable: true
|
|
1151
|
+
});
|
|
1152
|
+
} else {
|
|
1153
|
+
obj[key] = value;
|
|
1154
|
+
}
|
|
1155
|
+
return obj;
|
|
1156
|
+
}
|
|
1157
|
+
function _iterable_to_array_limit$9(arr, i) {
|
|
1158
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1159
|
+
if (_i == null) return;
|
|
1160
|
+
var _arr = [];
|
|
1161
|
+
var _n = true;
|
|
1162
|
+
var _d = false;
|
|
1163
|
+
var _s, _e;
|
|
1164
|
+
try {
|
|
1165
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
1166
|
+
_arr.push(_s.value);
|
|
1167
|
+
if (i && _arr.length === i) break;
|
|
1168
|
+
}
|
|
1169
|
+
} catch (err) {
|
|
1170
|
+
_d = true;
|
|
1171
|
+
_e = err;
|
|
1172
|
+
} finally{
|
|
1173
|
+
try {
|
|
1174
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
1175
|
+
} finally{
|
|
1176
|
+
if (_d) throw _e;
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
return _arr;
|
|
1180
|
+
}
|
|
1181
|
+
function _non_iterable_rest$9() {
|
|
1182
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1183
|
+
}
|
|
1184
|
+
function _object_spread$f(target) {
|
|
1185
|
+
for(var i = 1; i < arguments.length; i++){
|
|
1186
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
1187
|
+
var ownKeys = Object.keys(source);
|
|
1188
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1189
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1190
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1191
|
+
}));
|
|
1192
|
+
}
|
|
1193
|
+
ownKeys.forEach(function(key) {
|
|
1194
|
+
_define_property$f(target, key, source[key]);
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
return target;
|
|
1198
|
+
}
|
|
1199
|
+
function _sliced_to_array$9(arr, i) {
|
|
1200
|
+
return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$9();
|
|
1201
|
+
}
|
|
1202
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
1203
|
+
if (!o) return;
|
|
1204
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
1205
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1206
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1207
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1208
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
1209
|
+
}
|
|
1210
|
+
// import { decimalToPercent, percentToDecimal } from '../../common/utils';
|
|
1211
|
+
// import debounce from 'lodash.debounce';
|
|
1212
|
+
var InputTypes = /*#__PURE__*/ function(InputTypes) {
|
|
1213
|
+
InputTypes["text"] = "text";
|
|
1214
|
+
InputTypes["number"] = "number";
|
|
1215
|
+
return InputTypes;
|
|
1216
|
+
}({});
|
|
1217
|
+
function Input(param) {
|
|
1218
|
+
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;
|
|
1219
|
+
var _inputRef_current;
|
|
1220
|
+
var _useState = _sliced_to_array$9(useState(value), 2), internalValue = _useState[0], setInternalValue = _useState[1];
|
|
1221
|
+
var _useState1 = _sliced_to_array$9(useState(false), 2), hasError = _useState1[0], setHasError = _useState1[1];
|
|
1222
|
+
var _useState2 = _sliced_to_array$9(useState(false), 2), hasIncompleteValue = _useState2[0], setHasIncompleteValue = _useState2[1];
|
|
1223
|
+
var valueRef = useRef(null);
|
|
1224
|
+
var timer, timeoutVal = 2000;
|
|
1225
|
+
// (inputValue === '' || /^-?\d+$/.test(inputValue)
|
|
1226
|
+
function handleKeyPress(e) {
|
|
1227
|
+
window.clearTimeout(timer);
|
|
1228
|
+
var key = e.keyCode || e.which;
|
|
1229
|
+
if (key === 13 || key === 9) {
|
|
1230
|
+
var newValue = e.target.value;
|
|
1231
|
+
var _validate = validate({
|
|
1232
|
+
value: newValue,
|
|
1233
|
+
type: type,
|
|
1234
|
+
minLength: minLength,
|
|
1235
|
+
maxLength: maxLength,
|
|
1236
|
+
min: min,
|
|
1237
|
+
max: max
|
|
1238
|
+
}), errorMessages = _validate.errorMessages, isIncomplete = _validate.isIncomplete;
|
|
1239
|
+
if (errorMessages.length === 0 && !isIncomplete) {
|
|
1240
|
+
setHasIncompleteValue(false);
|
|
1241
|
+
setHasError(false);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
function handleKeyUp(e) {
|
|
1246
|
+
window.clearTimeout(timer); // prevent errant multiple timeouts from being generated
|
|
1247
|
+
timer = window.setTimeout(function() {
|
|
970
1248
|
var newValue = e.target.value;
|
|
971
1249
|
if ((valueRef === null || valueRef === void 0 ? void 0 : valueRef.current) !== newValue) {
|
|
972
1250
|
var _validate = validate({
|
|
@@ -1045,7 +1323,7 @@ function Input(param) {
|
|
|
1045
1323
|
id: id,
|
|
1046
1324
|
ref: inputRef,
|
|
1047
1325
|
className: classnames('TextInput', hasIncompleteValue || hasError ? 'is-blinking' : '', className),
|
|
1048
|
-
style: _object_spread$
|
|
1326
|
+
style: _object_spread$f({
|
|
1049
1327
|
// TODO
|
|
1050
1328
|
// color: hasError ? 'red' : hasIncompleteValue ? '#999' : textColor
|
|
1051
1329
|
color: hasError ? 'red' : textColor,
|
|
@@ -1184,7 +1462,7 @@ var useSlider = function(param) {
|
|
|
1184
1462
|
var scaledValueRef = useRef(null);
|
|
1185
1463
|
var normalisedValueRef = useRef(null);
|
|
1186
1464
|
// const randomValueSetCounter = useRef<number>(null);
|
|
1187
|
-
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom,
|
|
1465
|
+
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged;
|
|
1188
1466
|
// Set the initial state
|
|
1189
1467
|
//@ts-expect-error
|
|
1190
1468
|
useEffect(function() {
|
|
@@ -1209,410 +1487,191 @@ var useSlider = function(param) {
|
|
|
1209
1487
|
};
|
|
1210
1488
|
} else {
|
|
1211
1489
|
// This sets 'mockProperties' as the value for 'properties' if the app is running in a browser.
|
|
1212
|
-
setProperties(mockProperties);
|
|
1213
|
-
normalisedValueRef.current = mockInitialNormalisedValue;
|
|
1214
|
-
}
|
|
1215
|
-
}, []);
|
|
1216
|
-
// Update the local state when the ID changes
|
|
1217
|
-
useEffect(function() {
|
|
1218
|
-
var sliderState = Juce.getSliderState(id);
|
|
1219
|
-
updateLocalState(sliderState);
|
|
1220
|
-
}, [
|
|
1221
|
-
id
|
|
1222
|
-
]);
|
|
1223
|
-
// Sets up listeners to handle changes on the backend
|
|
1224
|
-
//@ts-expect-error
|
|
1225
|
-
useEffect(function() {
|
|
1226
|
-
if (!isLocalhost) {
|
|
1227
|
-
var sliderState = Juce.getSliderState(id);
|
|
1228
|
-
var valueListenerId = sliderState === null || sliderState === void 0 ? void 0 : sliderState.valueChangedEvent.addListener(function() {
|
|
1229
|
-
updateLocalState(sliderState);
|
|
1230
|
-
});
|
|
1231
|
-
var propertiesListenerId = sliderState === null || sliderState === void 0 ? void 0 : sliderState.propertiesChangedEvent.addListener(function() {
|
|
1232
|
-
return setProperties(sliderState === null || sliderState === void 0 ? void 0 : sliderState.properties);
|
|
1233
|
-
});
|
|
1234
|
-
return function() {
|
|
1235
|
-
sliderState === null || sliderState === void 0 ? void 0 : sliderState.valueChangedEvent.removeListener(valueListenerId);
|
|
1236
|
-
sliderState === null || sliderState === void 0 ? void 0 : sliderState.propertiesChangedEvent.removeListener(propertiesListenerId);
|
|
1237
|
-
};
|
|
1238
|
-
}
|
|
1239
|
-
}, [
|
|
1240
|
-
window
|
|
1241
|
-
]);
|
|
1242
|
-
// Update the local state from JUCE
|
|
1243
|
-
var updateLocalState = function(sliderState) {
|
|
1244
|
-
var normalisedValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
1245
|
-
var scaledValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getScaledValue();
|
|
1246
|
-
var scaledValue = parseFloat(scaledValueFromState.toFixed(2));
|
|
1247
|
-
normalisedValueRef.current = parseFloat(normalisedValueFromState.toFixed(2));
|
|
1248
|
-
setScaledValue(scaledValue);
|
|
1249
|
-
onChange && onChange(parseFloat(scaledValueFromState.toFixed(2)));
|
|
1250
|
-
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1251
|
-
setHighlightedItem({
|
|
1252
|
-
label: label,
|
|
1253
|
-
value: scaledValue
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
};
|
|
1257
|
-
// Update JUCE state
|
|
1258
|
-
var setNormalisedState = function(newValue) {
|
|
1259
|
-
var sliderState = Juce.getSliderState(id);
|
|
1260
|
-
var fixedNewValue = parseFloat(newValue.toFixed(2));
|
|
1261
|
-
if ((normalisedValueRef === null || normalisedValueRef === void 0 ? void 0 : normalisedValueRef.current) !== fixedNewValue) {
|
|
1262
|
-
!isLocalhost && sliderState.setNormalisedValue(clamp(fixedNewValue));
|
|
1263
|
-
normalisedValueRef.current = fixedNewValue;
|
|
1264
|
-
}
|
|
1265
|
-
};
|
|
1266
|
-
var setScaledState = function(newValue) {
|
|
1267
|
-
var sliderState = Juce.getSliderState(id);
|
|
1268
|
-
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== newValue) {
|
|
1269
|
-
!isLocalhost && properties && sliderState.setNormalisedValue(scaledToNormalised({
|
|
1270
|
-
scaledValue: clamp(parseFloat(newValue.toFixed(2)), properties === null || properties === void 0 ? void 0 : properties.start, properties === null || properties === void 0 ? void 0 : properties.end),
|
|
1271
|
-
properties: properties
|
|
1272
|
-
}));
|
|
1273
|
-
scaledValueRef.current = newValue;
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
var bindDrag = useDrag(function(param) {
|
|
1277
|
-
var down = param.down, delta = param.delta, first = param.first, last = param.last;
|
|
1278
|
-
if (first) {
|
|
1279
|
-
//@ts-expect-error
|
|
1280
|
-
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1281
|
-
i: "".concat(0)
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
if (down) {
|
|
1285
|
-
var deltaVal = delta[1] * -1;
|
|
1286
|
-
var _normalisedValueRef_current;
|
|
1287
|
-
var newValue = ((_normalisedValueRef_current = normalisedValueRef.current) !== null && _normalisedValueRef_current !== void 0 ? _normalisedValueRef_current : 0) + deltaVal * // (properties?.interval && properties?.interval.toString().length > 4
|
|
1288
|
-
// ? 4
|
|
1289
|
-
// : 0.4) *
|
|
1290
|
-
((properties === null || properties === void 0 ? void 0 : properties.interval) || 0.01);
|
|
1291
|
-
setNormalisedState(newValue);
|
|
1292
|
-
}
|
|
1293
|
-
if (last) {
|
|
1294
|
-
//@ts-expect-error
|
|
1295
|
-
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1296
|
-
i: "".concat(0)
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
}, {
|
|
1300
|
-
preventDefault: true
|
|
1301
|
-
});
|
|
1302
|
-
var bindBarSliderDrag = function() {
|
|
1303
|
-
var orientation = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Orientation.vertical;
|
|
1304
|
-
var drag = useDrag(function(param) {
|
|
1305
|
-
var down = param.down, event = param.event, first = param.first, last = param.last;
|
|
1306
|
-
var _event_target;
|
|
1307
|
-
var rect = event === null || event === void 0 ? void 0 : (_event_target = event.target) === null || _event_target === void 0 ? void 0 : _event_target.getBoundingClientRect();
|
|
1308
|
-
var y = (event === null || event === void 0 ? void 0 : event.clientY) - rect.top;
|
|
1309
|
-
var x = (event === null || event === void 0 ? void 0 : event.clientX) - rect.left;
|
|
1310
|
-
// 1138 - 1043.1
|
|
1311
|
-
if (first) {
|
|
1312
|
-
//@ts-expect-error
|
|
1313
|
-
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1314
|
-
i: "".concat(0)
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
// START
|
|
1318
|
-
// bottom: 685
|
|
1319
|
-
// height: 40
|
|
1320
|
-
// left: 733.5
|
|
1321
|
-
// right: 884.328125
|
|
1322
|
-
// top: 645
|
|
1323
|
-
// width: 150.828125
|
|
1324
|
-
// x: 733.5
|
|
1325
|
-
// y: 645
|
|
1326
|
-
// clientx 735
|
|
1327
|
-
// 735 - 733.5
|
|
1328
|
-
// END
|
|
1329
|
-
// bottom: 685
|
|
1330
|
-
// height: 40
|
|
1331
|
-
// left: 733.5
|
|
1332
|
-
// right: 884.328125
|
|
1333
|
-
// top: 645
|
|
1334
|
-
// width: 150.828125
|
|
1335
|
-
// x: 733.5
|
|
1336
|
-
// y: 645
|
|
1337
|
-
// clientx: 883
|
|
1338
|
-
if (down) {
|
|
1339
|
-
// TODO: Increments?
|
|
1340
|
-
var newValue;
|
|
1341
|
-
if (orientation === Orientation.vertical) {
|
|
1342
|
-
newValue = 1 - y / rect.height;
|
|
1343
|
-
} else {
|
|
1344
|
-
newValue = x / rect.width;
|
|
1345
|
-
}
|
|
1346
|
-
setNormalisedState(newValue);
|
|
1347
|
-
}
|
|
1348
|
-
if (last) {
|
|
1349
|
-
//@ts-expect-error
|
|
1350
|
-
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1351
|
-
i: "".concat(0)
|
|
1352
|
-
});
|
|
1353
|
-
}
|
|
1354
|
-
}, {
|
|
1355
|
-
preventDefault: true
|
|
1356
|
-
});
|
|
1357
|
-
return drag();
|
|
1358
|
-
};
|
|
1359
|
-
var onMouseEnter = function() {
|
|
1490
|
+
setProperties(mockProperties);
|
|
1491
|
+
normalisedValueRef.current = mockInitialNormalisedValue;
|
|
1492
|
+
}
|
|
1493
|
+
}, []);
|
|
1494
|
+
// Update the local state when the ID changes
|
|
1495
|
+
useEffect(function() {
|
|
1496
|
+
var sliderState = Juce.getSliderState(id);
|
|
1497
|
+
updateLocalState(sliderState);
|
|
1498
|
+
}, [
|
|
1499
|
+
id
|
|
1500
|
+
]);
|
|
1501
|
+
// Sets up listeners to handle changes on the backend
|
|
1502
|
+
//@ts-expect-error
|
|
1503
|
+
useEffect(function() {
|
|
1504
|
+
if (!isLocalhost) {
|
|
1505
|
+
var sliderState = Juce.getSliderState(id);
|
|
1506
|
+
var valueListenerId = sliderState === null || sliderState === void 0 ? void 0 : sliderState.valueChangedEvent.addListener(function() {
|
|
1507
|
+
updateLocalState(sliderState);
|
|
1508
|
+
});
|
|
1509
|
+
var propertiesListenerId = sliderState === null || sliderState === void 0 ? void 0 : sliderState.propertiesChangedEvent.addListener(function() {
|
|
1510
|
+
return setProperties(sliderState === null || sliderState === void 0 ? void 0 : sliderState.properties);
|
|
1511
|
+
});
|
|
1512
|
+
return function() {
|
|
1513
|
+
sliderState === null || sliderState === void 0 ? void 0 : sliderState.valueChangedEvent.removeListener(valueListenerId);
|
|
1514
|
+
sliderState === null || sliderState === void 0 ? void 0 : sliderState.propertiesChangedEvent.removeListener(propertiesListenerId);
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
}, [
|
|
1518
|
+
window
|
|
1519
|
+
]);
|
|
1520
|
+
// Update the local state from JUCE
|
|
1521
|
+
var updateLocalState = function(sliderState) {
|
|
1522
|
+
var normalisedValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
1523
|
+
var scaledValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getScaledValue();
|
|
1524
|
+
var scaledValue = parseFloat(scaledValueFromState.toFixed(2));
|
|
1525
|
+
normalisedValueRef.current = parseFloat(normalisedValueFromState.toFixed(2));
|
|
1526
|
+
setScaledValue(scaledValue);
|
|
1527
|
+
onChange && onChange(parseFloat(scaledValueFromState.toFixed(2)));
|
|
1360
1528
|
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1361
|
-
|
|
1529
|
+
highlightedItemChanged({
|
|
1362
1530
|
label: label,
|
|
1363
1531
|
value: scaledValue
|
|
1364
1532
|
});
|
|
1365
1533
|
}
|
|
1366
1534
|
};
|
|
1367
|
-
//
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
// }, [normalisedValueRef.current]);
|
|
1376
|
-
return {
|
|
1377
|
-
setNormalisedState: setNormalisedState,
|
|
1378
|
-
setScaledState: setScaledState,
|
|
1379
|
-
// onChangeStarted,
|
|
1380
|
-
// onChangeCommitted,
|
|
1381
|
-
onMouseEnter: onMouseEnter,
|
|
1382
|
-
bindBarSliderDrag: bindBarSliderDrag,
|
|
1383
|
-
bindDrag: bindDrag,
|
|
1384
|
-
normalisedValue: normalisedValueRef.current || 0,
|
|
1385
|
-
scaledValue: scaledValue,
|
|
1386
|
-
properties: properties
|
|
1535
|
+
// Update JUCE state
|
|
1536
|
+
var setNormalisedState = function(newValue) {
|
|
1537
|
+
var sliderState = Juce.getSliderState(id);
|
|
1538
|
+
var fixedNewValue = parseFloat(newValue.toFixed(2));
|
|
1539
|
+
if ((normalisedValueRef === null || normalisedValueRef === void 0 ? void 0 : normalisedValueRef.current) !== fixedNewValue) {
|
|
1540
|
+
!isLocalhost && sliderState.setNormalisedValue(clamp(fixedNewValue));
|
|
1541
|
+
normalisedValueRef.current = fixedNewValue;
|
|
1542
|
+
}
|
|
1387
1543
|
};
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
JustifyContent["spaceBetween"] = "space-between";
|
|
1395
|
-
JustifyContent["spaceAround"] = "space-around";
|
|
1396
|
-
JustifyContent["spaceEvenly"] = "space-evenly";
|
|
1397
|
-
return JustifyContent;
|
|
1398
|
-
}({});
|
|
1399
|
-
var AlignItems = /*#__PURE__*/ function(AlignItems) {
|
|
1400
|
-
AlignItems["flexStart"] = "flex-start";
|
|
1401
|
-
AlignItems["flexEnd"] = "flex-end";
|
|
1402
|
-
AlignItems["center"] = "center";
|
|
1403
|
-
AlignItems["stretch"] = "stretch";
|
|
1404
|
-
AlignItems["baseline"] = "baseline";
|
|
1405
|
-
return AlignItems;
|
|
1406
|
-
}({});
|
|
1407
|
-
var LayoutTags = /*#__PURE__*/ function(LayoutTags) {
|
|
1408
|
-
LayoutTags["header"] = "header";
|
|
1409
|
-
LayoutTags["main"] = "main";
|
|
1410
|
-
LayoutTags["section"] = "section";
|
|
1411
|
-
LayoutTags["div"] = "div";
|
|
1412
|
-
LayoutTags["footer"] = "footer";
|
|
1413
|
-
LayoutTags["ul"] = "ul";
|
|
1414
|
-
LayoutTags["li"] = "li";
|
|
1415
|
-
return LayoutTags;
|
|
1416
|
-
}({});
|
|
1417
|
-
|
|
1418
|
-
function _define_property$f(obj, key, value) {
|
|
1419
|
-
if (key in obj) {
|
|
1420
|
-
Object.defineProperty(obj, key, {
|
|
1421
|
-
value: value,
|
|
1422
|
-
enumerable: true,
|
|
1423
|
-
configurable: true,
|
|
1424
|
-
writable: true
|
|
1425
|
-
});
|
|
1426
|
-
} else {
|
|
1427
|
-
obj[key] = value;
|
|
1428
|
-
}
|
|
1429
|
-
return obj;
|
|
1430
|
-
}
|
|
1431
|
-
function _object_spread$f(target) {
|
|
1432
|
-
for(var i = 1; i < arguments.length; i++){
|
|
1433
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1434
|
-
var ownKeys = Object.keys(source);
|
|
1435
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1436
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1437
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1544
|
+
var setScaledState = function(newValue) {
|
|
1545
|
+
var sliderState = Juce.getSliderState(id);
|
|
1546
|
+
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== newValue) {
|
|
1547
|
+
!isLocalhost && properties && sliderState.setNormalisedValue(scaledToNormalised({
|
|
1548
|
+
scaledValue: clamp(parseFloat(newValue.toFixed(2)), properties === null || properties === void 0 ? void 0 : properties.start, properties === null || properties === void 0 ? void 0 : properties.end),
|
|
1549
|
+
properties: properties
|
|
1438
1550
|
}));
|
|
1551
|
+
scaledValueRef.current = newValue;
|
|
1439
1552
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
if (Object.getOwnPropertySymbols) {
|
|
1449
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
1450
|
-
keys.push.apply(keys, symbols);
|
|
1451
|
-
}
|
|
1452
|
-
return keys;
|
|
1453
|
-
}
|
|
1454
|
-
function _object_spread_props$2(target, source) {
|
|
1455
|
-
source = source != null ? source : {};
|
|
1456
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
1457
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1458
|
-
} else {
|
|
1459
|
-
ownKeys$2(Object(source)).forEach(function(key) {
|
|
1460
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1461
|
-
});
|
|
1462
|
-
}
|
|
1463
|
-
return target;
|
|
1464
|
-
}
|
|
1465
|
-
function _object_without_properties(source, excluded) {
|
|
1466
|
-
if (source == null) return {};
|
|
1467
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
1468
|
-
var key, i;
|
|
1469
|
-
if (Object.getOwnPropertySymbols) {
|
|
1470
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1471
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
1472
|
-
key = sourceSymbolKeys[i];
|
|
1473
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1474
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1475
|
-
target[key] = source[key];
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
return target;
|
|
1479
|
-
}
|
|
1480
|
-
function _object_without_properties_loose(source, excluded) {
|
|
1481
|
-
if (source == null) return {};
|
|
1482
|
-
var target = {};
|
|
1483
|
-
var sourceKeys = Object.keys(source);
|
|
1484
|
-
var key, i;
|
|
1485
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
1486
|
-
key = sourceKeys[i];
|
|
1487
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1488
|
-
target[key] = source[key];
|
|
1489
|
-
}
|
|
1490
|
-
return target;
|
|
1491
|
-
}
|
|
1492
|
-
var BoxDisplay = /*#__PURE__*/ function(BoxDisplay) {
|
|
1493
|
-
BoxDisplay["flex"] = "flex";
|
|
1494
|
-
BoxDisplay["block"] = "block";
|
|
1495
|
-
return BoxDisplay;
|
|
1496
|
-
}(BoxDisplay || {});
|
|
1497
|
-
function Box(_param) {
|
|
1498
|
-
var className = _param.className, style = _param.style, children = _param.children, flex = _param.flex, key = _param.key, onClick = _param.onClick, _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 ? [
|
|
1499
|
-
Spacing.none,
|
|
1500
|
-
Spacing.none,
|
|
1501
|
-
Spacing.none,
|
|
1502
|
-
Spacing.none
|
|
1503
|
-
] : _param_padding, _param_gap = _param.gap, gap = _param_gap === void 0 ? Spacing.xSmall : _param_gap, _param_tag = _param.tag, tag = _param_tag === void 0 ? LayoutTags.div : _param_tag, rest = _object_without_properties(_param, [
|
|
1504
|
-
"className",
|
|
1505
|
-
"style",
|
|
1506
|
-
"children",
|
|
1507
|
-
"flex",
|
|
1508
|
-
"key",
|
|
1509
|
-
"onClick",
|
|
1510
|
-
"alignItems",
|
|
1511
|
-
"justifyContent",
|
|
1512
|
-
"display",
|
|
1513
|
-
"width",
|
|
1514
|
-
"flexWrap",
|
|
1515
|
-
"height",
|
|
1516
|
-
"border",
|
|
1517
|
-
"flexDirection",
|
|
1518
|
-
"padding",
|
|
1519
|
-
"gap",
|
|
1520
|
-
"tag"
|
|
1521
|
-
]);
|
|
1522
|
-
var Tag = tag;
|
|
1523
|
-
var _padding_, _padding_1, _padding_2, _ref;
|
|
1524
|
-
return /*#__PURE__*/ React__default.createElement(Tag, _object_spread_props$2(_object_spread$f({
|
|
1525
|
-
// id="globalValues"
|
|
1526
|
-
key: key,
|
|
1527
|
-
className: className,
|
|
1528
|
-
onClick: onClick
|
|
1529
|
-
}, rest), {
|
|
1530
|
-
style: _object_spread$f({
|
|
1531
|
-
flexWrap: flexWrap,
|
|
1532
|
-
display: display,
|
|
1533
|
-
gap: "var(--gap-".concat(gap, ")"),
|
|
1534
|
-
width: '100%',
|
|
1535
|
-
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1536
|
-
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
1537
|
-
paddingBottom: "var(--p-".concat((_padding_1 = padding[2]) !== null && _padding_1 !== void 0 ? _padding_1 : padding[0], ")"),
|
|
1538
|
-
paddingLeft: "var(--p-".concat((_ref = (_padding_2 = padding[3]) !== null && _padding_2 !== void 0 ? _padding_2 : padding[1]) !== null && _ref !== void 0 ? _ref : padding[0], ")"),
|
|
1539
|
-
border: border ? '2px solid #999' : '',
|
|
1540
|
-
maxWidth: width,
|
|
1541
|
-
height: height,
|
|
1542
|
-
flexDirection: flexDirection === FlexDirection.row ? FlexDirection.row : FlexDirection.column,
|
|
1543
|
-
justifyContent: "".concat(justifyContent),
|
|
1544
|
-
alignItems: "".concat(alignItems),
|
|
1545
|
-
flex: flex ? flex : ''
|
|
1546
|
-
}, style)
|
|
1547
|
-
}), children);
|
|
1548
|
-
}
|
|
1549
|
-
// Object.assign(Layout, width, height, ALIGN, JUSTIFY, DIRECTION, SPACING);
|
|
1550
|
-
Box.display = BoxDisplay;
|
|
1551
|
-
Box.alignItems = AlignItems;
|
|
1552
|
-
Box.justifyContent = JustifyContent;
|
|
1553
|
-
Box.gap = Spacing;
|
|
1554
|
-
Box.flexDirection = FlexDirection;
|
|
1555
|
-
Box.width = Width;
|
|
1556
|
-
Box.height = Height;
|
|
1557
|
-
Box.padding = Spacing;
|
|
1558
|
-
Box.flexWrap = FlexWrap;
|
|
1559
|
-
Box.tag = LayoutTags;
|
|
1560
|
-
|
|
1561
|
-
function _define_property$e(obj, key, value) {
|
|
1562
|
-
if (key in obj) {
|
|
1563
|
-
Object.defineProperty(obj, key, {
|
|
1564
|
-
value: value,
|
|
1565
|
-
enumerable: true,
|
|
1566
|
-
configurable: true,
|
|
1567
|
-
writable: true
|
|
1568
|
-
});
|
|
1569
|
-
} else {
|
|
1570
|
-
obj[key] = value;
|
|
1571
|
-
}
|
|
1572
|
-
return obj;
|
|
1573
|
-
}
|
|
1574
|
-
function _object_spread$e(target) {
|
|
1575
|
-
for(var i = 1; i < arguments.length; i++){
|
|
1576
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
1577
|
-
var ownKeys = Object.keys(source);
|
|
1578
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
1579
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
1580
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
1581
|
-
}));
|
|
1553
|
+
};
|
|
1554
|
+
var bindDrag = useDrag(function(param) {
|
|
1555
|
+
var down = param.down, delta = param.delta, first = param.first, last = param.last;
|
|
1556
|
+
if (first) {
|
|
1557
|
+
//@ts-expect-error
|
|
1558
|
+
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1559
|
+
i: "".concat(0)
|
|
1560
|
+
});
|
|
1582
1561
|
}
|
|
1583
|
-
|
|
1584
|
-
|
|
1562
|
+
if (down) {
|
|
1563
|
+
var deltaVal = delta[1] * -1;
|
|
1564
|
+
var getNormalisedInterval = function() {
|
|
1565
|
+
if (properties === null || properties === void 0 ? void 0 : properties.interval) {
|
|
1566
|
+
if ((properties === null || properties === void 0 ? void 0 : properties.interval) >= 1) {
|
|
1567
|
+
return (properties === null || properties === void 0 ? void 0 : properties.interval) * 0.01;
|
|
1568
|
+
} else {
|
|
1569
|
+
return properties === null || properties === void 0 ? void 0 : properties.interval;
|
|
1570
|
+
}
|
|
1571
|
+
} else {
|
|
1572
|
+
return 0.01;
|
|
1573
|
+
}
|
|
1574
|
+
};
|
|
1575
|
+
var normalisedInterval = getNormalisedInterval();
|
|
1576
|
+
var _normalisedValueRef_current;
|
|
1577
|
+
var newValue = ((_normalisedValueRef_current = normalisedValueRef.current) !== null && _normalisedValueRef_current !== void 0 ? _normalisedValueRef_current : 0) + deltaVal * // (properties?.interval && properties?.interval.toString().length > 4
|
|
1578
|
+
// ? 4
|
|
1579
|
+
// : 0.4) *
|
|
1580
|
+
normalisedInterval;
|
|
1581
|
+
setNormalisedState(clamp(newValue));
|
|
1582
|
+
}
|
|
1583
|
+
if (last) {
|
|
1584
|
+
//@ts-expect-error
|
|
1585
|
+
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1586
|
+
i: "".concat(0)
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
}, {
|
|
1590
|
+
preventDefault: true
|
|
1591
|
+
});
|
|
1592
|
+
var bindBarSliderDrag = function() {
|
|
1593
|
+
var orientation = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Orientation.vertical;
|
|
1594
|
+
var drag = useDrag(function(param) {
|
|
1595
|
+
var down = param.down, event = param.event, first = param.first, last = param.last;
|
|
1596
|
+
var _event_target;
|
|
1597
|
+
var rect = event === null || event === void 0 ? void 0 : (_event_target = event.target) === null || _event_target === void 0 ? void 0 : _event_target.getBoundingClientRect();
|
|
1598
|
+
var y = (event === null || event === void 0 ? void 0 : event.clientY) - rect.top;
|
|
1599
|
+
var x = (event === null || event === void 0 ? void 0 : event.clientX) - rect.left;
|
|
1600
|
+
// 1138 - 1043.1
|
|
1601
|
+
if (first) {
|
|
1602
|
+
//@ts-expect-error
|
|
1603
|
+
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1604
|
+
i: "".concat(0)
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
// START
|
|
1608
|
+
// bottom: 685
|
|
1609
|
+
// height: 40
|
|
1610
|
+
// left: 733.5
|
|
1611
|
+
// right: 884.328125
|
|
1612
|
+
// top: 645
|
|
1613
|
+
// width: 150.828125
|
|
1614
|
+
// x: 733.5
|
|
1615
|
+
// y: 645
|
|
1616
|
+
// clientx 735
|
|
1617
|
+
// 735 - 733.5
|
|
1618
|
+
// END
|
|
1619
|
+
// bottom: 685
|
|
1620
|
+
// height: 40
|
|
1621
|
+
// left: 733.5
|
|
1622
|
+
// right: 884.328125
|
|
1623
|
+
// top: 645
|
|
1624
|
+
// width: 150.828125
|
|
1625
|
+
// x: 733.5
|
|
1626
|
+
// y: 645
|
|
1627
|
+
// clientx: 883
|
|
1628
|
+
if (down) {
|
|
1629
|
+
// TODO: Increments?
|
|
1630
|
+
var newValue;
|
|
1631
|
+
if (orientation === Orientation.vertical) {
|
|
1632
|
+
newValue = 1 - y / rect.height;
|
|
1633
|
+
} else {
|
|
1634
|
+
newValue = x / rect.width;
|
|
1635
|
+
}
|
|
1636
|
+
setNormalisedState(clamp(newValue));
|
|
1637
|
+
}
|
|
1638
|
+
if (last) {
|
|
1639
|
+
//@ts-expect-error
|
|
1640
|
+
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1641
|
+
i: "".concat(0)
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
}, {
|
|
1645
|
+
preventDefault: true
|
|
1585
1646
|
});
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
Label.padding = Spacing;
|
|
1610
|
-
Label.fontSize = FontSizes;
|
|
1647
|
+
return drag();
|
|
1648
|
+
};
|
|
1649
|
+
var onMouseEnter = function() {
|
|
1650
|
+
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1651
|
+
highlightedItemChanged({
|
|
1652
|
+
label: label,
|
|
1653
|
+
value: scaledValue
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
return {
|
|
1658
|
+
setNormalisedState: setNormalisedState,
|
|
1659
|
+
setScaledState: setScaledState,
|
|
1660
|
+
// onChangeStarted,
|
|
1661
|
+
// onChangeCommitted,
|
|
1662
|
+
onMouseEnter: onMouseEnter,
|
|
1663
|
+
bindBarSliderDrag: bindBarSliderDrag,
|
|
1664
|
+
bindDrag: bindDrag,
|
|
1665
|
+
normalisedValue: normalisedValueRef.current || 0,
|
|
1666
|
+
scaledValue: scaledValue,
|
|
1667
|
+
properties: properties
|
|
1668
|
+
};
|
|
1669
|
+
};
|
|
1611
1670
|
|
|
1612
|
-
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
|
|
1671
|
+
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 width: 0;\n height: 0;\n border-style: solid;\n border-width: 0 5px 8px 5px;\n transform: rotate(180deg);\n padding-bottom: var(--spacing-sm);\n}\n";
|
|
1613
1672
|
styleInject(css_248z$6);
|
|
1614
1673
|
|
|
1615
|
-
function _define_property$
|
|
1674
|
+
function _define_property$e(obj, key, value) {
|
|
1616
1675
|
if (key in obj) {
|
|
1617
1676
|
Object.defineProperty(obj, key, {
|
|
1618
1677
|
value: value,
|
|
@@ -1625,7 +1684,7 @@ function _define_property$d(obj, key, value) {
|
|
|
1625
1684
|
}
|
|
1626
1685
|
return obj;
|
|
1627
1686
|
}
|
|
1628
|
-
function _object_spread$
|
|
1687
|
+
function _object_spread$e(target) {
|
|
1629
1688
|
for(var i = 1; i < arguments.length; i++){
|
|
1630
1689
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1631
1690
|
var ownKeys = Object.keys(source);
|
|
@@ -1635,7 +1694,7 @@ function _object_spread$d(target) {
|
|
|
1635
1694
|
}));
|
|
1636
1695
|
}
|
|
1637
1696
|
ownKeys.forEach(function(key) {
|
|
1638
|
-
_define_property$
|
|
1697
|
+
_define_property$e(target, key, source[key]);
|
|
1639
1698
|
});
|
|
1640
1699
|
}
|
|
1641
1700
|
return target;
|
|
@@ -1666,7 +1725,7 @@ function RotarySlider(param) {
|
|
|
1666
1725
|
end: 15000.0,
|
|
1667
1726
|
interval: 0.1,
|
|
1668
1727
|
skew: 0.7
|
|
1669
|
-
} : _param_mockProperties, _param_color = param.color, color = _param_color === void 0 ? 'var(--color-gray-400)' : _param_color, style = param.style;
|
|
1728
|
+
} : _param_mockProperties, labelColor = param.labelColor, _param_color = param.color, color = _param_color === void 0 ? 'var(--color-gray-400)' : _param_color, style = param.style;
|
|
1670
1729
|
var _useSlider = useSlider({
|
|
1671
1730
|
id: id,
|
|
1672
1731
|
label: label,
|
|
@@ -1678,12 +1737,15 @@ function RotarySlider(param) {
|
|
|
1678
1737
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1679
1738
|
flexDirection: Box.flexDirection.column
|
|
1680
1739
|
}, polarity === Polarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1740
|
+
style: {
|
|
1741
|
+
borderColor: "".concat(color, " transparent ").concat(color, " transparent")
|
|
1742
|
+
},
|
|
1681
1743
|
className: classnames('RotarySlider-center-marker')
|
|
1682
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$
|
|
1744
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$e({
|
|
1683
1745
|
className: classnames('RotarySlider', polarity === Polarity.linear ? 'Slider-polarity-linear' : 'Slider-polarity-bipolar', className)
|
|
1684
1746
|
}, bindDrag()), {
|
|
1685
1747
|
onMouseEnter: onMouseEnter,
|
|
1686
|
-
style: _object_spread$
|
|
1748
|
+
style: _object_spread$e({
|
|
1687
1749
|
touchAction: 'none'
|
|
1688
1750
|
}, style)
|
|
1689
1751
|
}), normalisedValue !== null ? /*#__PURE__*/ React__default.createElement("div", {
|
|
@@ -1693,7 +1755,7 @@ function RotarySlider(param) {
|
|
|
1693
1755
|
}
|
|
1694
1756
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
1695
1757
|
className: classnames('RotarySlider-Indicator'),
|
|
1696
|
-
style: _object_spread$
|
|
1758
|
+
style: _object_spread$e({
|
|
1697
1759
|
backgroundColor: color
|
|
1698
1760
|
}, style)
|
|
1699
1761
|
})) : ''), /*#__PURE__*/ React__default.createElement(Label, {
|
|
@@ -1701,12 +1763,15 @@ function RotarySlider(param) {
|
|
|
1701
1763
|
Label.padding.mediumSmall
|
|
1702
1764
|
],
|
|
1703
1765
|
fontSize: Label.fontSize.small,
|
|
1704
|
-
value: label
|
|
1766
|
+
value: label,
|
|
1767
|
+
style: {
|
|
1768
|
+
color: "".concat(labelColor ? labelColor : 'initial')
|
|
1769
|
+
}
|
|
1705
1770
|
}));
|
|
1706
1771
|
}
|
|
1707
1772
|
RotarySlider.sliderPolarity = Polarity;
|
|
1708
1773
|
|
|
1709
|
-
function _define_property$
|
|
1774
|
+
function _define_property$d(obj, key, value) {
|
|
1710
1775
|
if (key in obj) {
|
|
1711
1776
|
Object.defineProperty(obj, key, {
|
|
1712
1777
|
value: value,
|
|
@@ -1719,7 +1784,7 @@ function _define_property$c(obj, key, value) {
|
|
|
1719
1784
|
}
|
|
1720
1785
|
return obj;
|
|
1721
1786
|
}
|
|
1722
|
-
function _object_spread$
|
|
1787
|
+
function _object_spread$d(target) {
|
|
1723
1788
|
for(var i = 1; i < arguments.length; i++){
|
|
1724
1789
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1725
1790
|
var ownKeys = Object.keys(source);
|
|
@@ -1729,7 +1794,7 @@ function _object_spread$c(target) {
|
|
|
1729
1794
|
}));
|
|
1730
1795
|
}
|
|
1731
1796
|
ownKeys.forEach(function(key) {
|
|
1732
|
-
_define_property$
|
|
1797
|
+
_define_property$d(target, key, source[key]);
|
|
1733
1798
|
});
|
|
1734
1799
|
}
|
|
1735
1800
|
return target;
|
|
@@ -1775,11 +1840,11 @@ function Slider(param) {
|
|
|
1775
1840
|
className: classnames(className)
|
|
1776
1841
|
}, polarity === Polarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1777
1842
|
className: 'Slider-center-marker'
|
|
1778
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$
|
|
1843
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$d({
|
|
1779
1844
|
className: classnames('Slider-bar', 'relative')
|
|
1780
1845
|
}, bindBarSliderDrag()), {
|
|
1781
1846
|
onMouseEnter: onMouseEnter,
|
|
1782
|
-
style: _object_spread$
|
|
1847
|
+
style: _object_spread$d({
|
|
1783
1848
|
touchAction: 'none',
|
|
1784
1849
|
backgroundColor: 'var(--bg-input)',
|
|
1785
1850
|
minWidth: sliderOrientation === Orientation.horizontal ? '100px' : '20px',
|
|
@@ -1788,7 +1853,7 @@ function Slider(param) {
|
|
|
1788
1853
|
}), normalisedValue ? /*#__PURE__*/ React__default.createElement("div", {
|
|
1789
1854
|
// TODO: Why aren't the Tailwind classes working?
|
|
1790
1855
|
// className={classnames('h-full', 'w-full', 'absolute', 'bg-input')}
|
|
1791
|
-
style: _object_spread$
|
|
1856
|
+
style: _object_spread$d({
|
|
1792
1857
|
position: 'absolute',
|
|
1793
1858
|
backgroundColor: color,
|
|
1794
1859
|
pointerEvents: 'none'
|
|
@@ -1835,7 +1900,7 @@ var HeadingTags = /*#__PURE__*/ function(HeadingTags) {
|
|
|
1835
1900
|
return HeadingTags;
|
|
1836
1901
|
}({});
|
|
1837
1902
|
|
|
1838
|
-
function _define_property$
|
|
1903
|
+
function _define_property$c(obj, key, value) {
|
|
1839
1904
|
if (key in obj) {
|
|
1840
1905
|
Object.defineProperty(obj, key, {
|
|
1841
1906
|
value: value,
|
|
@@ -1848,7 +1913,7 @@ function _define_property$b(obj, key, value) {
|
|
|
1848
1913
|
}
|
|
1849
1914
|
return obj;
|
|
1850
1915
|
}
|
|
1851
|
-
function _object_spread$
|
|
1916
|
+
function _object_spread$c(target) {
|
|
1852
1917
|
for(var i = 1; i < arguments.length; i++){
|
|
1853
1918
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1854
1919
|
var ownKeys = Object.keys(source);
|
|
@@ -1858,7 +1923,7 @@ function _object_spread$b(target) {
|
|
|
1858
1923
|
}));
|
|
1859
1924
|
}
|
|
1860
1925
|
ownKeys.forEach(function(key) {
|
|
1861
|
-
_define_property$
|
|
1926
|
+
_define_property$c(target, key, source[key]);
|
|
1862
1927
|
});
|
|
1863
1928
|
}
|
|
1864
1929
|
return target;
|
|
@@ -1871,7 +1936,7 @@ function Heading(param) {
|
|
|
1871
1936
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1872
1937
|
return /*#__PURE__*/ React.createElement(Tag, {
|
|
1873
1938
|
id: id,
|
|
1874
|
-
style: _object_spread$
|
|
1939
|
+
style: _object_spread$c({
|
|
1875
1940
|
fontSize: "var(--text-".concat(fontSize),
|
|
1876
1941
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1877
1942
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1972,7 +2037,7 @@ var useIndicator = function(param) {
|
|
|
1972
2037
|
};
|
|
1973
2038
|
};
|
|
1974
2039
|
|
|
1975
|
-
function _define_property$
|
|
2040
|
+
function _define_property$b(obj, key, value) {
|
|
1976
2041
|
if (key in obj) {
|
|
1977
2042
|
Object.defineProperty(obj, key, {
|
|
1978
2043
|
value: value,
|
|
@@ -1985,7 +2050,7 @@ function _define_property$a(obj, key, value) {
|
|
|
1985
2050
|
}
|
|
1986
2051
|
return obj;
|
|
1987
2052
|
}
|
|
1988
|
-
function _object_spread$
|
|
2053
|
+
function _object_spread$b(target) {
|
|
1989
2054
|
for(var i = 1; i < arguments.length; i++){
|
|
1990
2055
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1991
2056
|
var ownKeys = Object.keys(source);
|
|
@@ -1995,7 +2060,7 @@ function _object_spread$a(target) {
|
|
|
1995
2060
|
}));
|
|
1996
2061
|
}
|
|
1997
2062
|
ownKeys.forEach(function(key) {
|
|
1998
|
-
_define_property$
|
|
2063
|
+
_define_property$b(target, key, source[key]);
|
|
1999
2064
|
});
|
|
2000
2065
|
}
|
|
2001
2066
|
return target;
|
|
@@ -2012,7 +2077,7 @@ function IndicatorLight(param) {
|
|
|
2012
2077
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
2013
2078
|
id: id,
|
|
2014
2079
|
className: classnames('IndicatorLight', 'bg-input', className),
|
|
2015
|
-
style: _object_spread$
|
|
2080
|
+
style: _object_spread$b({
|
|
2016
2081
|
width: '12px',
|
|
2017
2082
|
height: '12px',
|
|
2018
2083
|
background: isActive ? color : ''
|
|
@@ -2025,7 +2090,7 @@ function IndicatorLight(param) {
|
|
|
2025
2090
|
var css_248z$5 = ".IconButton:hover:not(:disabled) {\n filter: brightness(80%);\n}\n\nsvg {\n height: 100%;\n width: 100%;\n}\n";
|
|
2026
2091
|
styleInject(css_248z$5);
|
|
2027
2092
|
|
|
2028
|
-
function _define_property$
|
|
2093
|
+
function _define_property$a(obj, key, value) {
|
|
2029
2094
|
if (key in obj) {
|
|
2030
2095
|
Object.defineProperty(obj, key, {
|
|
2031
2096
|
value: value,
|
|
@@ -2038,7 +2103,7 @@ function _define_property$9(obj, key, value) {
|
|
|
2038
2103
|
}
|
|
2039
2104
|
return obj;
|
|
2040
2105
|
}
|
|
2041
|
-
function _object_spread$
|
|
2106
|
+
function _object_spread$a(target) {
|
|
2042
2107
|
for(var i = 1; i < arguments.length; i++){
|
|
2043
2108
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2044
2109
|
var ownKeys = Object.keys(source);
|
|
@@ -2048,7 +2113,7 @@ function _object_spread$9(target) {
|
|
|
2048
2113
|
}));
|
|
2049
2114
|
}
|
|
2050
2115
|
ownKeys.forEach(function(key) {
|
|
2051
|
-
_define_property$
|
|
2116
|
+
_define_property$a(target, key, source[key]);
|
|
2052
2117
|
});
|
|
2053
2118
|
}
|
|
2054
2119
|
return target;
|
|
@@ -2292,7 +2357,7 @@ function Icon(param) {
|
|
|
2292
2357
|
className: "Icon ".concat(className),
|
|
2293
2358
|
onClick: onClick,
|
|
2294
2359
|
padding: padding,
|
|
2295
|
-
style: _object_spread$
|
|
2360
|
+
style: _object_spread$a({
|
|
2296
2361
|
width: width,
|
|
2297
2362
|
height: height
|
|
2298
2363
|
}, style)
|
|
@@ -2305,7 +2370,7 @@ Icon.icon = Icons;
|
|
|
2305
2370
|
Icon.padding = Spacing;
|
|
2306
2371
|
Icon.margin = Spacing;
|
|
2307
2372
|
|
|
2308
|
-
function _define_property$
|
|
2373
|
+
function _define_property$9(obj, key, value) {
|
|
2309
2374
|
if (key in obj) {
|
|
2310
2375
|
Object.defineProperty(obj, key, {
|
|
2311
2376
|
value: value,
|
|
@@ -2318,7 +2383,7 @@ function _define_property$8(obj, key, value) {
|
|
|
2318
2383
|
}
|
|
2319
2384
|
return obj;
|
|
2320
2385
|
}
|
|
2321
|
-
function _object_spread$
|
|
2386
|
+
function _object_spread$9(target) {
|
|
2322
2387
|
for(var i = 1; i < arguments.length; i++){
|
|
2323
2388
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2324
2389
|
var ownKeys = Object.keys(source);
|
|
@@ -2328,7 +2393,7 @@ function _object_spread$8(target) {
|
|
|
2328
2393
|
}));
|
|
2329
2394
|
}
|
|
2330
2395
|
ownKeys.forEach(function(key) {
|
|
2331
|
-
_define_property$
|
|
2396
|
+
_define_property$9(target, key, source[key]);
|
|
2332
2397
|
});
|
|
2333
2398
|
}
|
|
2334
2399
|
return target;
|
|
@@ -2347,7 +2412,7 @@ function IconButton(param) {
|
|
|
2347
2412
|
padding: padding,
|
|
2348
2413
|
margin: margin,
|
|
2349
2414
|
disabled: disabled,
|
|
2350
|
-
style: _object_spread$
|
|
2415
|
+
style: _object_spread$9({
|
|
2351
2416
|
backgroundColor: backgroundColor,
|
|
2352
2417
|
width: width,
|
|
2353
2418
|
height: height
|
|
@@ -2361,7 +2426,7 @@ IconButton.icon = Icons;
|
|
|
2361
2426
|
IconButton.padding = Spacing;
|
|
2362
2427
|
IconButton.margin = Spacing;
|
|
2363
2428
|
|
|
2364
|
-
function _define_property$
|
|
2429
|
+
function _define_property$8(obj, key, value) {
|
|
2365
2430
|
if (key in obj) {
|
|
2366
2431
|
Object.defineProperty(obj, key, {
|
|
2367
2432
|
value: value,
|
|
@@ -2374,7 +2439,7 @@ function _define_property$7(obj, key, value) {
|
|
|
2374
2439
|
}
|
|
2375
2440
|
return obj;
|
|
2376
2441
|
}
|
|
2377
|
-
function _object_spread$
|
|
2442
|
+
function _object_spread$8(target) {
|
|
2378
2443
|
for(var i = 1; i < arguments.length; i++){
|
|
2379
2444
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2380
2445
|
var ownKeys = Object.keys(source);
|
|
@@ -2384,7 +2449,7 @@ function _object_spread$7(target) {
|
|
|
2384
2449
|
}));
|
|
2385
2450
|
}
|
|
2386
2451
|
ownKeys.forEach(function(key) {
|
|
2387
|
-
_define_property$
|
|
2452
|
+
_define_property$8(target, key, source[key]);
|
|
2388
2453
|
});
|
|
2389
2454
|
}
|
|
2390
2455
|
return target;
|
|
@@ -2396,7 +2461,7 @@ function KeyValueDisplayScreen(param) {
|
|
|
2396
2461
|
// justifyContent={Box.justifyContent.flexStart}
|
|
2397
2462
|
alignItems: Box.alignItems.flexStart,
|
|
2398
2463
|
gap: Box.gap.small,
|
|
2399
|
-
style: _object_spread$
|
|
2464
|
+
style: _object_spread$8({}, style),
|
|
2400
2465
|
padding: [
|
|
2401
2466
|
Box.padding.small,
|
|
2402
2467
|
Box.padding.none,
|
|
@@ -2509,7 +2574,7 @@ function _array_like_to_array$6(arr, len) {
|
|
|
2509
2574
|
function _array_with_holes$6(arr) {
|
|
2510
2575
|
if (Array.isArray(arr)) return arr;
|
|
2511
2576
|
}
|
|
2512
|
-
function _define_property$
|
|
2577
|
+
function _define_property$7(obj, key, value) {
|
|
2513
2578
|
if (key in obj) {
|
|
2514
2579
|
Object.defineProperty(obj, key, {
|
|
2515
2580
|
value: value,
|
|
@@ -2549,7 +2614,7 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
2549
2614
|
function _non_iterable_rest$6() {
|
|
2550
2615
|
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
2616
|
}
|
|
2552
|
-
function _object_spread$
|
|
2617
|
+
function _object_spread$7(target) {
|
|
2553
2618
|
for(var i = 1; i < arguments.length; i++){
|
|
2554
2619
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2555
2620
|
var ownKeys = Object.keys(source);
|
|
@@ -2559,7 +2624,7 @@ function _object_spread$6(target) {
|
|
|
2559
2624
|
}));
|
|
2560
2625
|
}
|
|
2561
2626
|
ownKeys.forEach(function(key) {
|
|
2562
|
-
_define_property$
|
|
2627
|
+
_define_property$7(target, key, source[key]);
|
|
2563
2628
|
});
|
|
2564
2629
|
}
|
|
2565
2630
|
return target;
|
|
@@ -2595,7 +2660,7 @@ function Oscilloscope(param) {
|
|
|
2595
2660
|
}, []);
|
|
2596
2661
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
2597
2662
|
id: id,
|
|
2598
|
-
style: _object_spread$
|
|
2663
|
+
style: _object_spread$7({
|
|
2599
2664
|
height: height
|
|
2600
2665
|
}, style),
|
|
2601
2666
|
className: classnames('Oscilloscope', className)
|
|
@@ -3106,7 +3171,7 @@ function _async_to_generator$2(fn) {
|
|
|
3106
3171
|
});
|
|
3107
3172
|
};
|
|
3108
3173
|
}
|
|
3109
|
-
function _define_property$
|
|
3174
|
+
function _define_property$6(obj, key, value) {
|
|
3110
3175
|
if (key in obj) {
|
|
3111
3176
|
Object.defineProperty(obj, key, {
|
|
3112
3177
|
value: value,
|
|
@@ -3146,7 +3211,7 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
3146
3211
|
function _non_iterable_rest$4() {
|
|
3147
3212
|
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
3213
|
}
|
|
3149
|
-
function _object_spread$
|
|
3214
|
+
function _object_spread$6(target) {
|
|
3150
3215
|
for(var i = 1; i < arguments.length; i++){
|
|
3151
3216
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3152
3217
|
var ownKeys = Object.keys(source);
|
|
@@ -3156,7 +3221,7 @@ function _object_spread$5(target) {
|
|
|
3156
3221
|
}));
|
|
3157
3222
|
}
|
|
3158
3223
|
ownKeys.forEach(function(key) {
|
|
3159
|
-
_define_property$
|
|
3224
|
+
_define_property$6(target, key, source[key]);
|
|
3160
3225
|
});
|
|
3161
3226
|
}
|
|
3162
3227
|
return target;
|
|
@@ -3275,7 +3340,7 @@ function ModuleHeader(param) {
|
|
|
3275
3340
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
3276
3341
|
var _useState = _sliced_to_array$4(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
3277
3342
|
var _useState1 = _sliced_to_array$4(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
3278
|
-
var _useGlobalContext = useGlobalContext(), globalState = _useGlobalContext.globalState,
|
|
3343
|
+
var _useGlobalContext = useGlobalContext(), globalState = _useGlobalContext.globalState, advancedViewToggled = _useGlobalContext.advancedViewToggled;
|
|
3279
3344
|
var handleUndo = function() {
|
|
3280
3345
|
undo();
|
|
3281
3346
|
};
|
|
@@ -3302,7 +3367,7 @@ function ModuleHeader(param) {
|
|
|
3302
3367
|
case 1:
|
|
3303
3368
|
advancedViewStatus = _state.sent();
|
|
3304
3369
|
setAdvancedViewFunc(!advancedViewStatus);
|
|
3305
|
-
|
|
3370
|
+
advancedViewToggled(!advancedViewStatus);
|
|
3306
3371
|
return [
|
|
3307
3372
|
3,
|
|
3308
3373
|
3
|
|
@@ -3352,7 +3417,7 @@ function ModuleHeader(param) {
|
|
|
3352
3417
|
];
|
|
3353
3418
|
case 1:
|
|
3354
3419
|
advancedViewStatus = _state.sent();
|
|
3355
|
-
|
|
3420
|
+
advancedViewToggled(advancedViewStatus);
|
|
3356
3421
|
return [
|
|
3357
3422
|
3,
|
|
3358
3423
|
3
|
|
@@ -3441,7 +3506,7 @@ function ModuleHeader(param) {
|
|
|
3441
3506
|
Box.padding.large
|
|
3442
3507
|
],
|
|
3443
3508
|
className: classnames('ModuleHeader', className),
|
|
3444
|
-
style: _object_spread$
|
|
3509
|
+
style: _object_spread$6({}, style)
|
|
3445
3510
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3446
3511
|
style: {
|
|
3447
3512
|
width: '1000px'
|
|
@@ -3513,7 +3578,7 @@ function ModuleHeader(param) {
|
|
|
3513
3578
|
}, "Advanced")))));
|
|
3514
3579
|
}
|
|
3515
3580
|
|
|
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
|
|
3581
|
+
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
3582
|
styleInject(css_248z$1);
|
|
3518
3583
|
|
|
3519
3584
|
var targetColors = [
|
|
@@ -3523,11 +3588,12 @@ var targetColors = [
|
|
|
3523
3588
|
'#ce5847',
|
|
3524
3589
|
'#d98368',
|
|
3525
3590
|
'#E0859D',
|
|
3526
|
-
'#4DA1CB'
|
|
3591
|
+
'#4DA1CB',
|
|
3592
|
+
'#cb4d62'
|
|
3527
3593
|
];
|
|
3528
3594
|
var ComboboxCellWidth = '217px';
|
|
3529
3595
|
|
|
3530
|
-
function _define_property$
|
|
3596
|
+
function _define_property$5(obj, key, value) {
|
|
3531
3597
|
if (key in obj) {
|
|
3532
3598
|
Object.defineProperty(obj, key, {
|
|
3533
3599
|
value: value,
|
|
@@ -3540,7 +3606,7 @@ function _define_property$4(obj, key, value) {
|
|
|
3540
3606
|
}
|
|
3541
3607
|
return obj;
|
|
3542
3608
|
}
|
|
3543
|
-
function _object_spread$
|
|
3609
|
+
function _object_spread$5(target) {
|
|
3544
3610
|
for(var i = 1; i < arguments.length; i++){
|
|
3545
3611
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3546
3612
|
var ownKeys = Object.keys(source);
|
|
@@ -3550,7 +3616,7 @@ function _object_spread$4(target) {
|
|
|
3550
3616
|
}));
|
|
3551
3617
|
}
|
|
3552
3618
|
ownKeys.forEach(function(key) {
|
|
3553
|
-
_define_property$
|
|
3619
|
+
_define_property$5(target, key, source[key]);
|
|
3554
3620
|
});
|
|
3555
3621
|
}
|
|
3556
3622
|
return target;
|
|
@@ -3566,7 +3632,7 @@ function SingleBarViz(param) {
|
|
|
3566
3632
|
position: 'relative'
|
|
3567
3633
|
}
|
|
3568
3634
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
3569
|
-
style: _object_spread$
|
|
3635
|
+
style: _object_spread$5({
|
|
3570
3636
|
position: 'absolute',
|
|
3571
3637
|
background: background
|
|
3572
3638
|
}, getBarTransformStyles({
|
|
@@ -3576,17 +3642,132 @@ function SingleBarViz(param) {
|
|
|
3576
3642
|
}), style)
|
|
3577
3643
|
}));
|
|
3578
3644
|
}
|
|
3579
|
-
SingleBarViz.polarity = Polarity;
|
|
3645
|
+
SingleBarViz.polarity = Polarity;
|
|
3646
|
+
|
|
3647
|
+
function _array_like_to_array$3(arr, len) {
|
|
3648
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3649
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3650
|
+
return arr2;
|
|
3651
|
+
}
|
|
3652
|
+
function _array_with_holes$3(arr) {
|
|
3653
|
+
if (Array.isArray(arr)) return arr;
|
|
3654
|
+
}
|
|
3655
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
3656
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3657
|
+
if (_i == null) return;
|
|
3658
|
+
var _arr = [];
|
|
3659
|
+
var _n = true;
|
|
3660
|
+
var _d = false;
|
|
3661
|
+
var _s, _e;
|
|
3662
|
+
try {
|
|
3663
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
3664
|
+
_arr.push(_s.value);
|
|
3665
|
+
if (i && _arr.length === i) break;
|
|
3666
|
+
}
|
|
3667
|
+
} catch (err) {
|
|
3668
|
+
_d = true;
|
|
3669
|
+
_e = err;
|
|
3670
|
+
} finally{
|
|
3671
|
+
try {
|
|
3672
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3673
|
+
} finally{
|
|
3674
|
+
if (_d) throw _e;
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
return _arr;
|
|
3678
|
+
}
|
|
3679
|
+
function _non_iterable_rest$3() {
|
|
3680
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3681
|
+
}
|
|
3682
|
+
function _sliced_to_array$3(arr, i) {
|
|
3683
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
3684
|
+
}
|
|
3685
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
3686
|
+
if (!o) return;
|
|
3687
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
3688
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3689
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3690
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3691
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
3692
|
+
}
|
|
3693
|
+
var useCombobox = function(param) {
|
|
3694
|
+
var id = param.id, filter = param.filter, onChange = param.onChange;
|
|
3695
|
+
var _Object_values;
|
|
3696
|
+
var comboBoxState = Juce.getComboBoxState(id);
|
|
3697
|
+
var _useState = _sliced_to_array$3(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
3698
|
+
var _useState1 = _sliced_to_array$3(useState(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
3699
|
+
var _useGlobalContext = useGlobalContext(); _useGlobalContext.highlightedItemChanged; var _useGlobalContext_globalState = _useGlobalContext.globalState, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3700
|
+
//TODO: Filter choices for subsequent rows
|
|
3701
|
+
// const availableChoices = properties?.choices;
|
|
3702
|
+
useEffect(function() {
|
|
3703
|
+
setValue(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.getChoiceIndex());
|
|
3704
|
+
}, [
|
|
3705
|
+
id
|
|
3706
|
+
]);
|
|
3707
|
+
useEffect(function() {
|
|
3708
|
+
setProperties(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties);
|
|
3709
|
+
});
|
|
3710
|
+
useEffect(function() {
|
|
3711
|
+
var _comboBoxState_valueChangedEvent, _comboBoxState_propertiesChangedEvent;
|
|
3712
|
+
var valueListenerId = comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_valueChangedEvent = comboBoxState.valueChangedEvent) === null || _comboBoxState_valueChangedEvent === void 0 ? void 0 : _comboBoxState_valueChangedEvent.addListener(function() {
|
|
3713
|
+
setValue(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.getChoiceIndex());
|
|
3714
|
+
});
|
|
3715
|
+
var propertiesListenerId = comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_propertiesChangedEvent = comboBoxState.propertiesChangedEvent) === null || _comboBoxState_propertiesChangedEvent === void 0 ? void 0 : _comboBoxState_propertiesChangedEvent.addListener(function() {
|
|
3716
|
+
setProperties(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties);
|
|
3717
|
+
});
|
|
3718
|
+
return function cleanup() {
|
|
3719
|
+
var _comboBoxState_valueChangedEvent, _comboBoxState_propertiesChangedEvent;
|
|
3720
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_valueChangedEvent = comboBoxState.valueChangedEvent) === null || _comboBoxState_valueChangedEvent === void 0 ? void 0 : _comboBoxState_valueChangedEvent.removeListener(valueListenerId);
|
|
3721
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_propertiesChangedEvent = comboBoxState.propertiesChangedEvent) === null || _comboBoxState_propertiesChangedEvent === void 0 ? void 0 : _comboBoxState_propertiesChangedEvent.removeListener(propertiesListenerId);
|
|
3722
|
+
};
|
|
3723
|
+
}, [
|
|
3724
|
+
window
|
|
3725
|
+
]);
|
|
3726
|
+
var selectedChoices = (_Object_values = Object.values(modSlots)) === null || _Object_values === void 0 ? void 0 : _Object_values.filter(function(item) {
|
|
3727
|
+
return item > 0;
|
|
3728
|
+
});
|
|
3729
|
+
var selectedLabels = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.filter(function(item, i) {
|
|
3730
|
+
return selectedChoices === null || selectedChoices === void 0 ? void 0 : selectedChoices.includes(i);
|
|
3731
|
+
});
|
|
3732
|
+
var displayedLabels = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.filter(function(item) {
|
|
3733
|
+
return !(selectedLabels === null || selectedLabels === void 0 ? void 0 : selectedLabels.includes(item)) || item === automatableParamLabels[value];
|
|
3734
|
+
});
|
|
3735
|
+
var filteredChoices = filter && (filter === null || filter === void 0 ? void 0 : filter.length) > 1 ? displayedLabels === null || displayedLabels === void 0 ? void 0 : displayedLabels.filter(function(item) {
|
|
3736
|
+
var _item_toLowerCase;
|
|
3737
|
+
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());
|
|
3738
|
+
}) : displayedLabels;
|
|
3739
|
+
var prevValue = useRef(null);
|
|
3740
|
+
var handleChange = function(newValue) {
|
|
3741
|
+
if (newValue !== prevValue.current) {
|
|
3742
|
+
var juceIndex = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.indexOf(newValue);
|
|
3743
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.setChoiceIndex(juceIndex);
|
|
3744
|
+
setValue(newValue);
|
|
3745
|
+
onChange && onChange(juceIndex);
|
|
3746
|
+
prevValue.current = juceIndex;
|
|
3747
|
+
}
|
|
3748
|
+
};
|
|
3749
|
+
var onMouseEnter = function() {
|
|
3750
|
+
};
|
|
3751
|
+
return {
|
|
3752
|
+
value: value,
|
|
3753
|
+
valueString: automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels[value],
|
|
3754
|
+
setValue: setValue,
|
|
3755
|
+
choices: properties === null || properties === void 0 ? void 0 : properties.choices,
|
|
3756
|
+
filteredChoices: filteredChoices,
|
|
3757
|
+
onMouseEnter: onMouseEnter,
|
|
3758
|
+
handleChange: handleChange
|
|
3759
|
+
};
|
|
3760
|
+
};
|
|
3580
3761
|
|
|
3581
|
-
function _array_like_to_array$
|
|
3762
|
+
function _array_like_to_array$2(arr, len) {
|
|
3582
3763
|
if (len == null || len > arr.length) len = arr.length;
|
|
3583
3764
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3584
3765
|
return arr2;
|
|
3585
3766
|
}
|
|
3586
|
-
function _array_with_holes$
|
|
3767
|
+
function _array_with_holes$2(arr) {
|
|
3587
3768
|
if (Array.isArray(arr)) return arr;
|
|
3588
3769
|
}
|
|
3589
|
-
function _define_property$
|
|
3770
|
+
function _define_property$4(obj, key, value) {
|
|
3590
3771
|
if (key in obj) {
|
|
3591
3772
|
Object.defineProperty(obj, key, {
|
|
3592
3773
|
value: value,
|
|
@@ -3599,7 +3780,7 @@ function _define_property$3(obj, key, value) {
|
|
|
3599
3780
|
}
|
|
3600
3781
|
return obj;
|
|
3601
3782
|
}
|
|
3602
|
-
function _iterable_to_array_limit$
|
|
3783
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
3603
3784
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3604
3785
|
if (_i == null) return;
|
|
3605
3786
|
var _arr = [];
|
|
@@ -3623,10 +3804,10 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
3623
3804
|
}
|
|
3624
3805
|
return _arr;
|
|
3625
3806
|
}
|
|
3626
|
-
function _non_iterable_rest$
|
|
3807
|
+
function _non_iterable_rest$2() {
|
|
3627
3808
|
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
3809
|
}
|
|
3629
|
-
function _object_spread$
|
|
3810
|
+
function _object_spread$4(target) {
|
|
3630
3811
|
for(var i = 1; i < arguments.length; i++){
|
|
3631
3812
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3632
3813
|
var ownKeys = Object.keys(source);
|
|
@@ -3636,34 +3817,33 @@ function _object_spread$3(target) {
|
|
|
3636
3817
|
}));
|
|
3637
3818
|
}
|
|
3638
3819
|
ownKeys.forEach(function(key) {
|
|
3639
|
-
_define_property$
|
|
3820
|
+
_define_property$4(target, key, source[key]);
|
|
3640
3821
|
});
|
|
3641
3822
|
}
|
|
3642
3823
|
return target;
|
|
3643
3824
|
}
|
|
3644
|
-
function _sliced_to_array$
|
|
3645
|
-
return _array_with_holes$
|
|
3825
|
+
function _sliced_to_array$2(arr, i) {
|
|
3826
|
+
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
3827
|
}
|
|
3647
|
-
function _unsupported_iterable_to_array$
|
|
3828
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
3648
3829
|
if (!o) return;
|
|
3649
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
3830
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
3650
3831
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3651
3832
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3652
3833
|
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$
|
|
3834
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
3654
3835
|
}
|
|
3655
3836
|
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
|
|
3837
|
+
var target = param.target, handleTargetChange = param.handleTargetChange, rowId = param.rowId, key = param.key, color = param.color, style = param.style;
|
|
3838
|
+
var _SingleBarViz_polarity;
|
|
3839
|
+
var _useState = _sliced_to_array$2(useState(), 2), targetValue = _useState[0], setTargetValue = _useState[1];
|
|
3840
|
+
var _useState1 = _sliced_to_array$2(useState(''), 2), filterString = _useState1[0], setFilterString = _useState1[1];
|
|
3841
|
+
var _useGlobalContext = useGlobalContext(), automatableParamLabels = _useGlobalContext.globalState.automatableParamLabels;
|
|
3660
3842
|
var _useCombobox = useCombobox({
|
|
3661
3843
|
id: rowId,
|
|
3662
|
-
items: globalState === null || globalState === void 0 ? void 0 : globalState.automatableParams,
|
|
3663
3844
|
filter: filterString,
|
|
3664
|
-
displayValInHeader: false,
|
|
3665
3845
|
onChange: handleTargetChange
|
|
3666
|
-
}), value = _useCombobox.value,
|
|
3846
|
+
}), value = _useCombobox.value, filteredChoices = _useCombobox.filteredChoices, handleChange = _useCombobox.handleChange;
|
|
3667
3847
|
useEffect(function() {
|
|
3668
3848
|
if (target) {
|
|
3669
3849
|
var sliderState = Juce.getSliderState(target);
|
|
@@ -3673,17 +3853,12 @@ function ModMatrixComboboxCell(param) {
|
|
|
3673
3853
|
}, [
|
|
3674
3854
|
target
|
|
3675
3855
|
]);
|
|
3676
|
-
// useEffect(() => {
|
|
3677
|
-
// console.log(
|
|
3678
|
-
// globalState?.automatableParams,
|
|
3679
|
-
// 'globalState?.automatableParams',
|
|
3680
|
-
// );
|
|
3681
|
-
// });
|
|
3682
3856
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3857
|
+
key: key,
|
|
3683
3858
|
className: "ModMatrixCell ModMatrixComboboxCell",
|
|
3684
3859
|
justifyContent: Box.justifyContent.flexEnd,
|
|
3685
3860
|
flexDirection: Box.flexDirection.column,
|
|
3686
|
-
style: _object_spread$
|
|
3861
|
+
style: _object_spread$4({
|
|
3687
3862
|
color: color
|
|
3688
3863
|
}, style),
|
|
3689
3864
|
padding: [
|
|
@@ -3696,13 +3871,15 @@ function ModMatrixComboboxCell(param) {
|
|
|
3696
3871
|
value: value,
|
|
3697
3872
|
onChange: handleChange
|
|
3698
3873
|
}, /*#__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];
|
|
3874
|
+
displayValue: function(item) {
|
|
3875
|
+
return value ? automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels[value] : '';
|
|
3702
3876
|
},
|
|
3877
|
+
placeholder: "Select a target...",
|
|
3703
3878
|
onChange: function(e) {
|
|
3704
|
-
|
|
3705
|
-
|
|
3879
|
+
var _e_target;
|
|
3880
|
+
setFilterString(e === null || e === void 0 ? void 0 : (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.value);
|
|
3881
|
+
},
|
|
3882
|
+
autoFocus: true
|
|
3706
3883
|
}), /*#__PURE__*/ React__default.createElement(ComboboxButton, {
|
|
3707
3884
|
className: "ModMatrixComboboxButton"
|
|
3708
3885
|
}, /*#__PURE__*/ React__default.createElement(Icon, {
|
|
@@ -3719,20 +3896,14 @@ function ModMatrixComboboxCell(param) {
|
|
|
3719
3896
|
// anchor="bottom"
|
|
3720
3897
|
transition: true
|
|
3721
3898
|
}, 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, {
|
|
3899
|
+
return /*#__PURE__*/ React__default.createElement(ComboboxOption, {
|
|
3729
3900
|
className: "ModMatrixComboboxItem",
|
|
3730
3901
|
key: item,
|
|
3731
3902
|
value: item
|
|
3732
|
-
}, /*#__PURE__*/ React__default.createElement(Label, null, item
|
|
3903
|
+
}, /*#__PURE__*/ React__default.createElement(Label, null, item));
|
|
3733
3904
|
}))), /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
3734
3905
|
value: targetValue,
|
|
3735
|
-
polarity: SingleBarViz.polarity.linear,
|
|
3906
|
+
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.linear,
|
|
3736
3907
|
background: color,
|
|
3737
3908
|
style: {
|
|
3738
3909
|
alignSelf: 'flex-end'
|
|
@@ -3740,6 +3911,65 @@ function ModMatrixComboboxCell(param) {
|
|
|
3740
3911
|
}));
|
|
3741
3912
|
}
|
|
3742
3913
|
|
|
3914
|
+
function _define_property$3(obj, key, value) {
|
|
3915
|
+
if (key in obj) {
|
|
3916
|
+
Object.defineProperty(obj, key, {
|
|
3917
|
+
value: value,
|
|
3918
|
+
enumerable: true,
|
|
3919
|
+
configurable: true,
|
|
3920
|
+
writable: true
|
|
3921
|
+
});
|
|
3922
|
+
} else {
|
|
3923
|
+
obj[key] = value;
|
|
3924
|
+
}
|
|
3925
|
+
return obj;
|
|
3926
|
+
}
|
|
3927
|
+
function _object_spread$3(target) {
|
|
3928
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3929
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3930
|
+
var ownKeys = Object.keys(source);
|
|
3931
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3932
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3933
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3934
|
+
}));
|
|
3935
|
+
}
|
|
3936
|
+
ownKeys.forEach(function(key) {
|
|
3937
|
+
_define_property$3(target, key, source[key]);
|
|
3938
|
+
});
|
|
3939
|
+
}
|
|
3940
|
+
return target;
|
|
3941
|
+
}
|
|
3942
|
+
function ModMatrixToggleCell(param) {
|
|
3943
|
+
var modifier = param.modifier, color = param.color, style = param.style;
|
|
3944
|
+
var _useDropdown = useDropdown({
|
|
3945
|
+
id: modifier
|
|
3946
|
+
}), index = _useDropdown.index, choices = _useDropdown.choices, handleChange = _useDropdown.handleChange;
|
|
3947
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3948
|
+
className: "ModMatrixCell ModMatrixToggleCell",
|
|
3949
|
+
justifyContent: Box.justifyContent.flexEnd,
|
|
3950
|
+
alignItems: Box.alignItems.flexStart,
|
|
3951
|
+
flexDirection: Box.flexDirection.column,
|
|
3952
|
+
style: _object_spread$3({
|
|
3953
|
+
color: color,
|
|
3954
|
+
pointerEvents: 'all'
|
|
3955
|
+
}, style),
|
|
3956
|
+
height: '2.5rem',
|
|
3957
|
+
onClick: function() {
|
|
3958
|
+
var newIndex = Math.abs(index - 1);
|
|
3959
|
+
handleChange(choices[newIndex]);
|
|
3960
|
+
}
|
|
3961
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3962
|
+
flex: "1",
|
|
3963
|
+
style: {
|
|
3964
|
+
pointerEvents: 'none'
|
|
3965
|
+
}
|
|
3966
|
+
}, /*#__PURE__*/ React__default.createElement(Label, {
|
|
3967
|
+
style: {
|
|
3968
|
+
pointerEvents: 'none'
|
|
3969
|
+
}
|
|
3970
|
+
}, Object.keys(Polarity)[index] || '0')));
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3743
3973
|
function _define_property$2(obj, key, value) {
|
|
3744
3974
|
if (key in obj) {
|
|
3745
3975
|
Object.defineProperty(obj, key, {
|
|
@@ -3769,7 +3999,8 @@ function _object_spread$2(target) {
|
|
|
3769
3999
|
return target;
|
|
3770
4000
|
}
|
|
3771
4001
|
function ModMatrixCell(param) {
|
|
3772
|
-
|
|
4002
|
+
var modifier = param.modifier, color = param.color, style = param.style;
|
|
4003
|
+
var _SingleBarViz_polarity;
|
|
3773
4004
|
var _useSlider = useSlider({
|
|
3774
4005
|
id: modifier,
|
|
3775
4006
|
displayValInHeader: false
|
|
@@ -3797,73 +4028,52 @@ function ModMatrixCell(param) {
|
|
|
3797
4028
|
}
|
|
3798
4029
|
}, /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
3799
4030
|
value: (modifier === null || modifier === void 0 ? void 0 : modifier.value) || 0,
|
|
3800
|
-
polarity: SingleBarViz.polarity.linear,
|
|
4031
|
+
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.linear,
|
|
3801
4032
|
background: color,
|
|
3802
4033
|
style: _object_spread$2({
|
|
3803
4034
|
alignSelf: 'flex-end',
|
|
3804
4035
|
pointerEvents: 'none'
|
|
3805
4036
|
}, getBarTransformStyles({
|
|
3806
|
-
orientation: Orientation.horizontal,
|
|
3807
|
-
polarity: Polarity.linear,
|
|
3808
|
-
value: parseFloat(scaledNormalisedValue.toFixed(2))
|
|
4037
|
+
orientation: Orientation === null || Orientation === void 0 ? void 0 : Orientation.horizontal,
|
|
4038
|
+
polarity: Polarity === null || Polarity === void 0 ? void 0 : Polarity.linear,
|
|
4039
|
+
value: parseFloat(scaledNormalisedValue === null || scaledNormalisedValue === void 0 ? void 0 : scaledNormalisedValue.toFixed(2))
|
|
3809
4040
|
}))
|
|
3810
4041
|
})));
|
|
3811
4042
|
}
|
|
3812
4043
|
|
|
3813
|
-
function
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
function
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
4044
|
+
function ModMatrixRow(param) {
|
|
4045
|
+
var rowId = param.rowId, key = param.key, _param_isPreview = param.// rowIndex,
|
|
4046
|
+
isPreview, isPreview = _param_isPreview === void 0 ? false : _param_isPreview, setIsPreview = param.setIsPreview;
|
|
4047
|
+
var _Object_keys, _modSlotParams_modSlotIndex;
|
|
4048
|
+
// const [rowTarget, setRowTarget] = useState<number>();
|
|
4049
|
+
// const getModSlotsFunc = Juce.getNativeFunction('getModSlots');
|
|
4050
|
+
var _useGlobalContext = useGlobalContext(), modSlotUpdated = _useGlobalContext.modSlotUpdated, _useGlobalContext_globalState = _useGlobalContext.globalState, modSlotParams = _useGlobalContext_globalState.modSlotParams, modSlots = _useGlobalContext_globalState.modSlots;
|
|
4051
|
+
var modSlotIndex = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.indexOf(rowId);
|
|
4052
|
+
var handleTargetChange = function(newTarget) {
|
|
4053
|
+
if (newTarget > 0) {
|
|
4054
|
+
modSlotUpdated([
|
|
4055
|
+
rowId,
|
|
4056
|
+
newTarget
|
|
4057
|
+
]);
|
|
4058
|
+
} else {
|
|
4059
|
+
var _modSlotParams_modSlotIndex;
|
|
4060
|
+
modSlotUpdated([
|
|
4061
|
+
rowId,
|
|
4062
|
+
0
|
|
4063
|
+
]);
|
|
4064
|
+
modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex.forEach(function(item) {
|
|
4065
|
+
var sliderState = Juce.getSliderState(item);
|
|
4066
|
+
sliderState === null || sliderState === void 0 ? void 0 : sliderState.setNormalisedValue(0);
|
|
4067
|
+
});
|
|
3832
4068
|
}
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
_e = err;
|
|
3836
|
-
} finally{
|
|
3837
|
-
try {
|
|
3838
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
3839
|
-
} finally{
|
|
3840
|
-
if (_d) throw _e;
|
|
4069
|
+
if (isPreview && newTarget) {
|
|
4070
|
+
setIsPreview(false);
|
|
3841
4071
|
}
|
|
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;
|
|
4072
|
+
};
|
|
3864
4073
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3865
4074
|
className: "ModMatrixBodyRow",
|
|
3866
|
-
gap: Box.gap.medium
|
|
4075
|
+
gap: Box.gap.medium,
|
|
4076
|
+
key: key
|
|
3867
4077
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3868
4078
|
className: "ModMatrixBodyCell ModMatrixComboboxCell",
|
|
3869
4079
|
justifyContent: Box.justifyContent.flexStart,
|
|
@@ -3872,24 +4082,28 @@ function ModMatrixRow(param) {
|
|
|
3872
4082
|
color: targetColors[0]
|
|
3873
4083
|
}
|
|
3874
4084
|
}, /*#__PURE__*/ React__default.createElement(ModMatrixComboboxCell, {
|
|
3875
|
-
target:
|
|
3876
|
-
handleTargetChange:
|
|
4085
|
+
target: modSlots[rowId],
|
|
4086
|
+
handleTargetChange: handleTargetChange,
|
|
3877
4087
|
rowId: rowId,
|
|
3878
4088
|
color: targetColors[0],
|
|
3879
4089
|
style: {
|
|
3880
4090
|
width: ComboboxCellWidth
|
|
3881
|
-
}
|
|
3882
|
-
|
|
3883
|
-
|
|
4091
|
+
},
|
|
4092
|
+
key: rowId
|
|
4093
|
+
})), 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) {
|
|
4094
|
+
var _modSlotParams_modSlotIndex, _modSlotParams_modSlotIndex1;
|
|
3884
4095
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3885
4096
|
className: "ModMatrixBodyCell",
|
|
3886
4097
|
flexDirection: Box.flexDirection.column,
|
|
3887
4098
|
style: {
|
|
3888
4099
|
color: targetColors[i + 1]
|
|
3889
|
-
}
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
modifier:
|
|
4100
|
+
},
|
|
4101
|
+
key: item
|
|
4102
|
+
}, i !== arr.length - 1 ? /*#__PURE__*/ React__default.createElement(ModMatrixCell, {
|
|
4103
|
+
modifier: modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex[i],
|
|
4104
|
+
color: targetColors[i + 1]
|
|
4105
|
+
}) : /*#__PURE__*/ React__default.createElement(ModMatrixToggleCell, {
|
|
4106
|
+
modifier: modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex1 = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex1 === void 0 ? void 0 : _modSlotParams_modSlotIndex1[i],
|
|
3893
4107
|
color: targetColors[i + 1]
|
|
3894
4108
|
}));
|
|
3895
4109
|
}));
|
|
@@ -4101,77 +4315,105 @@ function _ts_generator$1(thisArg, body) {
|
|
|
4101
4315
|
};
|
|
4102
4316
|
}
|
|
4103
4317
|
}
|
|
4104
|
-
|
|
4318
|
+
//
|
|
4319
|
+
function ModMatrix(param) {
|
|
4105
4320
|
var className = param.className, style = param.style;
|
|
4106
|
-
var
|
|
4107
|
-
var
|
|
4108
|
-
var
|
|
4109
|
-
var
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4321
|
+
var _Object_keys, _Object_keys1, _Object_keys2;
|
|
4322
|
+
var _useState = _sliced_to_array$1(useState(), 2), previewRowIsActive = _useState[0], setPreviewRowIsActive = _useState[1];
|
|
4323
|
+
var getAutomatableParamsListFunc = Juce.getNativeFunction('getAutomatableParamsList');
|
|
4324
|
+
var getAllModSlotsFunc = Juce.getNativeFunction('getAllModSlots');
|
|
4325
|
+
var getModSlotParamsFunc = Juce.getNativeFunction('getModSlotParams');
|
|
4326
|
+
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;
|
|
4327
|
+
var getAPVTSParams = function() {
|
|
4328
|
+
return _async_to_generator$1(function() {
|
|
4329
|
+
var automatableParamsList, modSlotsData, modSlotParams, e;
|
|
4330
|
+
return _ts_generator$1(this, function(_state) {
|
|
4331
|
+
switch(_state.label){
|
|
4332
|
+
case 0:
|
|
4333
|
+
_state.trys.push([
|
|
4334
|
+
0,
|
|
4335
|
+
4,
|
|
4336
|
+
,
|
|
4337
|
+
5
|
|
4338
|
+
]);
|
|
4339
|
+
return [
|
|
4340
|
+
4,
|
|
4341
|
+
getAutomatableParamsListFunc()
|
|
4342
|
+
];
|
|
4343
|
+
case 1:
|
|
4344
|
+
automatableParamsList = _state.sent();
|
|
4345
|
+
return [
|
|
4346
|
+
4,
|
|
4347
|
+
getAllModSlotsFunc()
|
|
4348
|
+
];
|
|
4349
|
+
case 2:
|
|
4350
|
+
modSlotsData = _state.sent();
|
|
4351
|
+
return [
|
|
4352
|
+
4,
|
|
4353
|
+
getModSlotParamsFunc()
|
|
4354
|
+
];
|
|
4355
|
+
case 3:
|
|
4356
|
+
modSlotParams = _state.sent();
|
|
4357
|
+
automatableParamsListReceived(automatableParamsList === null || automatableParamsList === void 0 ? void 0 : automatableParamsList[0]);
|
|
4358
|
+
automatableParamLabelsReceived(automatableParamsList === null || automatableParamsList === void 0 ? void 0 : automatableParamsList[1]);
|
|
4359
|
+
modSlotsReceived(modSlotsData || []);
|
|
4360
|
+
modSlotParamsListReceived(modSlotParams === null || modSlotParams === void 0 ? void 0 : modSlotParams[0]);
|
|
4361
|
+
modSlotParamLabelsReceived(modSlotParams === null || modSlotParams === void 0 ? void 0 : modSlotParams[1]);
|
|
4362
|
+
return [
|
|
4363
|
+
3,
|
|
4364
|
+
5
|
|
4365
|
+
];
|
|
4366
|
+
case 4:
|
|
4367
|
+
e = _state.sent();
|
|
4368
|
+
console.log(e);
|
|
4369
|
+
return [
|
|
4370
|
+
3,
|
|
4371
|
+
5
|
|
4372
|
+
];
|
|
4373
|
+
case 5:
|
|
4374
|
+
return [
|
|
4375
|
+
2
|
|
4376
|
+
];
|
|
4377
|
+
}
|
|
4378
|
+
});
|
|
4379
|
+
})();
|
|
4380
|
+
};
|
|
4117
4381
|
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
4382
|
getAPVTSParams();
|
|
4161
4383
|
}, [
|
|
4162
4384
|
window
|
|
4163
4385
|
]);
|
|
4164
4386
|
useEffect(function() {
|
|
4387
|
+
var _Object_keys;
|
|
4388
|
+
var assignedModSlots = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(item) {
|
|
4389
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0;
|
|
4390
|
+
});
|
|
4165
4391
|
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]);
|
|
4392
|
+
setPreviewRowIsActive(true);
|
|
4168
4393
|
}
|
|
4169
4394
|
}, [
|
|
4170
|
-
|
|
4395
|
+
modSlots
|
|
4171
4396
|
]);
|
|
4172
4397
|
var headers = [
|
|
4173
4398
|
'Target'
|
|
4174
|
-
].concat(_to_consumable_array(
|
|
4399
|
+
].concat(_to_consumable_array(modSlotParamLabels));
|
|
4400
|
+
// [slot2, slot3] unassigned
|
|
4401
|
+
// [slot1] assigned
|
|
4402
|
+
var assignedModSlots = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(item) {
|
|
4403
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0;
|
|
4404
|
+
});
|
|
4405
|
+
var unassignedModSlots = (_Object_keys1 = Object.keys(modSlots)) === null || _Object_keys1 === void 0 ? void 0 : _Object_keys1.filter(function(item) {
|
|
4406
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) === 0;
|
|
4407
|
+
});
|
|
4408
|
+
var displayedModSlots = (_Object_keys2 = Object.keys(modSlots)) === null || _Object_keys2 === void 0 ? void 0 : _Object_keys2.reduce(function(acc, item) {
|
|
4409
|
+
if ((modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0 || previewRowIsActive && item === (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots[0])) {
|
|
4410
|
+
return _to_consumable_array(acc).concat([
|
|
4411
|
+
item
|
|
4412
|
+
]);
|
|
4413
|
+
} else {
|
|
4414
|
+
return _to_consumable_array(acc);
|
|
4415
|
+
}
|
|
4416
|
+
}, []);
|
|
4175
4417
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4176
4418
|
gap: Box.gap.medium,
|
|
4177
4419
|
padding: [
|
|
@@ -4186,12 +4428,13 @@ function ModuleFooter$1(param) {
|
|
|
4186
4428
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
4187
4429
|
className: "ModMatrixHeader",
|
|
4188
4430
|
gap: Box.gap.medium
|
|
4189
|
-
}, headers.map(function(item, i) {
|
|
4431
|
+
}, headers === null || headers === void 0 ? void 0 : headers.map(function(item, i) {
|
|
4190
4432
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4191
4433
|
style: {
|
|
4192
4434
|
color: targetColors[i],
|
|
4193
4435
|
flex: i === 0 ? "0 0 ".concat(ComboboxCellWidth) : 'initial'
|
|
4194
4436
|
},
|
|
4437
|
+
key: item,
|
|
4195
4438
|
className: "ModMatrixHeaderCell",
|
|
4196
4439
|
padding: [
|
|
4197
4440
|
Box.padding.medium,
|
|
@@ -4202,19 +4445,15 @@ function ModuleFooter$1(param) {
|
|
|
4202
4445
|
className: "ModMatrixBody",
|
|
4203
4446
|
gap: Box.gap.medium,
|
|
4204
4447
|
flexDirection: Box.flexDirection.column
|
|
4205
|
-
}, (
|
|
4448
|
+
}, (displayedModSlots === null || displayedModSlots === void 0 ? void 0 : displayedModSlots.length) ? displayedModSlots === null || displayedModSlots === void 0 ? void 0 : displayedModSlots.map(function(item, i) {
|
|
4206
4449
|
return /*#__PURE__*/ React__default.createElement(ModMatrixRow, {
|
|
4207
4450
|
rowId: item,
|
|
4208
|
-
|
|
4451
|
+
key: item,
|
|
4452
|
+
// rowIndex={i}
|
|
4453
|
+
setIsPreview: setPreviewRowIsActive,
|
|
4454
|
+
isPreview: previewRowIsActive && (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.indexOf(item)) === 0
|
|
4209
4455
|
});
|
|
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, {
|
|
4456
|
+
}) : null), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4218
4457
|
justifyContent: Box.justifyContent.flexStart
|
|
4219
4458
|
}, /*#__PURE__*/ React__default.createElement(IconButton, {
|
|
4220
4459
|
id: "addModMatrixRow",
|
|
@@ -4225,13 +4464,86 @@ function ModuleFooter$1(param) {
|
|
|
4225
4464
|
padding: [
|
|
4226
4465
|
IconButton.padding.small
|
|
4227
4466
|
],
|
|
4467
|
+
disabled: (assignedModSlots === null || assignedModSlots === void 0 ? void 0 : assignedModSlots.length) === 0 || (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.length) === 0,
|
|
4228
4468
|
// color="var(--color-gray-500)"
|
|
4229
4469
|
// backgroundColor="transparent"
|
|
4230
|
-
onClick: function(e) {
|
|
4470
|
+
onClick: function(e) {
|
|
4471
|
+
if ((unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.length) > 0) {
|
|
4472
|
+
setPreviewRowIsActive(true);
|
|
4473
|
+
}
|
|
4474
|
+
}
|
|
4231
4475
|
})));
|
|
4232
4476
|
}
|
|
4233
4477
|
|
|
4234
|
-
|
|
4478
|
+
function LFOTab() {
|
|
4479
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4480
|
+
className: "LFOTab"
|
|
4481
|
+
}, /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4482
|
+
labelColor: "var(--color-text)",
|
|
4483
|
+
color: "var(--color-brand)",
|
|
4484
|
+
id: "LFO1_Wave",
|
|
4485
|
+
label: "LFO1 Wave"
|
|
4486
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4487
|
+
labelColor: "var(--color-text)",
|
|
4488
|
+
id: "LFO1_Hz",
|
|
4489
|
+
label: "LFO1 Hz",
|
|
4490
|
+
color: "var(--color-brand)"
|
|
4491
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4492
|
+
labelColor: "var(--color-text)",
|
|
4493
|
+
id: "LFO1_Hz_Hi",
|
|
4494
|
+
label: "LFO1 Hz Hi",
|
|
4495
|
+
color: "var(--color-brand)"
|
|
4496
|
+
}), /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4497
|
+
labelColor: "var(--color-text)",
|
|
4498
|
+
color: "var(--color-brand)",
|
|
4499
|
+
id: "LFO1_SyncRate",
|
|
4500
|
+
label: "LFO1 Sync Rate"
|
|
4501
|
+
}), /*#__PURE__*/ React__default.createElement(Dropdown, {
|
|
4502
|
+
labelColor: "var(--color-text)",
|
|
4503
|
+
color: "var(--color-brand)",
|
|
4504
|
+
id: "LFO1_SyncType",
|
|
4505
|
+
label: "LFO1 Sync Type"
|
|
4506
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4507
|
+
color: "var(--color-brand)",
|
|
4508
|
+
labelColor: "var(--color-text)",
|
|
4509
|
+
id: "LFO1_Sixteenths",
|
|
4510
|
+
label: "LFO1 Sixteenths"
|
|
4511
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4512
|
+
color: "var(--color-brand)",
|
|
4513
|
+
labelColor: "var(--color-text)",
|
|
4514
|
+
id: "LFO1_Thirds",
|
|
4515
|
+
label: "LFO1 Thirds"
|
|
4516
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4517
|
+
color: "var(--color-brand)",
|
|
4518
|
+
labelColor: "var(--color-text)",
|
|
4519
|
+
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
4520
|
+
id: "LFO1_Sync_Offset",
|
|
4521
|
+
label: "LFO1 Sync Offset"
|
|
4522
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4523
|
+
color: "var(--color-brand)",
|
|
4524
|
+
labelColor: "var(--color-text)",
|
|
4525
|
+
polarity: RotarySlider.sliderPolarity.bipolar,
|
|
4526
|
+
id: "LFO1_Phase",
|
|
4527
|
+
label: "LFO1 Phase"
|
|
4528
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4529
|
+
color: "var(--color-brand)",
|
|
4530
|
+
labelColor: "var(--color-text)",
|
|
4531
|
+
id: "LFO1_Width",
|
|
4532
|
+
label: "LFO1 Width"
|
|
4533
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4534
|
+
color: "var(--color-brand)",
|
|
4535
|
+
labelColor: "var(--color-text)",
|
|
4536
|
+
id: "LFO1_Amp",
|
|
4537
|
+
label: "LFO1 Amp"
|
|
4538
|
+
}), /*#__PURE__*/ React__default.createElement(RotarySlider, {
|
|
4539
|
+
color: "var(--color-brand)",
|
|
4540
|
+
labelColor: "var(--color-text)",
|
|
4541
|
+
id: "LFO1_Rand",
|
|
4542
|
+
label: "LFO1 Rand"
|
|
4543
|
+
}));
|
|
4544
|
+
}
|
|
4545
|
+
|
|
4546
|
+
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
4547
|
styleInject(css_248z);
|
|
4236
4548
|
|
|
4237
4549
|
function _array_like_to_array(arr, len) {
|
|
@@ -4437,14 +4749,11 @@ var FooterTabs = /*#__PURE__*/ function(FooterTabs) {
|
|
|
4437
4749
|
return FooterTabs;
|
|
4438
4750
|
}({});
|
|
4439
4751
|
var ModMatrixTab = function() {
|
|
4440
|
-
return /*#__PURE__*/ React__default.createElement(
|
|
4752
|
+
return /*#__PURE__*/ React__default.createElement(ModMatrix, null);
|
|
4441
4753
|
};
|
|
4442
4754
|
var InputModTab = function() {
|
|
4443
4755
|
return /*#__PURE__*/ React__default.createElement(Box, null, "InputModTab");
|
|
4444
4756
|
};
|
|
4445
|
-
var LFOsTab = function() {
|
|
4446
|
-
return /*#__PURE__*/ React__default.createElement(Box, null, "LFOsTab");
|
|
4447
|
-
};
|
|
4448
4757
|
var SequencerTab = function() {
|
|
4449
4758
|
return /*#__PURE__*/ React__default.createElement(Box, null, "SequencerTab");
|
|
4450
4759
|
};
|
|
@@ -4561,7 +4870,7 @@ function ModuleFooter(param) {
|
|
|
4561
4870
|
padding: [
|
|
4562
4871
|
Box.padding.large
|
|
4563
4872
|
]
|
|
4564
|
-
}, isTabSelected("ModMatrix") ? /*#__PURE__*/ React__default.createElement(ModMatrixTab, null) : '', isTabSelected("InputMod") ? /*#__PURE__*/ React__default.createElement(InputModTab, null) : '', isTabSelected("LFOs") ? /*#__PURE__*/ React__default.createElement(
|
|
4873
|
+
}, isTabSelected("ModMatrix") ? /*#__PURE__*/ React__default.createElement(ModMatrixTab, null) : '', isTabSelected("InputMod") ? /*#__PURE__*/ React__default.createElement(InputModTab, null) : '', isTabSelected("LFOs") ? /*#__PURE__*/ React__default.createElement(LFOTab, null) : '', isTabSelected("Sequencer") ? /*#__PURE__*/ React__default.createElement(SequencerTab, null) : '', isTabSelected("Settings") ? /*#__PURE__*/ React__default.createElement(SettingsTab, null) : '')));
|
|
4565
4874
|
}
|
|
4566
4875
|
|
|
4567
4876
|
export { Slider as BarSlider, Box, Button, Dropdown, FontSizes, GlobalContextProvider, Heading, IconButton, IndicatorLight, Input, KeyValueDisplayScreen, Label, ModuleFooter, ModuleHeader, Oscilloscope, RotarySlider, SliderValue, Spacing, Tabs, clamp, decimalToPercent, defaultGlobalStateValue as defaultValue, normalisedToScaled, percentToDecimal, randomizeValue, scaledToNormalised as scaledTonormalised, useGlobalContext, useObservable, useSlider };
|