@antimatter-audio/antimatter-ui 10.1.2 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced/IconButton/IconButton.d.ts +25 -0
- package/dist/advanced/IconButton/IconButton.d.ts.map +1 -0
- package/dist/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts +12 -0
- package/dist/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts.map +1 -0
- package/dist/advanced/ModMatrix/ModMatrix.d.ts +8 -0
- package/dist/advanced/ModMatrix/ModMatrix.d.ts.map +1 -0
- package/dist/advanced/ModMatrix/ModMatrixCell.d.ts +10 -0
- package/dist/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -0
- package/dist/advanced/ModMatrix/ModMatrixComboboxCell.d.ts +11 -0
- package/dist/advanced/ModMatrix/ModMatrixComboboxCell.d.ts.map +1 -0
- package/dist/advanced/ModMatrix/ModMatrixRow.d.ts +9 -0
- package/dist/advanced/ModMatrix/ModMatrixRow.d.ts.map +1 -0
- 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 +3 -0
- package/dist/advanced/ModMatrix/constants.d.ts.map +1 -0
- package/dist/advanced/ModuleFooter/ModuleFooter.d.ts +20 -0
- package/dist/advanced/ModuleFooter/ModuleFooter.d.ts.map +1 -0
- package/dist/advanced/ModuleHeader/ModuleHeader.d.ts.map +1 -1
- package/dist/advanced/PresetManager/PresetManager.d.ts.map +1 -1
- package/dist/common/types.d.ts +61 -0
- package/dist/common/types.d.ts.map +1 -0
- package/dist/common/utils.d.ts +39 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/context/GlobalContextProvider.d.ts +48 -0
- package/dist/context/GlobalContextProvider.d.ts.map +1 -0
- package/dist/core/Box/Box.d.ts +52 -0
- package/dist/core/Box/Box.d.ts.map +1 -0
- package/dist/core/Button/Button.d.ts +26 -0
- package/dist/core/Button/Button.d.ts.map +1 -0
- package/dist/core/DataViz/SingleBarViz.d.ts +16 -0
- package/dist/core/DataViz/SingleBarViz.d.ts.map +1 -0
- package/dist/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/core/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/core/Heading/Heading.d.ts +20 -0
- package/dist/core/Heading/Heading.d.ts.map +1 -0
- package/dist/core/Icon/Icon.d.ts +91 -0
- package/dist/core/Icon/Icon.d.ts.map +1 -0
- package/dist/core/Indicators/IndicatorLight.d.ts +12 -0
- package/dist/core/Indicators/IndicatorLight.d.ts.map +1 -0
- package/dist/core/Input/Input.d.ts +26 -0
- package/dist/core/Input/Input.d.ts.map +1 -0
- package/dist/core/Label/Label.d.ts +18 -0
- package/dist/core/Label/Label.d.ts.map +1 -0
- package/dist/core/Matrix/Matrix.d.ts +14 -0
- package/dist/core/Matrix/Matrix.d.ts.map +1 -0
- package/dist/core/Slider/BarSlider.d.ts +31 -0
- package/dist/core/Slider/BarSlider.d.ts.map +1 -0
- package/dist/core/Slider/RotarySlider.d.ts +29 -0
- package/dist/core/Slider/RotarySlider.d.ts.map +1 -0
- package/dist/core/Slider/SliderValue.d.ts +14 -0
- package/dist/core/Slider/SliderValue.d.ts.map +1 -0
- package/dist/core/Slider/types.d.ts +33 -0
- package/dist/core/Slider/types.d.ts.map +1 -0
- package/dist/core/Slider/utils.d.ts +17 -0
- package/dist/core/Slider/utils.d.ts.map +1 -0
- package/dist/core/Tabs/Tabs.d.ts +21 -0
- package/dist/core/Tabs/Tabs.d.ts.map +1 -0
- package/dist/hooks/useCombobox.d.ts +17 -0
- package/dist/hooks/useCombobox.d.ts.map +1 -0
- package/dist/hooks/useDropdown.d.ts +18 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -0
- package/dist/hooks/useSlider.d.ts +22 -0
- package/dist/hooks/useSlider.d.ts.map +1 -0
- package/dist/index.js +1955 -462
- package/dist/index.js.map +1 -1
- package/dist/src/advanced/IconButton/IconButton.d.ts +3 -33
- package/dist/src/advanced/IconButton/IconButton.d.ts.map +1 -1
- package/dist/src/advanced/KeyValueDisplayScreen/KeyValueDisplayScreen.d.ts.map +1 -1
- package/dist/src/advanced/ModMatrix/ModMatrix.d.ts +8 -0
- package/dist/src/advanced/ModMatrix/ModMatrix.d.ts.map +1 -0
- package/dist/src/advanced/ModMatrix/ModMatrixCell.d.ts +8 -0
- package/dist/src/advanced/ModMatrix/ModMatrixCell.d.ts.map +1 -0
- package/dist/src/advanced/ModMatrix/ModMatrixComboboxCell.d.ts +11 -0
- package/dist/src/advanced/ModMatrix/ModMatrixComboboxCell.d.ts.map +1 -0
- package/dist/src/advanced/ModMatrix/ModMatrixRow.d.ts +9 -0
- package/dist/src/advanced/ModMatrix/ModMatrixRow.d.ts.map +1 -0
- 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 +3 -0
- package/dist/src/advanced/ModMatrix/constants.d.ts.map +1 -0
- package/dist/src/advanced/ModuleFooter/ModuleFooter.d.ts +13 -0
- package/dist/src/advanced/ModuleFooter/ModuleFooter.d.ts.map +1 -1
- package/dist/src/advanced/ModuleHeader/ModuleHeader.d.ts.map +1 -1
- package/dist/src/advanced/PresetManager/PresetManager.d.ts.map +1 -1
- package/dist/src/common/types.d.ts +8 -0
- package/dist/src/common/types.d.ts.map +1 -1
- package/dist/src/common/utils.d.ts +24 -1
- package/dist/src/common/utils.d.ts.map +1 -1
- package/dist/src/context/GlobalContextProvider.d.ts +30 -2
- package/dist/src/context/GlobalContextProvider.d.ts.map +1 -1
- package/dist/src/core/Box/Box.d.ts +1 -1
- package/dist/src/core/Box/Box.d.ts.map +1 -1
- package/dist/src/core/DataViz/SingleBarViz.d.ts +16 -0
- package/dist/src/core/DataViz/SingleBarViz.d.ts.map +1 -0
- package/dist/src/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/src/core/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/core/Icon/Icon.d.ts +91 -0
- package/dist/src/core/Icon/Icon.d.ts.map +1 -0
- package/dist/src/core/Slider/BarSlider.d.ts +6 -5
- package/dist/src/core/Slider/BarSlider.d.ts.map +1 -1
- package/dist/src/core/Slider/RotarySlider.d.ts +4 -4
- package/dist/src/core/Slider/RotarySlider.d.ts.map +1 -1
- package/dist/src/core/Slider/types.d.ts +0 -8
- package/dist/src/core/Slider/types.d.ts.map +1 -1
- package/dist/src/core/Slider/utils.d.ts +1 -34
- package/dist/src/core/Slider/utils.d.ts.map +1 -1
- package/dist/src/core/Tabs/Tabs.d.ts +3 -1
- package/dist/src/core/Tabs/Tabs.d.ts.map +1 -1
- package/dist/src/hooks/useCombobox.d.ts +6 -4
- package/dist/src/hooks/useCombobox.d.ts.map +1 -1
- package/dist/src/hooks/useDropdown.d.ts +18 -0
- package/dist/src/hooks/useDropdown.d.ts.map +1 -0
- package/dist/src/hooks/useSlider.d.ts +6 -5
- package/dist/src/hooks/useSlider.d.ts.map +1 -1
- package/dist/src/hooks/useTabs.d.ts +6 -9
- package/dist/src/hooks/useTabs.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -3
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { useState, useEffect, useRef, useReducer, useCallback, createContext, useContext } from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import { TabGroup, TabList, Tab, Listbox, ListboxButton, ListboxOptions, ListboxOption } from '@headlessui/react';
|
|
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';
|
|
6
6
|
import { useDrag } from '@use-gesture/react';
|
|
7
|
-
import { v4 } from 'uuid';
|
|
8
7
|
import * as d3 from 'd3';
|
|
9
8
|
|
|
10
9
|
function styleInject(css, ref) {
|
|
@@ -34,8 +33,8 @@ function styleInject(css, ref) {
|
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
var css_248z$
|
|
38
|
-
styleInject(css_248z$
|
|
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 border: none;\n outline: none;\n}\n\nbutton:disabled,\ninput:disabled {\n cursor: not-allowed;\n}\n\n@font-face {\n font-family: LeagueSpartan;\n /* ascent-override: 70%; */\n src: url('./common/assets/fonts/LeagueSpartan-Regular.ttf');\n}\n\n@font-face {\n font-family: LeagueSpartan;\n /* ascent-override: 70%; */\n src: url('./common/assets/fonts/LeagueSpartan-Thin.ttf');\n font-weight: lighter;\n}\n";
|
|
37
|
+
styleInject(css_248z$b);
|
|
39
38
|
|
|
40
39
|
var Spacing = /*#__PURE__*/ function(Spacing) {
|
|
41
40
|
Spacing["none"] = "none";
|
|
@@ -83,19 +82,29 @@ var FontSizes = /*#__PURE__*/ function(FontSizes) {
|
|
|
83
82
|
FontSizes["title"] = "title";
|
|
84
83
|
return FontSizes;
|
|
85
84
|
}({});
|
|
85
|
+
var Polarity = /*#__PURE__*/ function(Polarity) {
|
|
86
|
+
Polarity["linear"] = "linear";
|
|
87
|
+
Polarity["bipolar"] = "bipolar";
|
|
88
|
+
return Polarity;
|
|
89
|
+
}({});
|
|
90
|
+
var Orientation = /*#__PURE__*/ function(Orientation) {
|
|
91
|
+
Orientation["vertical"] = "vertical";
|
|
92
|
+
Orientation["horizontal"] = "horizontal";
|
|
93
|
+
return Orientation;
|
|
94
|
+
}({});
|
|
86
95
|
|
|
87
|
-
var css_248z$
|
|
88
|
-
styleInject(css_248z$
|
|
96
|
+
var css_248z$a = ".Tabs {\n display: flex;\n font-size: 1rem;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-transform: uppercase;\n text-align: center;\n border: 0;\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.Tabs-item {\n &:disabled {\n cursor: not-allowed;\n }\n}\n\n.Tabs-item::-moz-selection {\n background: transparent;\n}\n.Tabs-item::selection {\n background: transparent;\n}\n";
|
|
97
|
+
styleInject(css_248z$a);
|
|
89
98
|
|
|
90
|
-
function _array_like_to_array$
|
|
99
|
+
function _array_like_to_array$d(arr, len) {
|
|
91
100
|
if (len == null || len > arr.length) len = arr.length;
|
|
92
101
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
93
102
|
return arr2;
|
|
94
103
|
}
|
|
95
|
-
function _array_with_holes$
|
|
104
|
+
function _array_with_holes$d(arr) {
|
|
96
105
|
if (Array.isArray(arr)) return arr;
|
|
97
106
|
}
|
|
98
|
-
function _iterable_to_array_limit$
|
|
107
|
+
function _iterable_to_array_limit$d(arr, i) {
|
|
99
108
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
100
109
|
if (_i == null) return;
|
|
101
110
|
var _arr = [];
|
|
@@ -119,27 +128,27 @@ function _iterable_to_array_limit$9(arr, i) {
|
|
|
119
128
|
}
|
|
120
129
|
return _arr;
|
|
121
130
|
}
|
|
122
|
-
function _non_iterable_rest$
|
|
131
|
+
function _non_iterable_rest$d() {
|
|
123
132
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
124
133
|
}
|
|
125
|
-
function _sliced_to_array$
|
|
126
|
-
return _array_with_holes$
|
|
134
|
+
function _sliced_to_array$d(arr, i) {
|
|
135
|
+
return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$d();
|
|
127
136
|
}
|
|
128
|
-
function _unsupported_iterable_to_array$
|
|
137
|
+
function _unsupported_iterable_to_array$d(o, minLen) {
|
|
129
138
|
if (!o) return;
|
|
130
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
139
|
+
if (typeof o === "string") return _array_like_to_array$d(o, minLen);
|
|
131
140
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
132
141
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
133
142
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
134
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
143
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
|
|
135
144
|
}
|
|
136
145
|
function Tabs(param) {
|
|
137
146
|
var items = param.items, className = param.className, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
138
147
|
Spacing.mediumSmall
|
|
139
148
|
] : _param_padding, _param_margin = param.margin, margin = _param_margin === void 0 ? [
|
|
140
149
|
Spacing.none
|
|
141
|
-
] : _param_margin, onChange = param.onChange, selectedIndex = param.selectedIndex;
|
|
142
|
-
var _useState = _sliced_to_array$
|
|
150
|
+
] : _param_margin, gap = param.gap, width = param.width, onChange = param.onChange, selectedIndex = param.selectedIndex;
|
|
151
|
+
var _useState = _sliced_to_array$d(useState(0), 2), selectedItem = _useState[0], setSelectedItem = _useState[1];
|
|
143
152
|
var handleChange = function(index) {
|
|
144
153
|
setSelectedItem(index);
|
|
145
154
|
onChange(index);
|
|
@@ -153,14 +162,18 @@ function Tabs(param) {
|
|
|
153
162
|
marginTop: "var(--mt-".concat(margin[0], ")"),
|
|
154
163
|
marginRight: "var(--mr-".concat((_margin_ = margin[1]) !== null && _margin_ !== void 0 ? _margin_ : margin[0], ")"),
|
|
155
164
|
marginBottom: "var(--mb-".concat((_margin_1 = margin[2]) !== null && _margin_1 !== void 0 ? _margin_1 : margin[0], ")"),
|
|
156
|
-
marginLeft: "var(--ml-".concat((_ref = (_margin_2 = margin[3]) !== null && _margin_2 !== void 0 ? _margin_2 : margin[1]) !== null && _ref !== void 0 ? _ref : margin[0], ")")
|
|
165
|
+
marginLeft: "var(--ml-".concat((_ref = (_margin_2 = margin[3]) !== null && _margin_2 !== void 0 ? _margin_2 : margin[1]) !== null && _ref !== void 0 ? _ref : margin[0], ")"),
|
|
166
|
+
width: width
|
|
157
167
|
},
|
|
158
168
|
selectedIndex: selectedIndex,
|
|
159
169
|
onChange: function(index) {
|
|
160
170
|
return handleChange(index);
|
|
161
171
|
}
|
|
162
172
|
}, /*#__PURE__*/ React__default.createElement(TabList, {
|
|
163
|
-
className: classnames('Tabs', className)
|
|
173
|
+
className: classnames('Tabs', className),
|
|
174
|
+
style: {
|
|
175
|
+
gap: gap
|
|
176
|
+
}
|
|
164
177
|
}, items && items.map(function(item, index) {
|
|
165
178
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
166
179
|
return /*#__PURE__*/ React__default.createElement(Tab, {
|
|
@@ -182,8 +195,8 @@ function Tabs(param) {
|
|
|
182
195
|
Tabs.padding = Spacing;
|
|
183
196
|
Tabs.margin = Spacing;
|
|
184
197
|
|
|
185
|
-
var css_248z$
|
|
186
|
-
styleInject(css_248z$
|
|
198
|
+
var css_248z$9 = ".Button {\n font-size: var(--text-xs);\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: var(--spacing-ms);\n padding-left: var(--spacing-ms);\n cursor: pointer;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-align: enter;\n border: 0;\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n &.xSmall {\n width: var(--spacing-ml);\n height: var(--spacing-ml);\n }\n &.small {\n font-size: var(--text-xs);\n min-width: 1rem;\n min-height: var(--spacing-sm);\n }\n &.large {\n border-radius: var(--radius-sm);\n min-width: 1rem;\n min-height: var(--spacing-xl);\n }\n}\n";
|
|
199
|
+
styleInject(css_248z$9);
|
|
187
200
|
|
|
188
201
|
var ButtonSize = /*#__PURE__*/ function(ButtonSize) {
|
|
189
202
|
ButtonSize["xSmall"] = "xSmall";
|
|
@@ -197,15 +210,15 @@ var ButtonType = /*#__PURE__*/ function(ButtonType) {
|
|
|
197
210
|
return ButtonType;
|
|
198
211
|
}({});
|
|
199
212
|
|
|
200
|
-
function _array_like_to_array$
|
|
213
|
+
function _array_like_to_array$c(arr, len) {
|
|
201
214
|
if (len == null || len > arr.length) len = arr.length;
|
|
202
215
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
203
216
|
return arr2;
|
|
204
217
|
}
|
|
205
|
-
function _array_with_holes$
|
|
218
|
+
function _array_with_holes$c(arr) {
|
|
206
219
|
if (Array.isArray(arr)) return arr;
|
|
207
220
|
}
|
|
208
|
-
function _define_property$
|
|
221
|
+
function _define_property$j(obj, key, value) {
|
|
209
222
|
if (key in obj) {
|
|
210
223
|
Object.defineProperty(obj, key, {
|
|
211
224
|
value: value,
|
|
@@ -218,7 +231,7 @@ function _define_property$d(obj, key, value) {
|
|
|
218
231
|
}
|
|
219
232
|
return obj;
|
|
220
233
|
}
|
|
221
|
-
function _iterable_to_array_limit$
|
|
234
|
+
function _iterable_to_array_limit$c(arr, i) {
|
|
222
235
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
223
236
|
if (_i == null) return;
|
|
224
237
|
var _arr = [];
|
|
@@ -242,10 +255,10 @@ function _iterable_to_array_limit$8(arr, i) {
|
|
|
242
255
|
}
|
|
243
256
|
return _arr;
|
|
244
257
|
}
|
|
245
|
-
function _non_iterable_rest$
|
|
258
|
+
function _non_iterable_rest$c() {
|
|
246
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.");
|
|
247
260
|
}
|
|
248
|
-
function _object_spread$
|
|
261
|
+
function _object_spread$j(target) {
|
|
249
262
|
for(var i = 1; i < arguments.length; i++){
|
|
250
263
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
251
264
|
var ownKeys = Object.keys(source);
|
|
@@ -255,21 +268,21 @@ function _object_spread$d(target) {
|
|
|
255
268
|
}));
|
|
256
269
|
}
|
|
257
270
|
ownKeys.forEach(function(key) {
|
|
258
|
-
_define_property$
|
|
271
|
+
_define_property$j(target, key, source[key]);
|
|
259
272
|
});
|
|
260
273
|
}
|
|
261
274
|
return target;
|
|
262
275
|
}
|
|
263
|
-
function _sliced_to_array$
|
|
264
|
-
return _array_with_holes$
|
|
276
|
+
function _sliced_to_array$c(arr, i) {
|
|
277
|
+
return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$c();
|
|
265
278
|
}
|
|
266
|
-
function _unsupported_iterable_to_array$
|
|
279
|
+
function _unsupported_iterable_to_array$c(o, minLen) {
|
|
267
280
|
if (!o) return;
|
|
268
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
281
|
+
if (typeof o === "string") return _array_like_to_array$c(o, minLen);
|
|
269
282
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
270
283
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
271
284
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
272
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
285
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
|
|
273
286
|
}
|
|
274
287
|
function Button(param) {
|
|
275
288
|
var disabled = param.disabled, text = param.text, id = param.id, className = param.className, style = param.style, onClick = param.onClick, children = param.children, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
@@ -277,7 +290,7 @@ function Button(param) {
|
|
|
277
290
|
] : _param_padding, _param_margin = param.margin, margin = _param_margin === void 0 ? [
|
|
278
291
|
Spacing.none
|
|
279
292
|
] : _param_margin, _param_type = param.type, type = _param_type === void 0 ? ButtonType.latch : _param_type, _param_size = param.size, size = _param_size === void 0 ? ButtonSize.large : _param_size;
|
|
280
|
-
var _React_useState = _sliced_to_array$
|
|
293
|
+
var _React_useState = _sliced_to_array$c(React__default.useState(false), 2), isSelected = _React_useState[0], setIsSelected = _React_useState[1];
|
|
281
294
|
var buttonState = Juce.getToggleState(id);
|
|
282
295
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
283
296
|
// Update the local state when the ID changes
|
|
@@ -334,7 +347,7 @@ function Button(param) {
|
|
|
334
347
|
onMouseDown: handleMouseDown,
|
|
335
348
|
disabled: disabled,
|
|
336
349
|
onClick: onClick && onClick,
|
|
337
|
-
style: _object_spread$
|
|
350
|
+
style: _object_spread$j({
|
|
338
351
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
339
352
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
340
353
|
paddingBottom: "var(--p-".concat((_padding_1 = padding[2]) !== null && _padding_1 !== void 0 ? _padding_1 : padding[0], ")"),
|
|
@@ -352,8 +365,8 @@ Button.margin = Spacing;
|
|
|
352
365
|
Button.type = ButtonType;
|
|
353
366
|
Button.size = ButtonSize;
|
|
354
367
|
|
|
355
|
-
var css_248z$
|
|
356
|
-
styleInject(css_248z$
|
|
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: 0;\n border-radius: var(--radius-sm);\n appearance: none;\n user-select: none;\n -webkit-user-select: none;\n height: var(--spacing-xl);\n background: var(--bg-input);\n &:hover,\n &:focus,\n &:active {\n outline: none;\n background-color: var(--bg-highlighted);\n }\n &:disabled {\n cursor: not-allowed;\n }\n}\n\n.Dropdown-item {\n background-color: var(--bg-popover);\n padding: var(--spacing-l);\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n &:hover {\n background-color: var(--bg-highlighted);\n }\n &[data-selected] {\n background-color: var(--bg-selected);\n }\n}\n";
|
|
369
|
+
styleInject(css_248z$8);
|
|
357
370
|
|
|
358
371
|
function useObservable(param) {
|
|
359
372
|
var onFire = param.onFire;
|
|
@@ -395,15 +408,15 @@ function useObservable(param) {
|
|
|
395
408
|
};
|
|
396
409
|
}
|
|
397
410
|
|
|
398
|
-
function _array_like_to_array$
|
|
411
|
+
function _array_like_to_array$b(arr, len) {
|
|
399
412
|
if (len == null || len > arr.length) len = arr.length;
|
|
400
413
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
401
414
|
return arr2;
|
|
402
415
|
}
|
|
403
|
-
function _array_with_holes$
|
|
416
|
+
function _array_with_holes$b(arr) {
|
|
404
417
|
if (Array.isArray(arr)) return arr;
|
|
405
418
|
}
|
|
406
|
-
function _define_property$
|
|
419
|
+
function _define_property$i(obj, key, value) {
|
|
407
420
|
if (key in obj) {
|
|
408
421
|
Object.defineProperty(obj, key, {
|
|
409
422
|
value: value,
|
|
@@ -416,7 +429,7 @@ function _define_property$c(obj, key, value) {
|
|
|
416
429
|
}
|
|
417
430
|
return obj;
|
|
418
431
|
}
|
|
419
|
-
function _iterable_to_array_limit$
|
|
432
|
+
function _iterable_to_array_limit$b(arr, i) {
|
|
420
433
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
421
434
|
if (_i == null) return;
|
|
422
435
|
var _arr = [];
|
|
@@ -440,10 +453,10 @@ function _iterable_to_array_limit$7(arr, i) {
|
|
|
440
453
|
}
|
|
441
454
|
return _arr;
|
|
442
455
|
}
|
|
443
|
-
function _non_iterable_rest$
|
|
456
|
+
function _non_iterable_rest$b() {
|
|
444
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.");
|
|
445
458
|
}
|
|
446
|
-
function _object_spread$
|
|
459
|
+
function _object_spread$i(target) {
|
|
447
460
|
for(var i = 1; i < arguments.length; i++){
|
|
448
461
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
449
462
|
var ownKeys = Object.keys(source);
|
|
@@ -453,12 +466,12 @@ function _object_spread$c(target) {
|
|
|
453
466
|
}));
|
|
454
467
|
}
|
|
455
468
|
ownKeys.forEach(function(key) {
|
|
456
|
-
_define_property$
|
|
469
|
+
_define_property$i(target, key, source[key]);
|
|
457
470
|
});
|
|
458
471
|
}
|
|
459
472
|
return target;
|
|
460
473
|
}
|
|
461
|
-
function ownKeys$
|
|
474
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
462
475
|
var keys = Object.keys(object);
|
|
463
476
|
if (Object.getOwnPropertySymbols) {
|
|
464
477
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -466,42 +479,80 @@ function ownKeys$2(object, enumerableOnly) {
|
|
|
466
479
|
}
|
|
467
480
|
return keys;
|
|
468
481
|
}
|
|
469
|
-
function _object_spread_props$
|
|
482
|
+
function _object_spread_props$3(target, source) {
|
|
470
483
|
source = source != null ? source : {};
|
|
471
484
|
if (Object.getOwnPropertyDescriptors) {
|
|
472
485
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
473
486
|
} else {
|
|
474
|
-
ownKeys$
|
|
487
|
+
ownKeys$3(Object(source)).forEach(function(key) {
|
|
475
488
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
476
489
|
});
|
|
477
490
|
}
|
|
478
491
|
return target;
|
|
479
492
|
}
|
|
480
|
-
function _sliced_to_array$
|
|
481
|
-
return _array_with_holes$
|
|
493
|
+
function _sliced_to_array$b(arr, i) {
|
|
494
|
+
return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$b();
|
|
482
495
|
}
|
|
483
|
-
function _unsupported_iterable_to_array$
|
|
496
|
+
function _unsupported_iterable_to_array$b(o, minLen) {
|
|
484
497
|
if (!o) return;
|
|
485
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
498
|
+
if (typeof o === "string") return _array_like_to_array$b(o, minLen);
|
|
486
499
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
487
500
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
488
501
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
489
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
502
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
|
|
490
503
|
}
|
|
491
504
|
// Initial state
|
|
492
505
|
var defaultGlobalStateValue = {
|
|
493
506
|
highlightedItem: {
|
|
494
507
|
label: 'Antimatter Audio',
|
|
495
|
-
value:
|
|
496
|
-
}
|
|
508
|
+
value: 0
|
|
509
|
+
},
|
|
510
|
+
automatableParamsList: [],
|
|
511
|
+
automatableParamLabels: [],
|
|
512
|
+
modSlots: {},
|
|
513
|
+
modSlotParams: [],
|
|
514
|
+
modSlotParamLabels: [],
|
|
515
|
+
advancedView: false
|
|
497
516
|
};
|
|
498
517
|
// Reducer function to handle state updates
|
|
499
518
|
var reducer = function(state, action) {
|
|
500
519
|
switch(action.type){
|
|
501
|
-
case '
|
|
502
|
-
return _object_spread_props$
|
|
520
|
+
case 'HIGHLIGHTED_ITEM_CHANGED':
|
|
521
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
503
522
|
highlightedItem: action.payload
|
|
504
523
|
});
|
|
524
|
+
case 'ADVANCED_VIEW_TOGGLED':
|
|
525
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
526
|
+
advancedView: action.payload
|
|
527
|
+
});
|
|
528
|
+
case 'AUTOMATABLE_PARAMS_LIST_RECEIVED':
|
|
529
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
530
|
+
automatableParamsList: action.payload
|
|
531
|
+
});
|
|
532
|
+
case 'AUTOMATABLE_PARAM_LABELS_RECEIVED':
|
|
533
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
534
|
+
automatableParamLabels: action.payload
|
|
535
|
+
});
|
|
536
|
+
case 'MOD_SLOTS_RECEIVED':
|
|
537
|
+
var _action_payload;
|
|
538
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
539
|
+
modSlots: action === null || action === void 0 ? void 0 : (_action_payload = action.payload) === null || _action_payload === void 0 ? void 0 : _action_payload.reduce(function(acc, val) {
|
|
540
|
+
return _object_spread_props$3(_object_spread$i({}, acc), _define_property$i({}, val[0], val[1]));
|
|
541
|
+
}, {})
|
|
542
|
+
});
|
|
543
|
+
case 'MOD_SLOT_UPDATED':
|
|
544
|
+
var _action_payload1, _action_payload2;
|
|
545
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
546
|
+
modSlots: _object_spread_props$3(_object_spread$i({}, state === null || state === void 0 ? void 0 : state.modSlots), _define_property$i({}, (_action_payload1 = action.payload) === null || _action_payload1 === void 0 ? void 0 : _action_payload1[0], action === null || action === void 0 ? void 0 : (_action_payload2 = action.payload) === null || _action_payload2 === void 0 ? void 0 : _action_payload2[1]))
|
|
547
|
+
});
|
|
548
|
+
case 'MOD_SLOT_PARAMS_LIST_RECEIVED':
|
|
549
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
550
|
+
modSlotParams: action === null || action === void 0 ? void 0 : action.payload
|
|
551
|
+
});
|
|
552
|
+
case 'MOD_SLOT_PARAM_LABELS_RECIEVED':
|
|
553
|
+
return _object_spread_props$3(_object_spread$i({}, state), {
|
|
554
|
+
modSlotParamLabels: action === null || action === void 0 ? void 0 : action.payload
|
|
555
|
+
});
|
|
505
556
|
default:
|
|
506
557
|
return state;
|
|
507
558
|
}
|
|
@@ -518,13 +569,55 @@ function useGlobalContext(selector) {
|
|
|
518
569
|
// Context provider
|
|
519
570
|
function GlobalContextProvider(param) {
|
|
520
571
|
var children = param.children;
|
|
521
|
-
var _useReducer = _sliced_to_array$
|
|
522
|
-
var
|
|
572
|
+
var _useReducer = _sliced_to_array$b(useReducer(reducer, defaultGlobalStateValue), 2), state = _useReducer[0], dispatch = _useReducer[1];
|
|
573
|
+
var highlightedItemChanged = useCallback(function(highlightedItem) {
|
|
523
574
|
dispatch({
|
|
524
|
-
type: '
|
|
575
|
+
type: 'HIGHLIGHTED_ITEM_CHANGED',
|
|
525
576
|
payload: highlightedItem
|
|
526
577
|
});
|
|
527
578
|
}, []);
|
|
579
|
+
var advancedViewToggled = useCallback(function(advancedView) {
|
|
580
|
+
dispatch({
|
|
581
|
+
type: 'ADVANCED_VIEW_TOGGLED',
|
|
582
|
+
payload: advancedView
|
|
583
|
+
});
|
|
584
|
+
}, []);
|
|
585
|
+
var automatableParamsListReceived = useCallback(function(automatableParamsList) {
|
|
586
|
+
dispatch({
|
|
587
|
+
type: 'AUTOMATABLE_PARAMS_LIST_RECEIVED',
|
|
588
|
+
payload: automatableParamsList
|
|
589
|
+
});
|
|
590
|
+
}, []);
|
|
591
|
+
var automatableParamLabelsReceived = useCallback(function(automatableParamLabels) {
|
|
592
|
+
dispatch({
|
|
593
|
+
type: 'AUTOMATABLE_PARAM_LABELS_RECEIVED',
|
|
594
|
+
payload: automatableParamLabels
|
|
595
|
+
});
|
|
596
|
+
}, []);
|
|
597
|
+
var modSlotsReceived = useCallback(function(modSlots) {
|
|
598
|
+
dispatch({
|
|
599
|
+
type: 'MOD_SLOTS_RECEIVED',
|
|
600
|
+
payload: modSlots
|
|
601
|
+
});
|
|
602
|
+
}, []);
|
|
603
|
+
var modSlotUpdated = useCallback(function(modSlot) {
|
|
604
|
+
dispatch({
|
|
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',
|
|
612
|
+
payload: modSlotParams
|
|
613
|
+
});
|
|
614
|
+
}, []);
|
|
615
|
+
var modSlotParamLabelsReceived = useCallback(function(modSlotParamLables) {
|
|
616
|
+
dispatch({
|
|
617
|
+
type: 'MOD_SLOT_PARAM_LABELS_RECIEVED',
|
|
618
|
+
payload: modSlotParamLables
|
|
619
|
+
});
|
|
620
|
+
}, []);
|
|
528
621
|
var onFire = function() {
|
|
529
622
|
//@ts-expect-error
|
|
530
623
|
window.__JUCE__.backend.emitEvent('setRandom', {});
|
|
@@ -534,7 +627,14 @@ function GlobalContextProvider(param) {
|
|
|
534
627
|
});
|
|
535
628
|
var value = {
|
|
536
629
|
globalState: state,
|
|
537
|
-
|
|
630
|
+
highlightedItemChanged: highlightedItemChanged,
|
|
631
|
+
advancedViewToggled: advancedViewToggled,
|
|
632
|
+
automatableParamsListReceived: automatableParamsListReceived,
|
|
633
|
+
automatableParamLabelsReceived: automatableParamLabelsReceived,
|
|
634
|
+
modSlotsReceived: modSlotsReceived,
|
|
635
|
+
modSlotUpdated: modSlotUpdated,
|
|
636
|
+
modSlotParamsListReceived: modSlotParamsListReceived,
|
|
637
|
+
modSlotParamLabelsReceived: modSlotParamLabelsReceived,
|
|
538
638
|
useRandom: useRandom
|
|
539
639
|
};
|
|
540
640
|
return /*#__PURE__*/ React__default.createElement(GlobalContext.Provider, {
|
|
@@ -542,15 +642,15 @@ function GlobalContextProvider(param) {
|
|
|
542
642
|
}, children);
|
|
543
643
|
}
|
|
544
644
|
|
|
545
|
-
function _array_like_to_array$
|
|
645
|
+
function _array_like_to_array$a(arr, len) {
|
|
546
646
|
if (len == null || len > arr.length) len = arr.length;
|
|
547
647
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
548
648
|
return arr2;
|
|
549
649
|
}
|
|
550
|
-
function _array_with_holes$
|
|
650
|
+
function _array_with_holes$a(arr) {
|
|
551
651
|
if (Array.isArray(arr)) return arr;
|
|
552
652
|
}
|
|
553
|
-
function _iterable_to_array_limit$
|
|
653
|
+
function _iterable_to_array_limit$a(arr, i) {
|
|
554
654
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
555
655
|
if (_i == null) return;
|
|
556
656
|
var _arr = [];
|
|
@@ -574,42 +674,47 @@ function _iterable_to_array_limit$6(arr, i) {
|
|
|
574
674
|
}
|
|
575
675
|
return _arr;
|
|
576
676
|
}
|
|
577
|
-
function _non_iterable_rest$
|
|
677
|
+
function _non_iterable_rest$a() {
|
|
578
678
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
579
679
|
}
|
|
580
|
-
function _sliced_to_array$
|
|
581
|
-
return _array_with_holes$
|
|
680
|
+
function _sliced_to_array$a(arr, i) {
|
|
681
|
+
return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$a();
|
|
582
682
|
}
|
|
583
|
-
function _unsupported_iterable_to_array$
|
|
683
|
+
function _unsupported_iterable_to_array$a(o, minLen) {
|
|
584
684
|
if (!o) return;
|
|
585
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
685
|
+
if (typeof o === "string") return _array_like_to_array$a(o, minLen);
|
|
586
686
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
587
687
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
588
688
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
589
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
689
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
|
|
590
690
|
}
|
|
591
|
-
var
|
|
592
|
-
var id = param.id, label = param.label, _param_items = param.items, items = _param_items === void 0 ? [] : _param_items, onChange = param.onChange, _param_displayValInHeader = param.displayValInHeader, displayValInHeader = _param_displayValInHeader === void 0 ? true : _param_displayValInHeader;
|
|
691
|
+
var useDropdown = function(param) {
|
|
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;
|
|
693
|
+
var _properties_choices;
|
|
593
694
|
var comboBoxState = Juce.getComboBoxState(id);
|
|
594
|
-
var _useState = _sliced_to_array$
|
|
595
|
-
var _useState1 = _sliced_to_array$
|
|
695
|
+
var _useState = _sliced_to_array$a(useState(comboBoxState.getChoiceIndex()), 2), value = _useState[0], setValue = _useState[1];
|
|
696
|
+
var _useState1 = _sliced_to_array$a(useState(comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
596
697
|
var setHighlightedItem = useGlobalContext().setHighlightedItem;
|
|
597
|
-
var choices = properties.choices.length ? properties.choices :
|
|
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 : [];
|
|
699
|
+
var filteredChoices = filter ? choices === null || choices === void 0 ? void 0 : choices.filter(function(item) {
|
|
700
|
+
var _item_;
|
|
701
|
+
return item === null || item === void 0 ? void 0 : (_item_ = item[1]) === null || _item_ === void 0 ? void 0 : _item_.toLowerCase().includes(filter === null || filter === void 0 ? void 0 : filter.toLowerCase());
|
|
702
|
+
}) : choices;
|
|
598
703
|
var prevIndex = useRef(null);
|
|
599
|
-
var handleChange = function(
|
|
600
|
-
if (
|
|
601
|
-
comboBoxState.setChoiceIndex(
|
|
602
|
-
setValue(
|
|
603
|
-
onChange && onChange(
|
|
704
|
+
var handleChange = function(value) {
|
|
705
|
+
if (value !== prevIndex.current) {
|
|
706
|
+
comboBoxState.setChoiceIndex(value);
|
|
707
|
+
setValue(value);
|
|
708
|
+
onChange && onChange(value);
|
|
604
709
|
// //@ts-expect-error
|
|
605
710
|
// window.__JUCE__.backend.emitEvent('undoableActionOccurred', {});
|
|
606
711
|
if (displayValInHeader) {
|
|
607
712
|
setHighlightedItem({
|
|
608
713
|
label: label,
|
|
609
|
-
value: choices === null || choices === void 0 ? void 0 : choices[
|
|
714
|
+
value: choices === null || choices === void 0 ? void 0 : choices[value]
|
|
610
715
|
});
|
|
611
716
|
}
|
|
612
|
-
prevIndex.current =
|
|
717
|
+
prevIndex.current = value;
|
|
613
718
|
}
|
|
614
719
|
};
|
|
615
720
|
useEffect(function() {
|
|
@@ -642,25 +747,22 @@ var useCombobox = function(param) {
|
|
|
642
747
|
};
|
|
643
748
|
return {
|
|
644
749
|
value: value,
|
|
750
|
+
valueString: choices === null || choices === void 0 ? void 0 : choices[value],
|
|
645
751
|
setValue: setValue,
|
|
646
752
|
choices: choices,
|
|
753
|
+
filteredChoices: filteredChoices,
|
|
647
754
|
onMouseEnter: onMouseEnter,
|
|
648
755
|
handleChange: handleChange
|
|
649
756
|
};
|
|
650
757
|
};
|
|
651
758
|
|
|
652
759
|
function Dropdown(param) {
|
|
653
|
-
var
|
|
654
|
-
|
|
655
|
-
'Mock Item 2',
|
|
656
|
-
'Mock Item 3'
|
|
657
|
-
] : _param_items, label = param.label, className = param.className, onChange = param.onChange, id = param.id, style = param.style;
|
|
658
|
-
var _useCombobox = useCombobox({
|
|
760
|
+
var label = param.label, className = param.className, onChange = param.onChange, id = param.id, style = param.style;
|
|
761
|
+
var _useDropdown = useDropdown({
|
|
659
762
|
id: id,
|
|
660
763
|
label: label,
|
|
661
|
-
items: items,
|
|
662
764
|
onChange: onChange
|
|
663
|
-
}), value =
|
|
765
|
+
}), value = _useDropdown.value, choices = _useDropdown.choices, onMouseEnter = _useDropdown.onMouseEnter, handleChange = _useDropdown.handleChange;
|
|
664
766
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
665
767
|
onMouseEnter: onMouseEnter
|
|
666
768
|
}, /*#__PURE__*/ React__default.createElement(Listbox, {
|
|
@@ -673,11 +775,11 @@ function Dropdown(param) {
|
|
|
673
775
|
onChange: function(value) {
|
|
674
776
|
return console.log(value);
|
|
675
777
|
}
|
|
676
|
-
},
|
|
778
|
+
}, value), /*#__PURE__*/ React__default.createElement(ListboxOptions, {
|
|
677
779
|
anchor: "bottom",
|
|
678
780
|
portal: false,
|
|
679
781
|
className: "Dropdown-items z-10"
|
|
680
|
-
}, choices.map(function(item, i) {
|
|
782
|
+
}, choices === null || choices === void 0 ? void 0 : choices.map(function(item, i) {
|
|
681
783
|
return /*#__PURE__*/ React__default.createElement(ListboxOption, {
|
|
682
784
|
className: classnames('Dropdown-item'),
|
|
683
785
|
key: item,
|
|
@@ -692,8 +794,8 @@ var validate = function(param) {
|
|
|
692
794
|
var errorMessages = [];
|
|
693
795
|
var isIncomplete = false;
|
|
694
796
|
var length = value.toString().length;
|
|
695
|
-
if (length > maxLength && errorMessages.indexOf(InputErrorStates.exceedsMaxLength) === -1) {
|
|
696
|
-
errorMessages.push(InputErrorStates.exceedsMaxLength);
|
|
797
|
+
if (length > maxLength && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength)) === -1) {
|
|
798
|
+
errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.push(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength);
|
|
697
799
|
}
|
|
698
800
|
if (length < minLength) {
|
|
699
801
|
isIncomplete = true;
|
|
@@ -703,8 +805,8 @@ var validate = function(param) {
|
|
|
703
805
|
errorMessages.push(InputErrorStates.invalidCharacter);
|
|
704
806
|
}
|
|
705
807
|
if (typeof value === 'number') {
|
|
706
|
-
if ((value > max || value < min) && errorMessages.indexOf(InputErrorStates.valueOutOfRange) === -1) {
|
|
707
|
-
errorMessages.push(InputErrorStates.valueOutOfRange);
|
|
808
|
+
if ((value > max || value < min) && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates.valueOutOfRange)) === -1) {
|
|
809
|
+
errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.push(InputErrorStates.valueOutOfRange);
|
|
708
810
|
}
|
|
709
811
|
}
|
|
710
812
|
}
|
|
@@ -714,22 +816,62 @@ var validate = function(param) {
|
|
|
714
816
|
isValid: !errorMessages.length && !isIncomplete
|
|
715
817
|
};
|
|
716
818
|
};
|
|
819
|
+
var getBarTransformStyles = function(param) {
|
|
820
|
+
var polarity = param.polarity, orientation = param.orientation, value = param.value;
|
|
821
|
+
if (polarity === Polarity.linear) {
|
|
822
|
+
return orientation === Orientation.horizontal ? {
|
|
823
|
+
width: value ? "100%" : '1px',
|
|
824
|
+
height: '100%',
|
|
825
|
+
transform: value ? "scale(".concat(Math.ceil(value) * 0.01, ", 1)") : 'none',
|
|
826
|
+
transformOrigin: 'center left',
|
|
827
|
+
top: '0',
|
|
828
|
+
bottom: '0',
|
|
829
|
+
left: '0'
|
|
830
|
+
} : {
|
|
831
|
+
width: "100%",
|
|
832
|
+
height: value ? '100%' : '1px',
|
|
833
|
+
transform: "scale(1, ".concat(Math.ceil(value) * 0.01, ")"),
|
|
834
|
+
transformOrigin: 'bottom center',
|
|
835
|
+
top: '0',
|
|
836
|
+
bottom: '0',
|
|
837
|
+
left: '0'
|
|
838
|
+
};
|
|
839
|
+
} else {
|
|
840
|
+
return orientation === Orientation.horizontal ? {
|
|
841
|
+
width: value ? "100%" : '1px',
|
|
842
|
+
height: '100%',
|
|
843
|
+
transform: value ? "scale(".concat(Math.ceil(value) * 0.01 / 2, ", 1)") : 'none',
|
|
844
|
+
transformOrigin: 'left center',
|
|
845
|
+
top: '0',
|
|
846
|
+
bottom: '0',
|
|
847
|
+
left: '50%'
|
|
848
|
+
} : {
|
|
849
|
+
width: "100%",
|
|
850
|
+
height: value ? '100%' : '1px',
|
|
851
|
+
transform: value ? "scale(1, ".concat(Math.ceil(value) * 0.01 / 2, ")") : 'none',
|
|
852
|
+
transformOrigin: 'bottom center',
|
|
853
|
+
bottom: '50%',
|
|
854
|
+
left: '0',
|
|
855
|
+
right: '0'
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
};
|
|
717
859
|
var randomizeValue = function(min, max) {
|
|
718
860
|
return Math.random() * (max - min) + min;
|
|
719
861
|
};
|
|
720
862
|
|
|
721
|
-
var css_248z$
|
|
722
|
-
styleInject(css_248z$
|
|
863
|
+
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";
|
|
864
|
+
styleInject(css_248z$7);
|
|
723
865
|
|
|
724
|
-
function _array_like_to_array$
|
|
866
|
+
function _array_like_to_array$9(arr, len) {
|
|
725
867
|
if (len == null || len > arr.length) len = arr.length;
|
|
726
868
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
727
869
|
return arr2;
|
|
728
870
|
}
|
|
729
|
-
function _array_with_holes$
|
|
871
|
+
function _array_with_holes$9(arr) {
|
|
730
872
|
if (Array.isArray(arr)) return arr;
|
|
731
873
|
}
|
|
732
|
-
function _define_property$
|
|
874
|
+
function _define_property$h(obj, key, value) {
|
|
733
875
|
if (key in obj) {
|
|
734
876
|
Object.defineProperty(obj, key, {
|
|
735
877
|
value: value,
|
|
@@ -742,7 +884,7 @@ function _define_property$b(obj, key, value) {
|
|
|
742
884
|
}
|
|
743
885
|
return obj;
|
|
744
886
|
}
|
|
745
|
-
function _iterable_to_array_limit$
|
|
887
|
+
function _iterable_to_array_limit$9(arr, i) {
|
|
746
888
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
747
889
|
if (_i == null) return;
|
|
748
890
|
var _arr = [];
|
|
@@ -766,10 +908,10 @@ function _iterable_to_array_limit$5(arr, i) {
|
|
|
766
908
|
}
|
|
767
909
|
return _arr;
|
|
768
910
|
}
|
|
769
|
-
function _non_iterable_rest$
|
|
911
|
+
function _non_iterable_rest$9() {
|
|
770
912
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
771
913
|
}
|
|
772
|
-
function _object_spread$
|
|
914
|
+
function _object_spread$h(target) {
|
|
773
915
|
for(var i = 1; i < arguments.length; i++){
|
|
774
916
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
775
917
|
var ownKeys = Object.keys(source);
|
|
@@ -779,21 +921,21 @@ function _object_spread$b(target) {
|
|
|
779
921
|
}));
|
|
780
922
|
}
|
|
781
923
|
ownKeys.forEach(function(key) {
|
|
782
|
-
_define_property$
|
|
924
|
+
_define_property$h(target, key, source[key]);
|
|
783
925
|
});
|
|
784
926
|
}
|
|
785
927
|
return target;
|
|
786
928
|
}
|
|
787
|
-
function _sliced_to_array$
|
|
788
|
-
return _array_with_holes$
|
|
929
|
+
function _sliced_to_array$9(arr, i) {
|
|
930
|
+
return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$9();
|
|
789
931
|
}
|
|
790
|
-
function _unsupported_iterable_to_array$
|
|
932
|
+
function _unsupported_iterable_to_array$9(o, minLen) {
|
|
791
933
|
if (!o) return;
|
|
792
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
934
|
+
if (typeof o === "string") return _array_like_to_array$9(o, minLen);
|
|
793
935
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
794
936
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
795
937
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
796
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
938
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
|
|
797
939
|
}
|
|
798
940
|
// import { decimalToPercent, percentToDecimal } from '../../common/utils';
|
|
799
941
|
// import debounce from 'lodash.debounce';
|
|
@@ -805,9 +947,9 @@ var InputTypes = /*#__PURE__*/ function(InputTypes) {
|
|
|
805
947
|
function Input(param) {
|
|
806
948
|
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;
|
|
807
949
|
var _inputRef_current;
|
|
808
|
-
var _useState = _sliced_to_array$
|
|
809
|
-
var _useState1 = _sliced_to_array$
|
|
810
|
-
var _useState2 = _sliced_to_array$
|
|
950
|
+
var _useState = _sliced_to_array$9(useState(value), 2), internalValue = _useState[0], setInternalValue = _useState[1];
|
|
951
|
+
var _useState1 = _sliced_to_array$9(useState(false), 2), hasError = _useState1[0], setHasError = _useState1[1];
|
|
952
|
+
var _useState2 = _sliced_to_array$9(useState(false), 2), hasIncompleteValue = _useState2[0], setHasIncompleteValue = _useState2[1];
|
|
811
953
|
var valueRef = useRef(null);
|
|
812
954
|
var timer, timeoutVal = 2000;
|
|
813
955
|
// (inputValue === '' || /^-?\d+$/.test(inputValue)
|
|
@@ -882,7 +1024,7 @@ function Input(param) {
|
|
|
882
1024
|
}
|
|
883
1025
|
// Don't set the internal value if the value exceeds the max length
|
|
884
1026
|
// Don't set the internal value if the value contains an invalid character
|
|
885
|
-
if (errorMessages.indexOf(InputErrorStates.exceedsMaxLength) === -1 && errorMessages.indexOf(InputErrorStates.invalidCharacter) === -1) {
|
|
1027
|
+
if ((errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.exceedsMaxLength)) === -1 && (errorMessages === null || errorMessages === void 0 ? void 0 : errorMessages.indexOf(InputErrorStates === null || InputErrorStates === void 0 ? void 0 : InputErrorStates.invalidCharacter)) === -1) {
|
|
886
1028
|
setInternalValue(newValue);
|
|
887
1029
|
}
|
|
888
1030
|
}, [
|
|
@@ -911,7 +1053,7 @@ function Input(param) {
|
|
|
911
1053
|
id: id,
|
|
912
1054
|
ref: inputRef,
|
|
913
1055
|
className: classnames('TextInput', hasIncompleteValue || hasError ? 'is-blinking' : '', className),
|
|
914
|
-
style: _object_spread$
|
|
1056
|
+
style: _object_spread$h({
|
|
915
1057
|
// TODO
|
|
916
1058
|
// color: hasError ? 'red' : hasIncompleteValue ? '#999' : textColor
|
|
917
1059
|
color: hasError ? 'red' : textColor,
|
|
@@ -937,11 +1079,6 @@ function Input(param) {
|
|
|
937
1079
|
}
|
|
938
1080
|
Input.type = InputTypes;
|
|
939
1081
|
|
|
940
|
-
var SliderPolarity = /*#__PURE__*/ function(SliderPolarity) {
|
|
941
|
-
SliderPolarity["linear"] = "linear";
|
|
942
|
-
SliderPolarity["bipolar"] = "bipolar";
|
|
943
|
-
return SliderPolarity;
|
|
944
|
-
}({});
|
|
945
1082
|
var SliderType = /*#__PURE__*/ function(SliderType) {
|
|
946
1083
|
SliderType["bar"] = "bar";
|
|
947
1084
|
SliderType["rotary"] = "rotary";
|
|
@@ -954,11 +1091,6 @@ var SliderRotationBehavior = /*#__PURE__*/ function(SliderRotationBehavior) {
|
|
|
954
1091
|
SliderRotationBehavior["noRotation"] = "noRotation";
|
|
955
1092
|
return SliderRotationBehavior;
|
|
956
1093
|
}({});
|
|
957
|
-
var SliderOrientation = /*#__PURE__*/ function(SliderOrientation) {
|
|
958
|
-
SliderOrientation["horizontal"] = "horizontal";
|
|
959
|
-
SliderOrientation["vertical"] = "vertical";
|
|
960
|
-
return SliderOrientation;
|
|
961
|
-
}({});
|
|
962
1094
|
|
|
963
1095
|
var clamp = function(val) {
|
|
964
1096
|
var min = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, max = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
|
|
@@ -986,70 +1118,16 @@ var decimalToPercent = function(decimal) {
|
|
|
986
1118
|
var percentToDecimal = function(percent) {
|
|
987
1119
|
return Math.round(0.01 * (typeof percent === 'string' ? parseFloat(percent) : percent));
|
|
988
1120
|
};
|
|
989
|
-
var getTransformString = function(param) {
|
|
990
|
-
var sliderType = param.sliderType, sliderOrientation = param.sliderOrientation, polarity = param.polarity, normalisedValue = param.normalisedValue, scaledValue = param.scaledValue;
|
|
991
|
-
if (sliderType === SliderType.bar) {
|
|
992
|
-
if (polarity === SliderPolarity.linear) {
|
|
993
|
-
return sliderOrientation === SliderOrientation.horizontal ? {
|
|
994
|
-
transform: "scale(".concat(normalisedValue, ", 1)"),
|
|
995
|
-
transformOrigin: 'center left'
|
|
996
|
-
} : {
|
|
997
|
-
transform: "scale(1, ".concat(normalisedValue, ")"),
|
|
998
|
-
transformOrigin: 'bottom center'
|
|
999
|
-
};
|
|
1000
|
-
} else {
|
|
1001
|
-
return sliderOrientation === SliderOrientation.horizontal ? {
|
|
1002
|
-
transform: "scale(".concat(Math.ceil(scaledValue * 100) / 100 / 2, ", 1)"),
|
|
1003
|
-
transformOrigin: 'left center'
|
|
1004
|
-
} : {
|
|
1005
|
-
transform: "scale(1, ".concat(Math.ceil(scaledValue * 100) / 100 / 2, ")"),
|
|
1006
|
-
transformOrigin: 'bottom center'
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
} else {
|
|
1010
|
-
return {
|
|
1011
|
-
transform: '0'
|
|
1012
|
-
};
|
|
1013
|
-
}
|
|
1014
|
-
};
|
|
1015
|
-
var getPosition = function(param) {
|
|
1016
|
-
var sliderType = param.sliderType, sliderOrientation = param.sliderOrientation, polarity = param.polarity;
|
|
1017
|
-
if (sliderType === SliderType.bar) {
|
|
1018
|
-
if (polarity === SliderPolarity.linear) {
|
|
1019
|
-
return sliderOrientation === SliderOrientation.horizontal ? {
|
|
1020
|
-
top: '0',
|
|
1021
|
-
bottom: '0',
|
|
1022
|
-
left: '0'
|
|
1023
|
-
} : {
|
|
1024
|
-
right: '0',
|
|
1025
|
-
bottom: '0',
|
|
1026
|
-
left: '0'
|
|
1027
|
-
};
|
|
1028
|
-
} else {
|
|
1029
|
-
return sliderOrientation === SliderOrientation.horizontal ? {
|
|
1030
|
-
top: '0',
|
|
1031
|
-
bottom: '0',
|
|
1032
|
-
left: '50%'
|
|
1033
|
-
} : {
|
|
1034
|
-
bottom: '50%',
|
|
1035
|
-
left: '0',
|
|
1036
|
-
right: '0'
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
} else {
|
|
1040
|
-
return {};
|
|
1041
|
-
}
|
|
1042
|
-
};
|
|
1043
1121
|
|
|
1044
|
-
function _array_like_to_array$
|
|
1122
|
+
function _array_like_to_array$8(arr, len) {
|
|
1045
1123
|
if (len == null || len > arr.length) len = arr.length;
|
|
1046
1124
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1047
1125
|
return arr2;
|
|
1048
1126
|
}
|
|
1049
|
-
function _array_with_holes$
|
|
1127
|
+
function _array_with_holes$8(arr) {
|
|
1050
1128
|
if (Array.isArray(arr)) return arr;
|
|
1051
1129
|
}
|
|
1052
|
-
function _iterable_to_array_limit$
|
|
1130
|
+
function _iterable_to_array_limit$8(arr, i) {
|
|
1053
1131
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1054
1132
|
if (_i == null) return;
|
|
1055
1133
|
var _arr = [];
|
|
@@ -1073,29 +1151,29 @@ function _iterable_to_array_limit$4(arr, i) {
|
|
|
1073
1151
|
}
|
|
1074
1152
|
return _arr;
|
|
1075
1153
|
}
|
|
1076
|
-
function _non_iterable_rest$
|
|
1154
|
+
function _non_iterable_rest$8() {
|
|
1077
1155
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1078
1156
|
}
|
|
1079
|
-
function _sliced_to_array$
|
|
1080
|
-
return _array_with_holes$
|
|
1157
|
+
function _sliced_to_array$8(arr, i) {
|
|
1158
|
+
return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$8();
|
|
1081
1159
|
}
|
|
1082
|
-
function _unsupported_iterable_to_array$
|
|
1160
|
+
function _unsupported_iterable_to_array$8(o, minLen) {
|
|
1083
1161
|
if (!o) return;
|
|
1084
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1162
|
+
if (typeof o === "string") return _array_like_to_array$8(o, minLen);
|
|
1085
1163
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1086
1164
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1087
1165
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1088
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1166
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
|
|
1089
1167
|
}
|
|
1090
1168
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
1091
1169
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
1092
1170
|
var useSlider = function(param) {
|
|
1093
|
-
var id = param.id, label = param.label, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1171
|
+
var id = param.id, label = param.label, _param_displayValInHeader = param.displayValInHeader, displayValInHeader = _param_displayValInHeader === void 0 ? true : _param_displayValInHeader, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1094
1172
|
start: 20,
|
|
1095
1173
|
end: 15000,
|
|
1096
1174
|
interval: 0.1,
|
|
1097
1175
|
skew: 0.7
|
|
1098
|
-
} : _param_mockProperties, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, _param_mockInitialNormalisedValue = param.mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0.0 : _param_mockInitialNormalisedValue,
|
|
1176
|
+
} : _param_mockProperties, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, _param_mockInitialNormalisedValue = param.mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0.0 : _param_mockInitialNormalisedValue, onChange = param.onChange;
|
|
1099
1177
|
// const sliderState: JuceSlider = Juce.getSliderState(id);
|
|
1100
1178
|
// if isLocalhost is true, the front end app is running outside of JUCE in a browser.
|
|
1101
1179
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
@@ -1108,13 +1186,13 @@ var useSlider = function(param) {
|
|
|
1108
1186
|
* AudioProcessorParameter::getValue() (C++).
|
|
1109
1187
|
*/ // See https://github.com/juce-framework/JUCE/blob/51d11a2be6d5c97ccf12b4e5e827006e19f0555a/modules/juce_gui_extra/native/javascript/index.js#L230C1-L238C6
|
|
1110
1188
|
// NOTE: We can think of this as a percentage value, in 0 to 1 format
|
|
1111
|
-
var _useState = _sliced_to_array$
|
|
1112
|
-
|
|
1113
|
-
var
|
|
1189
|
+
var _useState = _sliced_to_array$8(useState(0), 2), scaledValue = _useState[0], setScaledValue = _useState[1];
|
|
1190
|
+
// const [normalisedValue, setNormalisedValue] = useState(0);
|
|
1191
|
+
var _useState1 = _sliced_to_array$8(useState(), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
1114
1192
|
var scaledValueRef = useRef(null);
|
|
1115
1193
|
var normalisedValueRef = useRef(null);
|
|
1116
1194
|
// const randomValueSetCounter = useRef<number>(null);
|
|
1117
|
-
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom,
|
|
1195
|
+
var _useGlobalContext = useGlobalContext(), useRandom = _useGlobalContext.useRandom, highlightedItemChanged = _useGlobalContext.highlightedItemChanged;
|
|
1118
1196
|
// Set the initial state
|
|
1119
1197
|
//@ts-expect-error
|
|
1120
1198
|
useEffect(function() {
|
|
@@ -1129,7 +1207,7 @@ var useSlider = function(param) {
|
|
|
1129
1207
|
setNormalisedState(newValue);
|
|
1130
1208
|
};
|
|
1131
1209
|
if (!isLocalhost) {
|
|
1132
|
-
setNormalisedValue(normalisedValue);
|
|
1210
|
+
// setNormalisedValue(normalisedValue);
|
|
1133
1211
|
setProperties(sliderState === null || sliderState === void 0 ? void 0 : sliderState.properties);
|
|
1134
1212
|
if (isRandomizable) {
|
|
1135
1213
|
useRandom === null || useRandom === void 0 ? void 0 : useRandom.subscribe(setRandom, id);
|
|
@@ -1140,7 +1218,7 @@ var useSlider = function(param) {
|
|
|
1140
1218
|
} else {
|
|
1141
1219
|
// This sets 'mockProperties' as the value for 'properties' if the app is running in a browser.
|
|
1142
1220
|
setProperties(mockProperties);
|
|
1143
|
-
|
|
1221
|
+
normalisedValueRef.current = mockInitialNormalisedValue;
|
|
1144
1222
|
}
|
|
1145
1223
|
}, []);
|
|
1146
1224
|
// Update the local state when the ID changes
|
|
@@ -1174,11 +1252,11 @@ var useSlider = function(param) {
|
|
|
1174
1252
|
var normalisedValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getNormalisedValue();
|
|
1175
1253
|
var scaledValueFromState = sliderState === null || sliderState === void 0 ? void 0 : sliderState.getScaledValue();
|
|
1176
1254
|
var scaledValue = parseFloat(scaledValueFromState.toFixed(2));
|
|
1177
|
-
|
|
1255
|
+
normalisedValueRef.current = parseFloat(normalisedValueFromState.toFixed(2));
|
|
1178
1256
|
setScaledValue(scaledValue);
|
|
1179
1257
|
onChange && onChange(parseFloat(scaledValueFromState.toFixed(2)));
|
|
1180
|
-
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1181
|
-
|
|
1258
|
+
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1259
|
+
highlightedItemChanged({
|
|
1182
1260
|
label: label,
|
|
1183
1261
|
value: scaledValue
|
|
1184
1262
|
});
|
|
@@ -1187,16 +1265,17 @@ var useSlider = function(param) {
|
|
|
1187
1265
|
// Update JUCE state
|
|
1188
1266
|
var setNormalisedState = function(newValue) {
|
|
1189
1267
|
var sliderState = Juce.getSliderState(id);
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1268
|
+
var fixedNewValue = parseFloat(newValue.toFixed(2));
|
|
1269
|
+
if ((normalisedValueRef === null || normalisedValueRef === void 0 ? void 0 : normalisedValueRef.current) !== fixedNewValue) {
|
|
1270
|
+
!isLocalhost && sliderState.setNormalisedValue(clamp(fixedNewValue));
|
|
1271
|
+
normalisedValueRef.current = fixedNewValue;
|
|
1193
1272
|
}
|
|
1194
1273
|
};
|
|
1195
1274
|
var setScaledState = function(newValue) {
|
|
1196
1275
|
var sliderState = Juce.getSliderState(id);
|
|
1197
1276
|
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== newValue) {
|
|
1198
1277
|
!isLocalhost && properties && sliderState.setNormalisedValue(scaledToNormalised({
|
|
1199
|
-
scaledValue: clamp(newValue, properties === null || properties === void 0 ? void 0 : properties.start, properties === null || properties === void 0 ? void 0 : properties.end),
|
|
1278
|
+
scaledValue: clamp(parseFloat(newValue.toFixed(2)), properties === null || properties === void 0 ? void 0 : properties.start, properties === null || properties === void 0 ? void 0 : properties.end),
|
|
1200
1279
|
properties: properties
|
|
1201
1280
|
}));
|
|
1202
1281
|
scaledValueRef.current = newValue;
|
|
@@ -1212,7 +1291,8 @@ var useSlider = function(param) {
|
|
|
1212
1291
|
}
|
|
1213
1292
|
if (down) {
|
|
1214
1293
|
var deltaVal = delta[1] * -1;
|
|
1215
|
-
var
|
|
1294
|
+
var _normalisedValueRef_current;
|
|
1295
|
+
var newValue = ((_normalisedValueRef_current = normalisedValueRef.current) !== null && _normalisedValueRef_current !== void 0 ? _normalisedValueRef_current : 0) + deltaVal * // (properties?.interval && properties?.interval.toString().length > 4
|
|
1216
1296
|
// ? 4
|
|
1217
1297
|
// : 0.4) *
|
|
1218
1298
|
((properties === null || properties === void 0 ? void 0 : properties.interval) || 0.01);
|
|
@@ -1227,42 +1307,71 @@ var useSlider = function(param) {
|
|
|
1227
1307
|
}, {
|
|
1228
1308
|
preventDefault: true
|
|
1229
1309
|
});
|
|
1230
|
-
var bindBarSliderDrag =
|
|
1231
|
-
var
|
|
1232
|
-
var
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1310
|
+
var bindBarSliderDrag = function() {
|
|
1311
|
+
var orientation = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Orientation.vertical;
|
|
1312
|
+
var drag = useDrag(function(param) {
|
|
1313
|
+
var down = param.down, event = param.event, first = param.first, last = param.last;
|
|
1314
|
+
var _event_target;
|
|
1315
|
+
var rect = event === null || event === void 0 ? void 0 : (_event_target = event.target) === null || _event_target === void 0 ? void 0 : _event_target.getBoundingClientRect();
|
|
1316
|
+
var y = (event === null || event === void 0 ? void 0 : event.clientY) - rect.top;
|
|
1317
|
+
var x = (event === null || event === void 0 ? void 0 : event.clientX) - rect.left;
|
|
1318
|
+
// 1138 - 1043.1
|
|
1319
|
+
if (first) {
|
|
1320
|
+
//@ts-expect-error
|
|
1321
|
+
window.__JUCE__.backend.emitEvent('jsDragStarted', {
|
|
1322
|
+
i: "".concat(0)
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
// START
|
|
1326
|
+
// bottom: 685
|
|
1327
|
+
// height: 40
|
|
1328
|
+
// left: 733.5
|
|
1329
|
+
// right: 884.328125
|
|
1330
|
+
// top: 645
|
|
1331
|
+
// width: 150.828125
|
|
1332
|
+
// x: 733.5
|
|
1333
|
+
// y: 645
|
|
1334
|
+
// clientx 735
|
|
1335
|
+
// 735 - 733.5
|
|
1336
|
+
// END
|
|
1337
|
+
// bottom: 685
|
|
1338
|
+
// height: 40
|
|
1339
|
+
// left: 733.5
|
|
1340
|
+
// right: 884.328125
|
|
1341
|
+
// top: 645
|
|
1342
|
+
// width: 150.828125
|
|
1343
|
+
// x: 733.5
|
|
1344
|
+
// y: 645
|
|
1345
|
+
// clientx: 883
|
|
1346
|
+
if (down) {
|
|
1347
|
+
// TODO: Increments?
|
|
1348
|
+
var newValue;
|
|
1349
|
+
if (orientation === Orientation.vertical) {
|
|
1350
|
+
newValue = 1 - y / rect.height;
|
|
1351
|
+
} else {
|
|
1352
|
+
newValue = x / rect.width;
|
|
1353
|
+
}
|
|
1354
|
+
setNormalisedState(newValue);
|
|
1355
|
+
}
|
|
1356
|
+
if (last) {
|
|
1357
|
+
//@ts-expect-error
|
|
1358
|
+
window.__JUCE__.backend.emitEvent('jsDragEnded', {
|
|
1359
|
+
i: "".concat(0)
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
}, {
|
|
1363
|
+
preventDefault: true
|
|
1364
|
+
});
|
|
1365
|
+
return drag();
|
|
1366
|
+
};
|
|
1255
1367
|
var onMouseEnter = function() {
|
|
1256
|
-
if ((scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1257
|
-
|
|
1368
|
+
if (displayValInHeader && (scaledValueRef === null || scaledValueRef === void 0 ? void 0 : scaledValueRef.current) !== scaledValue) {
|
|
1369
|
+
highlightedItemChanged({
|
|
1258
1370
|
label: label,
|
|
1259
1371
|
value: scaledValue
|
|
1260
1372
|
});
|
|
1261
1373
|
}
|
|
1262
1374
|
};
|
|
1263
|
-
// TODO: Refactor
|
|
1264
|
-
// const onChangeStarted = () => sliderState.sliderDragStarted();
|
|
1265
|
-
// const onChangeCommitted = () => sliderState.sliderDragEnded();
|
|
1266
1375
|
return {
|
|
1267
1376
|
setNormalisedState: setNormalisedState,
|
|
1268
1377
|
setScaledState: setScaledState,
|
|
@@ -1271,7 +1380,7 @@ var useSlider = function(param) {
|
|
|
1271
1380
|
onMouseEnter: onMouseEnter,
|
|
1272
1381
|
bindBarSliderDrag: bindBarSliderDrag,
|
|
1273
1382
|
bindDrag: bindDrag,
|
|
1274
|
-
normalisedValue:
|
|
1383
|
+
normalisedValue: normalisedValueRef.current || 0,
|
|
1275
1384
|
scaledValue: scaledValue,
|
|
1276
1385
|
properties: properties
|
|
1277
1386
|
};
|
|
@@ -1305,7 +1414,7 @@ var LayoutTags = /*#__PURE__*/ function(LayoutTags) {
|
|
|
1305
1414
|
return LayoutTags;
|
|
1306
1415
|
}({});
|
|
1307
1416
|
|
|
1308
|
-
function _define_property$
|
|
1417
|
+
function _define_property$g(obj, key, value) {
|
|
1309
1418
|
if (key in obj) {
|
|
1310
1419
|
Object.defineProperty(obj, key, {
|
|
1311
1420
|
value: value,
|
|
@@ -1318,7 +1427,7 @@ function _define_property$a(obj, key, value) {
|
|
|
1318
1427
|
}
|
|
1319
1428
|
return obj;
|
|
1320
1429
|
}
|
|
1321
|
-
function _object_spread$
|
|
1430
|
+
function _object_spread$g(target) {
|
|
1322
1431
|
for(var i = 1; i < arguments.length; i++){
|
|
1323
1432
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1324
1433
|
var ownKeys = Object.keys(source);
|
|
@@ -1328,31 +1437,96 @@ function _object_spread$a(target) {
|
|
|
1328
1437
|
}));
|
|
1329
1438
|
}
|
|
1330
1439
|
ownKeys.forEach(function(key) {
|
|
1331
|
-
_define_property$
|
|
1440
|
+
_define_property$g(target, key, source[key]);
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
return target;
|
|
1444
|
+
}
|
|
1445
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
1446
|
+
var keys = Object.keys(object);
|
|
1447
|
+
if (Object.getOwnPropertySymbols) {
|
|
1448
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
1449
|
+
keys.push.apply(keys, symbols);
|
|
1450
|
+
}
|
|
1451
|
+
return keys;
|
|
1452
|
+
}
|
|
1453
|
+
function _object_spread_props$2(target, source) {
|
|
1454
|
+
source = source != null ? source : {};
|
|
1455
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
1456
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
1457
|
+
} else {
|
|
1458
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
1459
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
1332
1460
|
});
|
|
1333
1461
|
}
|
|
1334
1462
|
return target;
|
|
1335
1463
|
}
|
|
1464
|
+
function _object_without_properties(source, excluded) {
|
|
1465
|
+
if (source == null) return {};
|
|
1466
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
1467
|
+
var key, i;
|
|
1468
|
+
if (Object.getOwnPropertySymbols) {
|
|
1469
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1470
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
1471
|
+
key = sourceSymbolKeys[i];
|
|
1472
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1473
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1474
|
+
target[key] = source[key];
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
return target;
|
|
1478
|
+
}
|
|
1479
|
+
function _object_without_properties_loose(source, excluded) {
|
|
1480
|
+
if (source == null) return {};
|
|
1481
|
+
var target = {};
|
|
1482
|
+
var sourceKeys = Object.keys(source);
|
|
1483
|
+
var key, i;
|
|
1484
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
1485
|
+
key = sourceKeys[i];
|
|
1486
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1487
|
+
target[key] = source[key];
|
|
1488
|
+
}
|
|
1489
|
+
return target;
|
|
1490
|
+
}
|
|
1336
1491
|
var BoxDisplay = /*#__PURE__*/ function(BoxDisplay) {
|
|
1337
1492
|
BoxDisplay["flex"] = "flex";
|
|
1338
1493
|
BoxDisplay["block"] = "block";
|
|
1339
1494
|
return BoxDisplay;
|
|
1340
1495
|
}(BoxDisplay || {});
|
|
1341
|
-
function Box(
|
|
1342
|
-
var className =
|
|
1496
|
+
function Box(_param) {
|
|
1497
|
+
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 ? [
|
|
1343
1498
|
Spacing.none,
|
|
1344
1499
|
Spacing.none,
|
|
1345
1500
|
Spacing.none,
|
|
1346
1501
|
Spacing.none
|
|
1347
|
-
] : _param_padding, _param_gap =
|
|
1502
|
+
] : _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, [
|
|
1503
|
+
"className",
|
|
1504
|
+
"style",
|
|
1505
|
+
"children",
|
|
1506
|
+
"flex",
|
|
1507
|
+
"key",
|
|
1508
|
+
"onClick",
|
|
1509
|
+
"alignItems",
|
|
1510
|
+
"justifyContent",
|
|
1511
|
+
"display",
|
|
1512
|
+
"width",
|
|
1513
|
+
"flexWrap",
|
|
1514
|
+
"height",
|
|
1515
|
+
"border",
|
|
1516
|
+
"flexDirection",
|
|
1517
|
+
"padding",
|
|
1518
|
+
"gap",
|
|
1519
|
+
"tag"
|
|
1520
|
+
]);
|
|
1348
1521
|
var Tag = tag;
|
|
1349
1522
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1350
|
-
return /*#__PURE__*/ React__default.createElement(Tag, {
|
|
1523
|
+
return /*#__PURE__*/ React__default.createElement(Tag, _object_spread_props$2(_object_spread$g({
|
|
1351
1524
|
// id="globalValues"
|
|
1352
1525
|
key: key,
|
|
1353
1526
|
className: className,
|
|
1354
|
-
onClick: onClick
|
|
1355
|
-
|
|
1527
|
+
onClick: onClick
|
|
1528
|
+
}, rest), {
|
|
1529
|
+
style: _object_spread$g({
|
|
1356
1530
|
flexWrap: flexWrap,
|
|
1357
1531
|
display: display,
|
|
1358
1532
|
gap: "var(--gap-".concat(gap, ")"),
|
|
@@ -1369,7 +1543,7 @@ function Box(param) {
|
|
|
1369
1543
|
alignItems: "".concat(alignItems),
|
|
1370
1544
|
flex: flex ? flex : ''
|
|
1371
1545
|
}, style)
|
|
1372
|
-
}, children);
|
|
1546
|
+
}), children);
|
|
1373
1547
|
}
|
|
1374
1548
|
// Object.assign(Layout, width, height, ALIGN, JUSTIFY, DIRECTION, SPACING);
|
|
1375
1549
|
Box.display = BoxDisplay;
|
|
@@ -1383,7 +1557,7 @@ Box.padding = Spacing;
|
|
|
1383
1557
|
Box.flexWrap = FlexWrap;
|
|
1384
1558
|
Box.tag = LayoutTags;
|
|
1385
1559
|
|
|
1386
|
-
function _define_property$
|
|
1560
|
+
function _define_property$f(obj, key, value) {
|
|
1387
1561
|
if (key in obj) {
|
|
1388
1562
|
Object.defineProperty(obj, key, {
|
|
1389
1563
|
value: value,
|
|
@@ -1396,7 +1570,7 @@ function _define_property$9(obj, key, value) {
|
|
|
1396
1570
|
}
|
|
1397
1571
|
return obj;
|
|
1398
1572
|
}
|
|
1399
|
-
function _object_spread$
|
|
1573
|
+
function _object_spread$f(target) {
|
|
1400
1574
|
for(var i = 1; i < arguments.length; i++){
|
|
1401
1575
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1402
1576
|
var ownKeys = Object.keys(source);
|
|
@@ -1406,7 +1580,7 @@ function _object_spread$9(target) {
|
|
|
1406
1580
|
}));
|
|
1407
1581
|
}
|
|
1408
1582
|
ownKeys.forEach(function(key) {
|
|
1409
|
-
_define_property$
|
|
1583
|
+
_define_property$f(target, key, source[key]);
|
|
1410
1584
|
});
|
|
1411
1585
|
}
|
|
1412
1586
|
return target;
|
|
@@ -1419,7 +1593,7 @@ function Label(param) {
|
|
|
1419
1593
|
return /*#__PURE__*/ React.createElement("label", {
|
|
1420
1594
|
id: id,
|
|
1421
1595
|
htmlFor: htmlFor,
|
|
1422
|
-
style: _object_spread$
|
|
1596
|
+
style: _object_spread$f({
|
|
1423
1597
|
fontSize: "var(--text-".concat(fontSize),
|
|
1424
1598
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1425
1599
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1434,10 +1608,10 @@ function Label(param) {
|
|
|
1434
1608
|
Label.padding = Spacing;
|
|
1435
1609
|
Label.fontSize = FontSizes;
|
|
1436
1610
|
|
|
1437
|
-
var css_248z$
|
|
1438
|
-
styleInject(css_248z$
|
|
1611
|
+
var css_248z$6 = ".RotarySlider {\n position: relative;\n height: 50px;\n width: 50px;\n border-radius: 50%;\n aspect-ratio: 1 / 1;\n}\n\n.RotarySlider-Inner {\n height: 100%;\n width: 100%;\n right: 0;\n top: 0;\n bottom: 0;\n left: 0;\n background-color: var(--bg-popover);\n border-radius: 50%;\n}\n\n.RotarySlider-Indicator {\n position: absolute;\n top: 0;\n right: 0;\n left: 50%;\n width: var(--spacing-xs);\n height: 50%;\n transform: translate(-50%, 0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);\n}\n\n.RotarySlider-center-marker {\n border-color: var(--bg-popover) transparent var(--bg-popover) transparent;\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 0 7px 10px 7px;\n transform: rotate(180deg);\n padding-bottom: var(--spacing-sm);\n}\n";
|
|
1612
|
+
styleInject(css_248z$6);
|
|
1439
1613
|
|
|
1440
|
-
function _define_property$
|
|
1614
|
+
function _define_property$e(obj, key, value) {
|
|
1441
1615
|
if (key in obj) {
|
|
1442
1616
|
Object.defineProperty(obj, key, {
|
|
1443
1617
|
value: value,
|
|
@@ -1450,7 +1624,7 @@ function _define_property$8(obj, key, value) {
|
|
|
1450
1624
|
}
|
|
1451
1625
|
return obj;
|
|
1452
1626
|
}
|
|
1453
|
-
function _object_spread$
|
|
1627
|
+
function _object_spread$e(target) {
|
|
1454
1628
|
for(var i = 1; i < arguments.length; i++){
|
|
1455
1629
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1456
1630
|
var ownKeys = Object.keys(source);
|
|
@@ -1460,7 +1634,7 @@ function _object_spread$8(target) {
|
|
|
1460
1634
|
}));
|
|
1461
1635
|
}
|
|
1462
1636
|
ownKeys.forEach(function(key) {
|
|
1463
|
-
_define_property$
|
|
1637
|
+
_define_property$e(target, key, source[key]);
|
|
1464
1638
|
});
|
|
1465
1639
|
}
|
|
1466
1640
|
return target;
|
|
@@ -1485,7 +1659,7 @@ function _object_spread_props$1(target, source) {
|
|
|
1485
1659
|
return target;
|
|
1486
1660
|
}
|
|
1487
1661
|
function RotarySlider(param) {
|
|
1488
|
-
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ?
|
|
1662
|
+
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? Polarity.linear : _param_polarity, label = param.label, className = param.className, id = param.id, onChange = param.onChange, _param_rotationBehavior = param.rotationBehavior, rotationBehavior = _param_rotationBehavior === void 0 ? SliderRotationBehavior.rotateIndicator : _param_rotationBehavior, _param_mockInitialNormalisedValue = param.// Mocks the initial scaled value of the slider for web veiws outside of JUCE
|
|
1489
1663
|
mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0 : _param_mockInitialNormalisedValue, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1490
1664
|
start: 20.0,
|
|
1491
1665
|
end: 15000.0,
|
|
@@ -1499,34 +1673,26 @@ function RotarySlider(param) {
|
|
|
1499
1673
|
mockInitialNormalisedValue: mockInitialNormalisedValue,
|
|
1500
1674
|
onChange: onChange,
|
|
1501
1675
|
isRandomizable: isRandomizable
|
|
1502
|
-
}), bindDrag = _useSlider.bindDrag, normalisedValue = _useSlider.normalisedValue,
|
|
1676
|
+
}), bindDrag = _useSlider.bindDrag, normalisedValue = _useSlider.normalisedValue, onMouseEnter = _useSlider.onMouseEnter;
|
|
1503
1677
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1504
1678
|
flexDirection: Box.flexDirection.column
|
|
1505
|
-
}, polarity ===
|
|
1679
|
+
}, polarity === Polarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1506
1680
|
className: classnames('RotarySlider-center-marker')
|
|
1507
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$
|
|
1508
|
-
className: classnames('RotarySlider', polarity ===
|
|
1681
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props$1(_object_spread$e({
|
|
1682
|
+
className: classnames('RotarySlider', polarity === Polarity.linear ? 'Slider-polarity-linear' : 'Slider-polarity-bipolar', className)
|
|
1509
1683
|
}, bindDrag()), {
|
|
1510
1684
|
onMouseEnter: onMouseEnter,
|
|
1511
|
-
style: _object_spread$
|
|
1685
|
+
style: _object_spread$e({
|
|
1512
1686
|
touchAction: 'none'
|
|
1513
1687
|
}, style)
|
|
1514
1688
|
}), normalisedValue !== null ? /*#__PURE__*/ React__default.createElement("div", {
|
|
1515
1689
|
className: classnames('RotarySlider-Inner'),
|
|
1516
|
-
style:
|
|
1517
|
-
rotate: rotationBehavior === SliderRotationBehavior.rotateIndicator ? "".concat(polarity ===
|
|
1518
|
-
}
|
|
1519
|
-
sliderType: SliderType.rotary,
|
|
1520
|
-
polarity: polarity,
|
|
1521
|
-
normalisedValue: normalisedValue,
|
|
1522
|
-
scaledValue: scaledValue
|
|
1523
|
-
}), getPosition({
|
|
1524
|
-
sliderType: SliderType.rotary,
|
|
1525
|
-
polarity: polarity
|
|
1526
|
-
}))
|
|
1690
|
+
style: {
|
|
1691
|
+
rotate: rotationBehavior === SliderRotationBehavior.rotateIndicator ? "".concat(polarity === Polarity.linear ? normalisedValue : normalisedValue + 0.5, "turn") : ''
|
|
1692
|
+
}
|
|
1527
1693
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
1528
1694
|
className: classnames('RotarySlider-Indicator'),
|
|
1529
|
-
style: _object_spread$
|
|
1695
|
+
style: _object_spread$e({
|
|
1530
1696
|
backgroundColor: color
|
|
1531
1697
|
}, style)
|
|
1532
1698
|
})) : ''), /*#__PURE__*/ React__default.createElement(Label, {
|
|
@@ -1537,9 +1703,9 @@ function RotarySlider(param) {
|
|
|
1537
1703
|
value: label
|
|
1538
1704
|
}));
|
|
1539
1705
|
}
|
|
1540
|
-
RotarySlider.sliderPolarity =
|
|
1706
|
+
RotarySlider.sliderPolarity = Polarity;
|
|
1541
1707
|
|
|
1542
|
-
function _define_property$
|
|
1708
|
+
function _define_property$d(obj, key, value) {
|
|
1543
1709
|
if (key in obj) {
|
|
1544
1710
|
Object.defineProperty(obj, key, {
|
|
1545
1711
|
value: value,
|
|
@@ -1552,7 +1718,7 @@ function _define_property$7(obj, key, value) {
|
|
|
1552
1718
|
}
|
|
1553
1719
|
return obj;
|
|
1554
1720
|
}
|
|
1555
|
-
function _object_spread$
|
|
1721
|
+
function _object_spread$d(target) {
|
|
1556
1722
|
for(var i = 1; i < arguments.length; i++){
|
|
1557
1723
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1558
1724
|
var ownKeys = Object.keys(source);
|
|
@@ -1562,7 +1728,7 @@ function _object_spread$7(target) {
|
|
|
1562
1728
|
}));
|
|
1563
1729
|
}
|
|
1564
1730
|
ownKeys.forEach(function(key) {
|
|
1565
|
-
_define_property$
|
|
1731
|
+
_define_property$d(target, key, source[key]);
|
|
1566
1732
|
});
|
|
1567
1733
|
}
|
|
1568
1734
|
return target;
|
|
@@ -1587,7 +1753,7 @@ function _object_spread_props(target, source) {
|
|
|
1587
1753
|
return target;
|
|
1588
1754
|
}
|
|
1589
1755
|
function Slider(param) {
|
|
1590
|
-
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ?
|
|
1756
|
+
var _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? Polarity.linear : _param_polarity, _param_sliderOrientation = param.sliderOrientation, sliderOrientation = _param_sliderOrientation === void 0 ? Orientation.vertical : _param_sliderOrientation, _param_isRandomizable = param.isRandomizable, isRandomizable = _param_isRandomizable === void 0 ? false : _param_isRandomizable, className = param.className, id = param.id, onChange = param.onChange, style = param.style, color = param.color, label = param.label, _param_mockInitialNormalisedValue = param.// Mocks the initial scaled value of the slider for web veiws outside of JUCE
|
|
1591
1757
|
mockInitialNormalisedValue, mockInitialNormalisedValue = _param_mockInitialNormalisedValue === void 0 ? 0 : _param_mockInitialNormalisedValue, _param_mockProperties = param.mockProperties, mockProperties = _param_mockProperties === void 0 ? {
|
|
1592
1758
|
start: 20.0,
|
|
1593
1759
|
end: 15000.0,
|
|
@@ -1599,46 +1765,36 @@ function Slider(param) {
|
|
|
1599
1765
|
label: label,
|
|
1600
1766
|
mockProperties: mockProperties,
|
|
1601
1767
|
mockInitialNormalisedValue: mockInitialNormalisedValue,
|
|
1602
|
-
sliderOrientation: sliderOrientation,
|
|
1603
1768
|
onChange: onChange,
|
|
1604
1769
|
isRandomizable: isRandomizable
|
|
1605
|
-
}), bindBarSliderDrag = _useSlider.bindBarSliderDrag, normalisedValue = _useSlider.normalisedValue,
|
|
1770
|
+
}), bindBarSliderDrag = _useSlider.bindBarSliderDrag, normalisedValue = _useSlider.normalisedValue, onMouseEnter = _useSlider.onMouseEnter;
|
|
1606
1771
|
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1607
1772
|
flexDirection: Box.flexDirection.column,
|
|
1608
1773
|
justifyContent: Box.justifyContent.center,
|
|
1609
1774
|
className: classnames(className)
|
|
1610
|
-
}, polarity ===
|
|
1775
|
+
}, polarity === Polarity.bipolar && /*#__PURE__*/ React__default.createElement("div", {
|
|
1611
1776
|
className: 'Slider-center-marker'
|
|
1612
|
-
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$
|
|
1777
|
+
}), /*#__PURE__*/ React__default.createElement("div", _object_spread_props(_object_spread$d({
|
|
1613
1778
|
className: classnames('Slider-bar', 'relative')
|
|
1614
1779
|
}, bindBarSliderDrag()), {
|
|
1615
1780
|
onMouseEnter: onMouseEnter,
|
|
1616
|
-
style: _object_spread$
|
|
1781
|
+
style: _object_spread$d({
|
|
1617
1782
|
touchAction: 'none',
|
|
1618
1783
|
backgroundColor: 'var(--bg-input)',
|
|
1619
|
-
minWidth: sliderOrientation ===
|
|
1620
|
-
minHeight: sliderOrientation ===
|
|
1784
|
+
minWidth: sliderOrientation === Orientation.horizontal ? '100px' : '20px',
|
|
1785
|
+
minHeight: sliderOrientation === Orientation.horizontal ? '20px' : '75px'
|
|
1621
1786
|
}, style)
|
|
1622
1787
|
}), normalisedValue ? /*#__PURE__*/ React__default.createElement("div", {
|
|
1623
1788
|
// TODO: Why aren't the Tailwind classes working?
|
|
1624
1789
|
// className={classnames('h-full', 'w-full', 'absolute', 'bg-input')}
|
|
1625
|
-
style: _object_spread$
|
|
1626
|
-
height: '100%',
|
|
1627
|
-
width: '100%',
|
|
1790
|
+
style: _object_spread$d({
|
|
1628
1791
|
position: 'absolute',
|
|
1629
|
-
backgroundColor: color
|
|
1630
|
-
}, getPosition({
|
|
1631
|
-
sliderType: SliderType.bar,
|
|
1632
|
-
sliderOrientation: sliderOrientation,
|
|
1633
|
-
polarity: polarity
|
|
1634
|
-
})), {
|
|
1792
|
+
backgroundColor: color,
|
|
1635
1793
|
pointerEvents: 'none'
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
sliderOrientation: sliderOrientation,
|
|
1794
|
+
}, getBarTransformStyles({
|
|
1795
|
+
orientation: sliderOrientation,
|
|
1639
1796
|
polarity: polarity,
|
|
1640
|
-
|
|
1641
|
-
scaledValue: scaledValue
|
|
1797
|
+
value: normalisedValue * 100
|
|
1642
1798
|
}))
|
|
1643
1799
|
}) : ''), /*#__PURE__*/ React__default.createElement(Label, {
|
|
1644
1800
|
padding: [
|
|
@@ -1649,8 +1805,8 @@ function Slider(param) {
|
|
|
1649
1805
|
}));
|
|
1650
1806
|
}
|
|
1651
1807
|
Slider.sliderType = SliderType;
|
|
1652
|
-
Slider.sliderPolarity =
|
|
1653
|
-
Slider.sliderOrientation =
|
|
1808
|
+
Slider.sliderPolarity = Polarity;
|
|
1809
|
+
Slider.sliderOrientation = Orientation;
|
|
1654
1810
|
|
|
1655
1811
|
function SliderValue(param) {
|
|
1656
1812
|
var value = param.value, min = param.min, max = param.max, minLength = param.minLength, maxLength = param.maxLength, isEditable = param.isEditable, onChange = param.onChange, className = param.className, style = param.style;
|
|
@@ -1678,7 +1834,7 @@ var HeadingTags = /*#__PURE__*/ function(HeadingTags) {
|
|
|
1678
1834
|
return HeadingTags;
|
|
1679
1835
|
}({});
|
|
1680
1836
|
|
|
1681
|
-
function _define_property$
|
|
1837
|
+
function _define_property$c(obj, key, value) {
|
|
1682
1838
|
if (key in obj) {
|
|
1683
1839
|
Object.defineProperty(obj, key, {
|
|
1684
1840
|
value: value,
|
|
@@ -1691,7 +1847,7 @@ function _define_property$6(obj, key, value) {
|
|
|
1691
1847
|
}
|
|
1692
1848
|
return obj;
|
|
1693
1849
|
}
|
|
1694
|
-
function _object_spread$
|
|
1850
|
+
function _object_spread$c(target) {
|
|
1695
1851
|
for(var i = 1; i < arguments.length; i++){
|
|
1696
1852
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1697
1853
|
var ownKeys = Object.keys(source);
|
|
@@ -1701,7 +1857,7 @@ function _object_spread$6(target) {
|
|
|
1701
1857
|
}));
|
|
1702
1858
|
}
|
|
1703
1859
|
ownKeys.forEach(function(key) {
|
|
1704
|
-
_define_property$
|
|
1860
|
+
_define_property$c(target, key, source[key]);
|
|
1705
1861
|
});
|
|
1706
1862
|
}
|
|
1707
1863
|
return target;
|
|
@@ -1714,7 +1870,7 @@ function Heading(param) {
|
|
|
1714
1870
|
var _padding_, _padding_1, _padding_2, _ref;
|
|
1715
1871
|
return /*#__PURE__*/ React.createElement(Tag, {
|
|
1716
1872
|
id: id,
|
|
1717
|
-
style: _object_spread$
|
|
1873
|
+
style: _object_spread$c({
|
|
1718
1874
|
fontSize: "var(--text-".concat(fontSize),
|
|
1719
1875
|
paddingTop: "var(--p-".concat(padding[0], ")"),
|
|
1720
1876
|
paddingRight: "var(--p-".concat((_padding_ = padding[1]) !== null && _padding_ !== void 0 ? _padding_ : padding[0], ")"),
|
|
@@ -1730,51 +1886,15 @@ Heading.fontSize = FontSizes;
|
|
|
1730
1886
|
Heading.tag = HeadingTags;
|
|
1731
1887
|
Heading.padding = Spacing;
|
|
1732
1888
|
|
|
1733
|
-
|
|
1734
|
-
var rows = param.rows, columns = param.columns;
|
|
1735
|
-
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1736
|
-
flexDirection: Box.flexDirection.column,
|
|
1737
|
-
gap: Box.gap.xSmall
|
|
1738
|
-
}, /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(Box, {
|
|
1739
|
-
className: classnames('m-xs', 'flex-1'),
|
|
1740
|
-
padding: [
|
|
1741
|
-
Spacing.medium
|
|
1742
|
-
]
|
|
1743
|
-
}, "Target"), columns.map(function(item) {
|
|
1744
|
-
var colKey = v4();
|
|
1745
|
-
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1746
|
-
key: colKey,
|
|
1747
|
-
className: classnames('m-xs', 'flex-1'),
|
|
1748
|
-
padding: [
|
|
1749
|
-
Spacing.medium
|
|
1750
|
-
]
|
|
1751
|
-
}, item === null || item === void 0 ? void 0 : item.label);
|
|
1752
|
-
})), rows.map(function(item) {
|
|
1753
|
-
var rowKey = v4();
|
|
1754
|
-
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1755
|
-
key: rowKey
|
|
1756
|
-
}, Object.values(item).map(function(value, i) {
|
|
1757
|
-
var colKey = v4();
|
|
1758
|
-
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
1759
|
-
key: colKey,
|
|
1760
|
-
className: classnames(i === 0 ? 'bg-section' : ''),
|
|
1761
|
-
padding: [
|
|
1762
|
-
Spacing.medium
|
|
1763
|
-
]
|
|
1764
|
-
}, value);
|
|
1765
|
-
}));
|
|
1766
|
-
}));
|
|
1767
|
-
};
|
|
1768
|
-
|
|
1769
|
-
function _array_like_to_array$3(arr, len) {
|
|
1889
|
+
function _array_like_to_array$7(arr, len) {
|
|
1770
1890
|
if (len == null || len > arr.length) len = arr.length;
|
|
1771
1891
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
1772
1892
|
return arr2;
|
|
1773
1893
|
}
|
|
1774
|
-
function _array_with_holes$
|
|
1894
|
+
function _array_with_holes$7(arr) {
|
|
1775
1895
|
if (Array.isArray(arr)) return arr;
|
|
1776
1896
|
}
|
|
1777
|
-
function _iterable_to_array_limit$
|
|
1897
|
+
function _iterable_to_array_limit$7(arr, i) {
|
|
1778
1898
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1779
1899
|
if (_i == null) return;
|
|
1780
1900
|
var _arr = [];
|
|
@@ -1798,26 +1918,26 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
1798
1918
|
}
|
|
1799
1919
|
return _arr;
|
|
1800
1920
|
}
|
|
1801
|
-
function _non_iterable_rest$
|
|
1921
|
+
function _non_iterable_rest$7() {
|
|
1802
1922
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1803
1923
|
}
|
|
1804
|
-
function _sliced_to_array$
|
|
1805
|
-
return _array_with_holes$
|
|
1924
|
+
function _sliced_to_array$7(arr, i) {
|
|
1925
|
+
return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$7();
|
|
1806
1926
|
}
|
|
1807
|
-
function _unsupported_iterable_to_array$
|
|
1927
|
+
function _unsupported_iterable_to_array$7(o, minLen) {
|
|
1808
1928
|
if (!o) return;
|
|
1809
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
1929
|
+
if (typeof o === "string") return _array_like_to_array$7(o, minLen);
|
|
1810
1930
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1811
1931
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1812
1932
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
1813
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
1933
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
|
|
1814
1934
|
}
|
|
1815
1935
|
// 20.0f, 15000.0f, 0.1f, 0.7f),800.0f
|
|
1816
1936
|
// ValueType rangeStart, ValueType rangeEnd, ValueType intervalValue, ValueType skewFactor, bool useSymmetricSkew=false)
|
|
1817
1937
|
var useIndicator = function(param) {
|
|
1818
1938
|
var id = param.id;
|
|
1819
1939
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
1820
|
-
var _useState = _sliced_to_array$
|
|
1940
|
+
var _useState = _sliced_to_array$7(useState(0), 2), isActive = _useState[0], setIsActive = _useState[1];
|
|
1821
1941
|
// Set the initial state
|
|
1822
1942
|
useEffect(function() {
|
|
1823
1943
|
if (!isLocalhost) {
|
|
@@ -1851,7 +1971,7 @@ var useIndicator = function(param) {
|
|
|
1851
1971
|
};
|
|
1852
1972
|
};
|
|
1853
1973
|
|
|
1854
|
-
function _define_property$
|
|
1974
|
+
function _define_property$b(obj, key, value) {
|
|
1855
1975
|
if (key in obj) {
|
|
1856
1976
|
Object.defineProperty(obj, key, {
|
|
1857
1977
|
value: value,
|
|
@@ -1864,7 +1984,7 @@ function _define_property$5(obj, key, value) {
|
|
|
1864
1984
|
}
|
|
1865
1985
|
return obj;
|
|
1866
1986
|
}
|
|
1867
|
-
function _object_spread$
|
|
1987
|
+
function _object_spread$b(target) {
|
|
1868
1988
|
for(var i = 1; i < arguments.length; i++){
|
|
1869
1989
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1870
1990
|
var ownKeys = Object.keys(source);
|
|
@@ -1874,7 +1994,7 @@ function _object_spread$5(target) {
|
|
|
1874
1994
|
}));
|
|
1875
1995
|
}
|
|
1876
1996
|
ownKeys.forEach(function(key) {
|
|
1877
|
-
_define_property$
|
|
1997
|
+
_define_property$b(target, key, source[key]);
|
|
1878
1998
|
});
|
|
1879
1999
|
}
|
|
1880
2000
|
return target;
|
|
@@ -1891,7 +2011,7 @@ function IndicatorLight(param) {
|
|
|
1891
2011
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
1892
2012
|
id: id,
|
|
1893
2013
|
className: classnames('IndicatorLight', 'bg-input', className),
|
|
1894
|
-
style: _object_spread$
|
|
2014
|
+
style: _object_spread$b({
|
|
1895
2015
|
width: '12px',
|
|
1896
2016
|
height: '12px',
|
|
1897
2017
|
background: isActive ? color : ''
|
|
@@ -1901,10 +2021,10 @@ function IndicatorLight(param) {
|
|
|
1901
2021
|
}) : null);
|
|
1902
2022
|
}
|
|
1903
2023
|
|
|
1904
|
-
var css_248z$
|
|
1905
|
-
styleInject(css_248z$
|
|
2024
|
+
var css_248z$5 = ".IconButton:hover:not(:disabled) {\n filter: brightness(80%);\n}\n\nsvg {\n height: 100%;\n width: 100%;\n}\n";
|
|
2025
|
+
styleInject(css_248z$5);
|
|
1906
2026
|
|
|
1907
|
-
function _define_property$
|
|
2027
|
+
function _define_property$a(obj, key, value) {
|
|
1908
2028
|
if (key in obj) {
|
|
1909
2029
|
Object.defineProperty(obj, key, {
|
|
1910
2030
|
value: value,
|
|
@@ -1917,7 +2037,7 @@ function _define_property$4(obj, key, value) {
|
|
|
1917
2037
|
}
|
|
1918
2038
|
return obj;
|
|
1919
2039
|
}
|
|
1920
|
-
function _object_spread$
|
|
2040
|
+
function _object_spread$a(target) {
|
|
1921
2041
|
for(var i = 1; i < arguments.length; i++){
|
|
1922
2042
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
1923
2043
|
var ownKeys = Object.keys(source);
|
|
@@ -1927,21 +2047,23 @@ function _object_spread$4(target) {
|
|
|
1927
2047
|
}));
|
|
1928
2048
|
}
|
|
1929
2049
|
ownKeys.forEach(function(key) {
|
|
1930
|
-
_define_property$
|
|
2050
|
+
_define_property$a(target, key, source[key]);
|
|
1931
2051
|
});
|
|
1932
2052
|
}
|
|
1933
2053
|
return target;
|
|
1934
2054
|
}
|
|
1935
|
-
var
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
2055
|
+
var Icons = /*#__PURE__*/ function(Icons) {
|
|
2056
|
+
Icons["undo"] = "Undo";
|
|
2057
|
+
Icons["redo"] = "Redo";
|
|
2058
|
+
Icons["random"] = "Random";
|
|
2059
|
+
Icons["favorite"] = "Favorite";
|
|
2060
|
+
Icons["up"] = "Up";
|
|
2061
|
+
Icons["down"] = "Down";
|
|
2062
|
+
Icons["save"] = "Save";
|
|
2063
|
+
Icons["add"] = "Add";
|
|
2064
|
+
Icons["delete"] = "Delete";
|
|
2065
|
+
return Icons;
|
|
2066
|
+
}({});
|
|
1945
2067
|
var Undo = function(param) {
|
|
1946
2068
|
var color = param.color;
|
|
1947
2069
|
return /*#__PURE__*/ React__default.createElement("svg", {
|
|
@@ -2110,26 +2232,113 @@ var Random = function(param) {
|
|
|
2110
2232
|
"stroke-linejoin": "round"
|
|
2111
2233
|
}));
|
|
2112
2234
|
};
|
|
2113
|
-
var
|
|
2235
|
+
var Add = function(param) {
|
|
2236
|
+
var color = param.color;
|
|
2237
|
+
return /*#__PURE__*/ React__default.createElement("svg", {
|
|
2238
|
+
width: "24px",
|
|
2239
|
+
height: "24px",
|
|
2240
|
+
"stroke-width": "1.5",
|
|
2241
|
+
viewBox: "0 0 24 24",
|
|
2242
|
+
fill: "none",
|
|
2243
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2244
|
+
color: color
|
|
2245
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
2246
|
+
d: "M6 12H12M18 12H12M12 12V6M12 12V18",
|
|
2247
|
+
stroke: color,
|
|
2248
|
+
"stroke-width": "1.5",
|
|
2249
|
+
"stroke-linecap": "round",
|
|
2250
|
+
"stroke-linejoin": "round"
|
|
2251
|
+
}));
|
|
2252
|
+
};
|
|
2253
|
+
var Delete = function(param) {
|
|
2254
|
+
var color = param.color;
|
|
2255
|
+
return /*#__PURE__*/ React__default.createElement("svg", {
|
|
2256
|
+
width: "24px",
|
|
2257
|
+
height: "24px",
|
|
2258
|
+
viewBox: "0 0 24 24",
|
|
2259
|
+
fill: "none",
|
|
2260
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2261
|
+
color: color,
|
|
2262
|
+
"stroke-width": "1.5"
|
|
2263
|
+
}, /*#__PURE__*/ React__default.createElement("path", {
|
|
2264
|
+
"fill-rule": "evenodd",
|
|
2265
|
+
"clip-rule": "evenodd",
|
|
2266
|
+
d: "M12 1.25C6.06294 1.25 1.25 6.06294 1.25 12C1.25 17.9371 6.06294 22.75 12 22.75C17.9371 22.75 22.75 17.9371 22.75 12C22.75 6.06294 17.9371 1.25 12 1.25ZM9.70164 8.64124C9.40875 8.34835 8.93388 8.34835 8.64098 8.64124C8.34809 8.93414 8.34809 9.40901 8.64098 9.7019L10.9391 12L8.64098 14.2981C8.34809 14.591 8.34809 15.0659 8.64098 15.3588C8.93388 15.6517 9.40875 15.6517 9.70164 15.3588L11.9997 13.0607L14.2978 15.3588C14.5907 15.6517 15.0656 15.6517 15.3585 15.3588C15.6514 15.0659 15.6514 14.591 15.3585 14.2981L13.0604 12L15.3585 9.7019C15.6514 9.40901 15.6514 8.93414 15.3585 8.64124C15.0656 8.34835 14.5907 8.34835 14.2978 8.64124L11.9997 10.9393L9.70164 8.64124Z",
|
|
2267
|
+
fill: color
|
|
2268
|
+
}));
|
|
2269
|
+
};
|
|
2270
|
+
var iconList = {
|
|
2114
2271
|
Undo: Undo,
|
|
2115
2272
|
Redo: Redo,
|
|
2116
2273
|
Random: Random,
|
|
2117
2274
|
Favorite: Favorite,
|
|
2118
2275
|
Up: Up,
|
|
2119
2276
|
Down: Down,
|
|
2120
|
-
Save: Save
|
|
2277
|
+
Save: Save,
|
|
2278
|
+
Add: Add,
|
|
2279
|
+
Delete: Delete
|
|
2121
2280
|
};
|
|
2122
2281
|
// const getViewBoxWidth = (width: string) => {
|
|
2123
2282
|
// const numericWidth = width.match(/\d+/)?.[0];
|
|
2124
2283
|
// return numericWidth !== undefined ? parseInt(numericWidth) : 24;
|
|
2125
2284
|
// };
|
|
2285
|
+
function Icon(param) {
|
|
2286
|
+
var icon = param.icon, onClick = param.onClick, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_color = param.color, color = _param_color === void 0 ? 'var(--color-text)' : _param_color, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
2287
|
+
Spacing.none
|
|
2288
|
+
] : _param_padding, _param_width = param.width, width = _param_width === void 0 ? '24px' : _param_width, _param_height = param.height, height = _param_height === void 0 ? '24px' : _param_height, className = param.className, style = param.style;
|
|
2289
|
+
var _$Icon = iconList[icon];
|
|
2290
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
2291
|
+
className: "Icon ".concat(className),
|
|
2292
|
+
onClick: onClick,
|
|
2293
|
+
padding: padding,
|
|
2294
|
+
style: _object_spread$a({
|
|
2295
|
+
width: width,
|
|
2296
|
+
height: height
|
|
2297
|
+
}, style)
|
|
2298
|
+
}, /*#__PURE__*/ React__default.createElement(_$Icon, {
|
|
2299
|
+
width: width,
|
|
2300
|
+
color: disabled ? 'var(--color-gray-400)' : color
|
|
2301
|
+
}));
|
|
2302
|
+
}
|
|
2303
|
+
Icon.icon = Icons;
|
|
2304
|
+
Icon.padding = Spacing;
|
|
2305
|
+
Icon.margin = Spacing;
|
|
2306
|
+
|
|
2307
|
+
function _define_property$9(obj, key, value) {
|
|
2308
|
+
if (key in obj) {
|
|
2309
|
+
Object.defineProperty(obj, key, {
|
|
2310
|
+
value: value,
|
|
2311
|
+
enumerable: true,
|
|
2312
|
+
configurable: true,
|
|
2313
|
+
writable: true
|
|
2314
|
+
});
|
|
2315
|
+
} else {
|
|
2316
|
+
obj[key] = value;
|
|
2317
|
+
}
|
|
2318
|
+
return obj;
|
|
2319
|
+
}
|
|
2320
|
+
function _object_spread$9(target) {
|
|
2321
|
+
for(var i = 1; i < arguments.length; i++){
|
|
2322
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
2323
|
+
var ownKeys = Object.keys(source);
|
|
2324
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
2325
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
2326
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
2327
|
+
}));
|
|
2328
|
+
}
|
|
2329
|
+
ownKeys.forEach(function(key) {
|
|
2330
|
+
_define_property$9(target, key, source[key]);
|
|
2331
|
+
});
|
|
2332
|
+
}
|
|
2333
|
+
return target;
|
|
2334
|
+
}
|
|
2126
2335
|
function IconButton(param) {
|
|
2127
2336
|
var id = param.id, icon = param.icon, onClick = param.onClick, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, _param_color = param.color, color = _param_color === void 0 ? 'var(--color-text)' : _param_color, _param_backgroundColor = param.backgroundColor, backgroundColor = _param_backgroundColor === void 0 ? 'var(--bg-page)' : _param_backgroundColor, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
2128
2337
|
Button.padding.none
|
|
2129
2338
|
] : _param_padding, _param_margin = param.margin, margin = _param_margin === void 0 ? [
|
|
2130
2339
|
Button.margin.none
|
|
2131
2340
|
] : _param_margin, _param_width = param.width, width = _param_width === void 0 ? '24px' : _param_width, _param_height = param.height, height = _param_height === void 0 ? '24px' : _param_height, className = param.className, style = param.style;
|
|
2132
|
-
var Icon =
|
|
2341
|
+
var Icon = iconList[icon];
|
|
2133
2342
|
return /*#__PURE__*/ React__default.createElement(Button, {
|
|
2134
2343
|
id: id,
|
|
2135
2344
|
className: "IconButton ".concat(className),
|
|
@@ -2137,7 +2346,7 @@ function IconButton(param) {
|
|
|
2137
2346
|
padding: padding,
|
|
2138
2347
|
margin: margin,
|
|
2139
2348
|
disabled: disabled,
|
|
2140
|
-
style: _object_spread$
|
|
2349
|
+
style: _object_spread$9({
|
|
2141
2350
|
backgroundColor: backgroundColor,
|
|
2142
2351
|
width: width,
|
|
2143
2352
|
height: height
|
|
@@ -2147,11 +2356,11 @@ function IconButton(param) {
|
|
|
2147
2356
|
color: disabled ? 'var(--color-gray-400)' : color
|
|
2148
2357
|
}));
|
|
2149
2358
|
}
|
|
2150
|
-
IconButton.icon =
|
|
2359
|
+
IconButton.icon = Icons;
|
|
2151
2360
|
IconButton.padding = Spacing;
|
|
2152
2361
|
IconButton.margin = Spacing;
|
|
2153
2362
|
|
|
2154
|
-
function _define_property$
|
|
2363
|
+
function _define_property$8(obj, key, value) {
|
|
2155
2364
|
if (key in obj) {
|
|
2156
2365
|
Object.defineProperty(obj, key, {
|
|
2157
2366
|
value: value,
|
|
@@ -2164,7 +2373,7 @@ function _define_property$3(obj, key, value) {
|
|
|
2164
2373
|
}
|
|
2165
2374
|
return obj;
|
|
2166
2375
|
}
|
|
2167
|
-
function _object_spread$
|
|
2376
|
+
function _object_spread$8(target) {
|
|
2168
2377
|
for(var i = 1; i < arguments.length; i++){
|
|
2169
2378
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2170
2379
|
var ownKeys = Object.keys(source);
|
|
@@ -2174,7 +2383,7 @@ function _object_spread$3(target) {
|
|
|
2174
2383
|
}));
|
|
2175
2384
|
}
|
|
2176
2385
|
ownKeys.forEach(function(key) {
|
|
2177
|
-
_define_property$
|
|
2386
|
+
_define_property$8(target, key, source[key]);
|
|
2178
2387
|
});
|
|
2179
2388
|
}
|
|
2180
2389
|
return target;
|
|
@@ -2186,8 +2395,11 @@ function KeyValueDisplayScreen(param) {
|
|
|
2186
2395
|
// justifyContent={Box.justifyContent.flexStart}
|
|
2187
2396
|
alignItems: Box.alignItems.flexStart,
|
|
2188
2397
|
gap: Box.gap.small,
|
|
2189
|
-
style: _object_spread$
|
|
2398
|
+
style: _object_spread$8({}, style),
|
|
2190
2399
|
padding: [
|
|
2400
|
+
Box.padding.small,
|
|
2401
|
+
Box.padding.none,
|
|
2402
|
+
Box.padding.small,
|
|
2191
2403
|
Box.padding.small
|
|
2192
2404
|
],
|
|
2193
2405
|
className: className
|
|
@@ -2285,18 +2497,18 @@ function LinePlot(param) {
|
|
|
2285
2497
|
})));
|
|
2286
2498
|
}
|
|
2287
2499
|
|
|
2288
|
-
var css_248z$
|
|
2289
|
-
styleInject(css_248z$
|
|
2500
|
+
var css_248z$4 = ".Oscilloscope {\n background: #0EAC8B;\n box-shadow: inset 0 0 20px #086350;\n height: 200px;\n };";
|
|
2501
|
+
styleInject(css_248z$4);
|
|
2290
2502
|
|
|
2291
|
-
function _array_like_to_array$
|
|
2503
|
+
function _array_like_to_array$6(arr, len) {
|
|
2292
2504
|
if (len == null || len > arr.length) len = arr.length;
|
|
2293
2505
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2294
2506
|
return arr2;
|
|
2295
2507
|
}
|
|
2296
|
-
function _array_with_holes$
|
|
2508
|
+
function _array_with_holes$6(arr) {
|
|
2297
2509
|
if (Array.isArray(arr)) return arr;
|
|
2298
2510
|
}
|
|
2299
|
-
function _define_property$
|
|
2511
|
+
function _define_property$7(obj, key, value) {
|
|
2300
2512
|
if (key in obj) {
|
|
2301
2513
|
Object.defineProperty(obj, key, {
|
|
2302
2514
|
value: value,
|
|
@@ -2309,7 +2521,7 @@ function _define_property$2(obj, key, value) {
|
|
|
2309
2521
|
}
|
|
2310
2522
|
return obj;
|
|
2311
2523
|
}
|
|
2312
|
-
function _iterable_to_array_limit$
|
|
2524
|
+
function _iterable_to_array_limit$6(arr, i) {
|
|
2313
2525
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2314
2526
|
if (_i == null) return;
|
|
2315
2527
|
var _arr = [];
|
|
@@ -2333,10 +2545,10 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
2333
2545
|
}
|
|
2334
2546
|
return _arr;
|
|
2335
2547
|
}
|
|
2336
|
-
function _non_iterable_rest$
|
|
2548
|
+
function _non_iterable_rest$6() {
|
|
2337
2549
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2338
2550
|
}
|
|
2339
|
-
function _object_spread$
|
|
2551
|
+
function _object_spread$7(target) {
|
|
2340
2552
|
for(var i = 1; i < arguments.length; i++){
|
|
2341
2553
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2342
2554
|
var ownKeys = Object.keys(source);
|
|
@@ -2346,25 +2558,25 @@ function _object_spread$2(target) {
|
|
|
2346
2558
|
}));
|
|
2347
2559
|
}
|
|
2348
2560
|
ownKeys.forEach(function(key) {
|
|
2349
|
-
_define_property$
|
|
2561
|
+
_define_property$7(target, key, source[key]);
|
|
2350
2562
|
});
|
|
2351
2563
|
}
|
|
2352
2564
|
return target;
|
|
2353
2565
|
}
|
|
2354
|
-
function _sliced_to_array$
|
|
2355
|
-
return _array_with_holes$
|
|
2566
|
+
function _sliced_to_array$6(arr, i) {
|
|
2567
|
+
return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$6();
|
|
2356
2568
|
}
|
|
2357
|
-
function _unsupported_iterable_to_array$
|
|
2569
|
+
function _unsupported_iterable_to_array$6(o, minLen) {
|
|
2358
2570
|
if (!o) return;
|
|
2359
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2571
|
+
if (typeof o === "string") return _array_like_to_array$6(o, minLen);
|
|
2360
2572
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2361
2573
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2362
2574
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2363
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2575
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
|
|
2364
2576
|
}
|
|
2365
2577
|
function Oscilloscope(param) {
|
|
2366
2578
|
var width = param.width, height = param.height, className = param.className, style = param.style, id = param.id;
|
|
2367
|
-
var _useState = _sliced_to_array$
|
|
2579
|
+
var _useState = _sliced_to_array$6(useState([]), 2), viewData = _useState[0], setViewData = _useState[1];
|
|
2368
2580
|
useEffect(function() {
|
|
2369
2581
|
//@ts-expect-error
|
|
2370
2582
|
var removalToken = window.__JUCE__.backend.addEventListener('oscData', function() {
|
|
@@ -2382,7 +2594,7 @@ function Oscilloscope(param) {
|
|
|
2382
2594
|
}, []);
|
|
2383
2595
|
return /*#__PURE__*/ React__default.createElement("div", {
|
|
2384
2596
|
id: id,
|
|
2385
|
-
style: _object_spread$
|
|
2597
|
+
style: _object_spread$7({
|
|
2386
2598
|
height: height
|
|
2387
2599
|
}, style),
|
|
2388
2600
|
className: classnames('Oscilloscope', className)
|
|
@@ -2393,21 +2605,21 @@ function Oscilloscope(param) {
|
|
|
2393
2605
|
}));
|
|
2394
2606
|
}
|
|
2395
2607
|
|
|
2396
|
-
var css_248z$
|
|
2397
|
-
styleInject(css_248z$
|
|
2608
|
+
var css_248z$3 = "@import '../../styles.css';\n.ModuleHeader {\n background-color: var(--bg-section);\n font-weight: normal;\n font-family: var(--font-leagueSpartan);\n}\n\n.ModuleHeader-Name {\n font-size: var(--text-lg);\n letter-spacing: 4px;\n text-transform: uppercase;\n font-weight: lighter;\n height: 1.75rem;\n color: var(--color-brand);\n}\n\n.ModuleHeader-Subheading {\n font-size: var(--text-xs);\n font-weight: lighter;\n letter-spacing: 2.25px;\n text-transform: uppercase;\n color: var(--color-brand);\n}\n\n/* TODO: Use Tailwind classes */\n#advancedLayoutButton {\n background-color: var(--bg-page);\n color: var(--color-text);\n /* border: 2px solid var(--color-brand); */\n border-radius: 3px;\n height: 30px;\n font-size: var(--text-md);\n &:hover,\n &:active {\n background: var(--color-gray-900);\n color: var(--color-brand);\n }\n}\n\n#advancedLayoutButton.selected {\n color: var(--color-brand);\n}\n\n.advancedLayoutButtonLabel {\n cursor: pointer;\n font-family: var(--font-leagueSpartan);\n /* display: inline-block;\n vertical-align: middle;\n height: 1rem;\n line-height: 1.25; */\n}\n";
|
|
2609
|
+
styleInject(css_248z$3);
|
|
2398
2610
|
|
|
2399
|
-
var css_248z = ".PresetManagerContainer {\n width: 100%;\n height: 100%;\n background-color: var(--bg-page);\n color: var(--color-text);\n}\n\n.PresetManagerButton {\n width: 100%;\n height: 100%;\n max-width: 300px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n cursor: pointer;\n font-family: var(--font-leagueSpartan);\n}\n.PresetManagerButtonLabel {\n cursor: pointer;\n text-align: center;\n font-family: var(--font-leagueSpartan);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 225px;\n display: inline-block;\n vertical-align: middle;\n height: 1rem;\n line-height: 1.25;\n /* position: relative; */\n &:hover,\n &:active {\n background: var(--color-gray-900);\n }\n /* &.isDirty {\n &::after {\n content: '*';\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n } */\n}\n\n.PresetManagerButtonLabelContainer.isDirty::after {\n content: '*';\n position: absolute;\n height: 1rem;\n width: 1rem;\n right: -0.75rem;\n top: 0;\n}\n\n.PresetManagerButtonLabelOuterContainer {\n position: relative;\n width: auto;\n}\n\n[data-headlessui-state='open active'] .PresetManagerButtonLabel {\n background: var(--color-gray-900);\n}\n.PresetManagerPanel {\n position: absolute;\n font-family: var(--font-leagueSpartan);\n right: 0px;\n left: 0px;\n width: 100%;\n max-width: 400px !important;\n color: var(--color-text);\n background: var(--bg-popover);\n}\n\n.PresetManagerPanel:focus,\n.PresetManagerPanel:focus-visible {\n outline: none;\n}\n\n/* .PresetManagerCategoryItem {\n font-family: var(--font-leagueSpartan);\n cursor: pointer;\n background: var(--color-gray-800);\n text-transform: uppercase;\n &:hover,\n &.isSelected {\n background: var(--bg-selected);\n }\n} */\n\n.PresetManagerListItem {\n cursor: pointer;\n background: var(--color-gray-800);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n}\n\n.PresetManagerListItem:hover,\n.PresetManagerListItem.isSelected {\n background: var(--bg-selected);\n}\n\n.PresetManagerListItemText {\n display: inline-block;\n vertical-align: middle;\n height: 1.5rem;\n line-height: 1.75;\n}\n";
|
|
2400
|
-
styleInject(css_248z);
|
|
2611
|
+
var css_248z$2 = ".PresetManagerContainer {\n width: 100%;\n height: 100%;\n background-color: var(--bg-page);\n color: var(--color-text);\n}\n\n.PresetManagerButton {\n width: 100%;\n height: 100%;\n max-width: 300px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n cursor: pointer;\n font-family: var(--font-leagueSpartan);\n}\n.PresetManagerButtonLabel {\n cursor: pointer;\n text-align: center;\n font-family: var(--font-leagueSpartan);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 225px;\n display: inline-block;\n vertical-align: middle;\n height: 1rem;\n line-height: 1.25;\n /* position: relative; */\n &:hover,\n &:active {\n background: var(--color-gray-900);\n }\n /* &.isDirty {\n &::after {\n content: '*';\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n } */\n}\n\n.PresetManagerButtonLabelContainer.isDirty::after {\n content: '*';\n position: absolute;\n height: 1rem;\n width: 1rem;\n right: -0.75rem;\n top: 0;\n}\n\n.PresetManagerButtonLabelOuterContainer {\n position: relative;\n width: auto;\n}\n\n[data-headlessui-state='open active'] .PresetManagerButtonLabel {\n background: var(--color-gray-900);\n}\n.PresetManagerPanel {\n position: absolute;\n font-family: var(--font-leagueSpartan);\n right: 0px;\n left: 0px;\n width: 100%;\n max-width: 400px !important;\n color: var(--color-text);\n background: var(--bg-popover);\n}\n\n.PresetManagerPanel:focus,\n.PresetManagerPanel:focus-visible {\n outline: none;\n}\n\n/* .PresetManagerCategoryItem {\n font-family: var(--font-leagueSpartan);\n cursor: pointer;\n background: var(--color-gray-800);\n text-transform: uppercase;\n &:hover,\n &.isSelected {\n background: var(--bg-selected);\n }\n} */\n\n.PresetManagerListItem {\n cursor: pointer;\n background: var(--color-gray-800);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n}\n\n.PresetManagerListItem:hover,\n.PresetManagerListItem.isSelected {\n background: var(--bg-selected);\n}\n\n.PresetManagerListItemText {\n display: inline-block;\n vertical-align: middle;\n height: 1.5rem;\n line-height: 1.75;\n}\n";
|
|
2612
|
+
styleInject(css_248z$2);
|
|
2401
2613
|
|
|
2402
|
-
function _array_like_to_array$
|
|
2614
|
+
function _array_like_to_array$5(arr, len) {
|
|
2403
2615
|
if (len == null || len > arr.length) len = arr.length;
|
|
2404
2616
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2405
2617
|
return arr2;
|
|
2406
2618
|
}
|
|
2407
|
-
function _array_with_holes$
|
|
2619
|
+
function _array_with_holes$5(arr) {
|
|
2408
2620
|
if (Array.isArray(arr)) return arr;
|
|
2409
2621
|
}
|
|
2410
|
-
function asyncGeneratorStep$
|
|
2622
|
+
function asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2411
2623
|
try {
|
|
2412
2624
|
var info = gen[key](arg);
|
|
2413
2625
|
var value = info.value;
|
|
@@ -2421,22 +2633,22 @@ function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
2421
2633
|
Promise.resolve(value).then(_next, _throw);
|
|
2422
2634
|
}
|
|
2423
2635
|
}
|
|
2424
|
-
function _async_to_generator$
|
|
2636
|
+
function _async_to_generator$3(fn) {
|
|
2425
2637
|
return function() {
|
|
2426
2638
|
var self = this, args = arguments;
|
|
2427
2639
|
return new Promise(function(resolve, reject) {
|
|
2428
2640
|
var gen = fn.apply(self, args);
|
|
2429
2641
|
function _next(value) {
|
|
2430
|
-
asyncGeneratorStep$
|
|
2642
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "next", value);
|
|
2431
2643
|
}
|
|
2432
2644
|
function _throw(err) {
|
|
2433
|
-
asyncGeneratorStep$
|
|
2645
|
+
asyncGeneratorStep$3(gen, resolve, reject, _next, _throw, "throw", err);
|
|
2434
2646
|
}
|
|
2435
2647
|
_next(undefined);
|
|
2436
2648
|
});
|
|
2437
2649
|
};
|
|
2438
2650
|
}
|
|
2439
|
-
function _iterable_to_array_limit$
|
|
2651
|
+
function _iterable_to_array_limit$5(arr, i) {
|
|
2440
2652
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2441
2653
|
if (_i == null) return;
|
|
2442
2654
|
var _arr = [];
|
|
@@ -2460,25 +2672,25 @@ function _iterable_to_array_limit$1(arr, i) {
|
|
|
2460
2672
|
}
|
|
2461
2673
|
return _arr;
|
|
2462
2674
|
}
|
|
2463
|
-
function _non_iterable_rest$
|
|
2675
|
+
function _non_iterable_rest$5() {
|
|
2464
2676
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2465
2677
|
}
|
|
2466
2678
|
function _object_destructuring_empty(o) {
|
|
2467
2679
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
2468
2680
|
return o;
|
|
2469
2681
|
}
|
|
2470
|
-
function _sliced_to_array$
|
|
2471
|
-
return _array_with_holes$
|
|
2682
|
+
function _sliced_to_array$5(arr, i) {
|
|
2683
|
+
return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$5();
|
|
2472
2684
|
}
|
|
2473
|
-
function _unsupported_iterable_to_array$
|
|
2685
|
+
function _unsupported_iterable_to_array$5(o, minLen) {
|
|
2474
2686
|
if (!o) return;
|
|
2475
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
2687
|
+
if (typeof o === "string") return _array_like_to_array$5(o, minLen);
|
|
2476
2688
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2477
2689
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2478
2690
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2479
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
2691
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
|
|
2480
2692
|
}
|
|
2481
|
-
function _ts_generator$
|
|
2693
|
+
function _ts_generator$3(thisArg, body) {
|
|
2482
2694
|
var f, y, t, _ = {
|
|
2483
2695
|
label: 0,
|
|
2484
2696
|
sent: function() {
|
|
@@ -2571,16 +2783,16 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2571
2783
|
}
|
|
2572
2784
|
function PresetManager(param) {
|
|
2573
2785
|
_object_destructuring_empty(param);
|
|
2574
|
-
var _useState = _sliced_to_array$
|
|
2575
|
-
var _useState1 = _sliced_to_array$
|
|
2786
|
+
var _useState = _sliced_to_array$5(useState([]), 2), presetList = _useState[0], setPresetList = _useState[1];
|
|
2787
|
+
var _useState1 = _sliced_to_array$5(useState(false), 2); _useState1[0]; var setIsSaving = _useState1[1];
|
|
2576
2788
|
var savePresetFunc = Juce.getNativeFunction('savePreset');
|
|
2577
2789
|
var loadPresetFunc = Juce.getNativeFunction('loadPreset');
|
|
2578
2790
|
var getAllPresetsFunc = Juce.getNativeFunction('getAllPresets');
|
|
2579
2791
|
var getCurrentPresetFunc = Juce.getNativeFunction('getCurrentPreset');
|
|
2580
2792
|
var isDirtyFunc = Juce.getNativeFunction('canUndo');
|
|
2581
|
-
var _useState2 = _sliced_to_array$
|
|
2793
|
+
var _useState2 = _sliced_to_array$5(useState(), 2), selectedPreset = _useState2[0], setSelectedPreset = _useState2[1];
|
|
2582
2794
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
2583
|
-
var _useState3 = _sliced_to_array$
|
|
2795
|
+
var _useState3 = _sliced_to_array$5(useState(false), 2), isDirty = _useState3[0], setIsDirty = _useState3[1];
|
|
2584
2796
|
useEffect(function() {
|
|
2585
2797
|
if (!isLocalhost) {
|
|
2586
2798
|
var isDirtyListenerId = //@ts-expect-error
|
|
@@ -2599,9 +2811,9 @@ function PresetManager(param) {
|
|
|
2599
2811
|
]);
|
|
2600
2812
|
useEffect(function() {
|
|
2601
2813
|
var getIsDirtyState = function() {
|
|
2602
|
-
return _async_to_generator$
|
|
2814
|
+
return _async_to_generator$3(function() {
|
|
2603
2815
|
var isDirtyState, error;
|
|
2604
|
-
return _ts_generator$
|
|
2816
|
+
return _ts_generator$3(this, function(_state) {
|
|
2605
2817
|
switch(_state.label){
|
|
2606
2818
|
case 0:
|
|
2607
2819
|
_state.trys.push([
|
|
@@ -2639,9 +2851,9 @@ function PresetManager(param) {
|
|
|
2639
2851
|
getIsDirtyState();
|
|
2640
2852
|
});
|
|
2641
2853
|
var loadAllPresets = function(selectedPreset) {
|
|
2642
|
-
return _async_to_generator$
|
|
2854
|
+
return _async_to_generator$3(function() {
|
|
2643
2855
|
var allPresets, currentPreset, error;
|
|
2644
|
-
return _ts_generator$
|
|
2856
|
+
return _ts_generator$3(this, function(_state) {
|
|
2645
2857
|
switch(_state.label){
|
|
2646
2858
|
case 0:
|
|
2647
2859
|
_state.trys.push([
|
|
@@ -2697,7 +2909,7 @@ function PresetManager(param) {
|
|
|
2697
2909
|
loadPresetFunc(value);
|
|
2698
2910
|
};
|
|
2699
2911
|
var loadNextPreset = function(currentValue) {
|
|
2700
|
-
var nextIndex = presetList.indexOf(currentValue) + 1;
|
|
2912
|
+
var nextIndex = (presetList === null || presetList === void 0 ? void 0 : presetList.indexOf(currentValue)) + 1;
|
|
2701
2913
|
if (nextIndex < presetList.length) {
|
|
2702
2914
|
loadPreset(presetList[nextIndex]);
|
|
2703
2915
|
} else {
|
|
@@ -2705,7 +2917,7 @@ function PresetManager(param) {
|
|
|
2705
2917
|
}
|
|
2706
2918
|
};
|
|
2707
2919
|
var loadPreviousPreset = function(currentValue) {
|
|
2708
|
-
var prevIndex = presetList.indexOf(currentValue) - 1;
|
|
2920
|
+
var prevIndex = (presetList === null || presetList === void 0 ? void 0 : presetList.indexOf(currentValue)) - 1;
|
|
2709
2921
|
if (prevIndex >= 0) {
|
|
2710
2922
|
loadPreset(presetList[prevIndex]);
|
|
2711
2923
|
} else {
|
|
@@ -2714,9 +2926,9 @@ function PresetManager(param) {
|
|
|
2714
2926
|
};
|
|
2715
2927
|
var savePreset = function(name) {
|
|
2716
2928
|
var callSavePreset = function(name) {
|
|
2717
|
-
return _async_to_generator$
|
|
2929
|
+
return _async_to_generator$3(function() {
|
|
2718
2930
|
var error;
|
|
2719
|
-
return _ts_generator$
|
|
2931
|
+
return _ts_generator$3(this, function(_state) {
|
|
2720
2932
|
switch(_state.label){
|
|
2721
2933
|
case 0:
|
|
2722
2934
|
setIsSaving(true);
|
|
@@ -2782,7 +2994,6 @@ function PresetManager(param) {
|
|
|
2782
2994
|
}, /*#__PURE__*/ React__default.createElement(IconButton, {
|
|
2783
2995
|
id: "savePreset",
|
|
2784
2996
|
onClick: function(e) {
|
|
2785
|
-
console.log(selectedPreset, 'selected');
|
|
2786
2997
|
e.preventDefault();
|
|
2787
2998
|
selectedPreset && savePreset(selectedPreset);
|
|
2788
2999
|
},
|
|
@@ -2857,15 +3068,15 @@ function PresetManager(param) {
|
|
|
2857
3068
|
}))))));
|
|
2858
3069
|
}
|
|
2859
3070
|
|
|
2860
|
-
function _array_like_to_array(arr, len) {
|
|
3071
|
+
function _array_like_to_array$4(arr, len) {
|
|
2861
3072
|
if (len == null || len > arr.length) len = arr.length;
|
|
2862
3073
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
2863
3074
|
return arr2;
|
|
2864
3075
|
}
|
|
2865
|
-
function _array_with_holes(arr) {
|
|
3076
|
+
function _array_with_holes$4(arr) {
|
|
2866
3077
|
if (Array.isArray(arr)) return arr;
|
|
2867
3078
|
}
|
|
2868
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3079
|
+
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2869
3080
|
try {
|
|
2870
3081
|
var info = gen[key](arg);
|
|
2871
3082
|
var value = info.value;
|
|
@@ -2879,22 +3090,22 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
2879
3090
|
Promise.resolve(value).then(_next, _throw);
|
|
2880
3091
|
}
|
|
2881
3092
|
}
|
|
2882
|
-
function _async_to_generator(fn) {
|
|
3093
|
+
function _async_to_generator$2(fn) {
|
|
2883
3094
|
return function() {
|
|
2884
3095
|
var self = this, args = arguments;
|
|
2885
3096
|
return new Promise(function(resolve, reject) {
|
|
2886
3097
|
var gen = fn.apply(self, args);
|
|
2887
3098
|
function _next(value) {
|
|
2888
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
3099
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
2889
3100
|
}
|
|
2890
3101
|
function _throw(err) {
|
|
2891
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
3102
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
2892
3103
|
}
|
|
2893
3104
|
_next(undefined);
|
|
2894
3105
|
});
|
|
2895
3106
|
};
|
|
2896
3107
|
}
|
|
2897
|
-
function _define_property$
|
|
3108
|
+
function _define_property$6(obj, key, value) {
|
|
2898
3109
|
if (key in obj) {
|
|
2899
3110
|
Object.defineProperty(obj, key, {
|
|
2900
3111
|
value: value,
|
|
@@ -2907,7 +3118,7 @@ function _define_property$1(obj, key, value) {
|
|
|
2907
3118
|
}
|
|
2908
3119
|
return obj;
|
|
2909
3120
|
}
|
|
2910
|
-
function _iterable_to_array_limit(arr, i) {
|
|
3121
|
+
function _iterable_to_array_limit$4(arr, i) {
|
|
2911
3122
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2912
3123
|
if (_i == null) return;
|
|
2913
3124
|
var _arr = [];
|
|
@@ -2931,10 +3142,10 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
2931
3142
|
}
|
|
2932
3143
|
return _arr;
|
|
2933
3144
|
}
|
|
2934
|
-
function _non_iterable_rest() {
|
|
3145
|
+
function _non_iterable_rest$4() {
|
|
2935
3146
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2936
3147
|
}
|
|
2937
|
-
function _object_spread$
|
|
3148
|
+
function _object_spread$6(target) {
|
|
2938
3149
|
for(var i = 1; i < arguments.length; i++){
|
|
2939
3150
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2940
3151
|
var ownKeys = Object.keys(source);
|
|
@@ -2944,23 +3155,23 @@ function _object_spread$1(target) {
|
|
|
2944
3155
|
}));
|
|
2945
3156
|
}
|
|
2946
3157
|
ownKeys.forEach(function(key) {
|
|
2947
|
-
_define_property$
|
|
3158
|
+
_define_property$6(target, key, source[key]);
|
|
2948
3159
|
});
|
|
2949
3160
|
}
|
|
2950
3161
|
return target;
|
|
2951
3162
|
}
|
|
2952
|
-
function _sliced_to_array(arr, i) {
|
|
2953
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
3163
|
+
function _sliced_to_array$4(arr, i) {
|
|
3164
|
+
return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
|
|
2954
3165
|
}
|
|
2955
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
3166
|
+
function _unsupported_iterable_to_array$4(o, minLen) {
|
|
2956
3167
|
if (!o) return;
|
|
2957
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
3168
|
+
if (typeof o === "string") return _array_like_to_array$4(o, minLen);
|
|
2958
3169
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2959
3170
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2960
3171
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
2961
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
3172
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
|
|
2962
3173
|
}
|
|
2963
|
-
function _ts_generator(thisArg, body) {
|
|
3174
|
+
function _ts_generator$2(thisArg, body) {
|
|
2964
3175
|
var f, y, t, _ = {
|
|
2965
3176
|
label: 0,
|
|
2966
3177
|
sent: function() {
|
|
@@ -3056,18 +3267,62 @@ function ModuleHeader(param) {
|
|
|
3056
3267
|
var _globalState_highlightedItem, _globalState_highlightedItem1;
|
|
3057
3268
|
var canUndoFunc = Juce.getNativeFunction('canUndo');
|
|
3058
3269
|
var canRedoFunc = Juce.getNativeFunction('canRedo');
|
|
3270
|
+
var setAdvancedViewFunc = Juce.getNativeFunction('setAdvancedView');
|
|
3271
|
+
var getAdvancedViewFunc = Juce.getNativeFunction('getAdvancedView');
|
|
3059
3272
|
var undo = Juce.getNativeFunction('undo');
|
|
3060
3273
|
var redo = Juce.getNativeFunction('redo');
|
|
3061
3274
|
var isLocalhost = window.location.hostname === 'localhost';
|
|
3062
|
-
var _useState = _sliced_to_array(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
3063
|
-
var _useState1 = _sliced_to_array(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
3064
|
-
var
|
|
3275
|
+
var _useState = _sliced_to_array$4(useState(false), 2), canUndo = _useState[0], setCanUndo = _useState[1];
|
|
3276
|
+
var _useState1 = _sliced_to_array$4(useState(false), 2), canRedo = _useState1[0], setCanRedo = _useState1[1];
|
|
3277
|
+
var _useGlobalContext = useGlobalContext(), globalState = _useGlobalContext.globalState, advancedViewToggled = _useGlobalContext.advancedViewToggled;
|
|
3065
3278
|
var handleUndo = function() {
|
|
3066
3279
|
undo();
|
|
3067
3280
|
};
|
|
3068
3281
|
var handleRedo = function() {
|
|
3069
3282
|
redo();
|
|
3070
3283
|
};
|
|
3284
|
+
var toggleAdvancedView = function() {
|
|
3285
|
+
var toggleViewState = function() {
|
|
3286
|
+
return _async_to_generator$2(function() {
|
|
3287
|
+
var advancedViewStatus, e;
|
|
3288
|
+
return _ts_generator$2(this, function(_state) {
|
|
3289
|
+
switch(_state.label){
|
|
3290
|
+
case 0:
|
|
3291
|
+
_state.trys.push([
|
|
3292
|
+
0,
|
|
3293
|
+
2,
|
|
3294
|
+
,
|
|
3295
|
+
3
|
|
3296
|
+
]);
|
|
3297
|
+
return [
|
|
3298
|
+
4,
|
|
3299
|
+
getAdvancedViewFunc()
|
|
3300
|
+
];
|
|
3301
|
+
case 1:
|
|
3302
|
+
advancedViewStatus = _state.sent();
|
|
3303
|
+
setAdvancedViewFunc(!advancedViewStatus);
|
|
3304
|
+
advancedViewToggled(!advancedViewStatus);
|
|
3305
|
+
return [
|
|
3306
|
+
3,
|
|
3307
|
+
3
|
|
3308
|
+
];
|
|
3309
|
+
case 2:
|
|
3310
|
+
e = _state.sent();
|
|
3311
|
+
console.log(e);
|
|
3312
|
+
return [
|
|
3313
|
+
3,
|
|
3314
|
+
3
|
|
3315
|
+
];
|
|
3316
|
+
case 3:
|
|
3317
|
+
return [
|
|
3318
|
+
2
|
|
3319
|
+
];
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
})();
|
|
3323
|
+
};
|
|
3324
|
+
toggleViewState();
|
|
3325
|
+
};
|
|
3071
3326
|
useEffect(function() {
|
|
3072
3327
|
if (!isLocalhost) {
|
|
3073
3328
|
var undoButtonListenerId = //@ts-expect-error
|
|
@@ -3078,6 +3333,45 @@ function ModuleHeader(param) {
|
|
|
3078
3333
|
window.__JUCE__.backend.addEventListener('updateRedoButton', function(event) {
|
|
3079
3334
|
setCanRedo(event);
|
|
3080
3335
|
});
|
|
3336
|
+
var getViewState = function() {
|
|
3337
|
+
return _async_to_generator$2(function() {
|
|
3338
|
+
var advancedViewStatus, e;
|
|
3339
|
+
return _ts_generator$2(this, function(_state) {
|
|
3340
|
+
switch(_state.label){
|
|
3341
|
+
case 0:
|
|
3342
|
+
_state.trys.push([
|
|
3343
|
+
0,
|
|
3344
|
+
2,
|
|
3345
|
+
,
|
|
3346
|
+
3
|
|
3347
|
+
]);
|
|
3348
|
+
return [
|
|
3349
|
+
4,
|
|
3350
|
+
getAdvancedViewFunc()
|
|
3351
|
+
];
|
|
3352
|
+
case 1:
|
|
3353
|
+
advancedViewStatus = _state.sent();
|
|
3354
|
+
advancedViewToggled(advancedViewStatus);
|
|
3355
|
+
return [
|
|
3356
|
+
3,
|
|
3357
|
+
3
|
|
3358
|
+
];
|
|
3359
|
+
case 2:
|
|
3360
|
+
e = _state.sent();
|
|
3361
|
+
console.log(e);
|
|
3362
|
+
return [
|
|
3363
|
+
3,
|
|
3364
|
+
3
|
|
3365
|
+
];
|
|
3366
|
+
case 3:
|
|
3367
|
+
return [
|
|
3368
|
+
2
|
|
3369
|
+
];
|
|
3370
|
+
}
|
|
3371
|
+
});
|
|
3372
|
+
})();
|
|
3373
|
+
};
|
|
3374
|
+
getViewState();
|
|
3081
3375
|
return function cleanup() {
|
|
3082
3376
|
//@ts-expect-error
|
|
3083
3377
|
window.__JUCE__.backend.removeEventListener(undoButtonListenerId);
|
|
@@ -3092,9 +3386,9 @@ function ModuleHeader(param) {
|
|
|
3092
3386
|
]);
|
|
3093
3387
|
useEffect(function() {
|
|
3094
3388
|
var getUndoRedoState = function() {
|
|
3095
|
-
return _async_to_generator(function() {
|
|
3389
|
+
return _async_to_generator$2(function() {
|
|
3096
3390
|
var canUndoState, canRedoState, error;
|
|
3097
|
-
return _ts_generator(this, function(_state) {
|
|
3391
|
+
return _ts_generator$2(this, function(_state) {
|
|
3098
3392
|
switch(_state.label){
|
|
3099
3393
|
case 0:
|
|
3100
3394
|
_state.trys.push([
|
|
@@ -3146,11 +3440,12 @@ function ModuleHeader(param) {
|
|
|
3146
3440
|
Box.padding.large
|
|
3147
3441
|
],
|
|
3148
3442
|
className: classnames('ModuleHeader', className),
|
|
3149
|
-
style: _object_spread$
|
|
3443
|
+
style: _object_spread$6({}, style)
|
|
3150
3444
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3151
3445
|
style: {
|
|
3152
3446
|
width: '1000px'
|
|
3153
3447
|
},
|
|
3448
|
+
gap: Box.gap.medium,
|
|
3154
3449
|
justifyContent: Box.justifyContent.flexStart
|
|
3155
3450
|
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3156
3451
|
flexDirection: Box.flexDirection.column,
|
|
@@ -3202,10 +3497,37 @@ function ModuleHeader(param) {
|
|
|
3202
3497
|
handleRedo();
|
|
3203
3498
|
},
|
|
3204
3499
|
icon: IconButton.icon.redo
|
|
3205
|
-
}))
|
|
3500
|
+
})), /*#__PURE__*/ React__default.createElement(Box, {
|
|
3501
|
+
justifyContent: Box.justifyContent.flexStart
|
|
3502
|
+
}, /*#__PURE__*/ React__default.createElement(Button, {
|
|
3503
|
+
id: "advancedLayoutButton",
|
|
3504
|
+
className: (globalState === null || globalState === void 0 ? void 0 : globalState.advancedView) ? 'selected' : '',
|
|
3505
|
+
padding: [
|
|
3506
|
+
Button.padding.small,
|
|
3507
|
+
Button.padding.large
|
|
3508
|
+
],
|
|
3509
|
+
onClick: toggleAdvancedView
|
|
3510
|
+
}, /*#__PURE__*/ React__default.createElement("span", {
|
|
3511
|
+
className: "advancedLayoutButtonLabel"
|
|
3512
|
+
}, "Advanced")))));
|
|
3206
3513
|
}
|
|
3207
3514
|
|
|
3208
|
-
|
|
3515
|
+
var css_248z$1 = ".ModMatrix {\n color: var(--color-text);\n font-size: var(--text-ms);\n}\n\n.ModMatrixCell {\n background: #252429;\n position: relative;\n cursor: grab;\n}\n\n.ModMatrixCell:active {\n cursor: grabbing;\n}\n\n.ModMatrixToggleCell {\n cursor: pointer;\n}\n\n.ModMatrixComboboxCell {\n background: #252429;\n cursor: pointer;\n}\n\n.ModMatrixComboboxItems {\n position: absolute;\n z-index: 50;\n bottom: -151px;\n left: 0px;\n height: 150px;\n width: 100%;\n background: var(--color-gray-500);\n color: var(--color-text);\n font-family: var(--font-leagueSpartan);\n overflow-y: auto;\n overflow-x: hidden;\n cursor: pointer;\n}\n\n.ModMatrixComboboxItem:hover,\n.ModMatrixComboboxItem:active,\n.ModMatrixComboboxItem[data-selected] {\n background: var(--color-gray-600);\n}\n\n.ModMatrixComboboxItem {\n padding: var(--spacing-md) var(--spacing-lg);\n width: 100%;\n}\n.ModMatrixComboboxButton {\n cursor: pointer;\n}\n";
|
|
3516
|
+
styleInject(css_248z$1);
|
|
3517
|
+
|
|
3518
|
+
var targetColors = [
|
|
3519
|
+
'var(--color-brand)',
|
|
3520
|
+
'#3B7FDF',
|
|
3521
|
+
'#409578',
|
|
3522
|
+
'#ce5847',
|
|
3523
|
+
'#d98368',
|
|
3524
|
+
'#E0859D',
|
|
3525
|
+
'#4DA1CB',
|
|
3526
|
+
'#cb4d62'
|
|
3527
|
+
];
|
|
3528
|
+
var ComboboxCellWidth = '217px';
|
|
3529
|
+
|
|
3530
|
+
function _define_property$5(obj, key, value) {
|
|
3209
3531
|
if (key in obj) {
|
|
3210
3532
|
Object.defineProperty(obj, key, {
|
|
3211
3533
|
value: value,
|
|
@@ -3218,7 +3540,7 @@ function _define_property(obj, key, value) {
|
|
|
3218
3540
|
}
|
|
3219
3541
|
return obj;
|
|
3220
3542
|
}
|
|
3221
|
-
function _object_spread(target) {
|
|
3543
|
+
function _object_spread$5(target) {
|
|
3222
3544
|
for(var i = 1; i < arguments.length; i++){
|
|
3223
3545
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3224
3546
|
var ownKeys = Object.keys(source);
|
|
@@ -3228,26 +3550,1197 @@ function _object_spread(target) {
|
|
|
3228
3550
|
}));
|
|
3229
3551
|
}
|
|
3230
3552
|
ownKeys.forEach(function(key) {
|
|
3231
|
-
_define_property(target, key, source[key]);
|
|
3553
|
+
_define_property$5(target, key, source[key]);
|
|
3232
3554
|
});
|
|
3233
3555
|
}
|
|
3234
3556
|
return target;
|
|
3235
3557
|
}
|
|
3236
|
-
function
|
|
3237
|
-
var className = param.className, style = param.style;
|
|
3238
|
-
return /*#__PURE__*/ React__default.createElement(
|
|
3239
|
-
|
|
3558
|
+
function SingleBarViz(param) {
|
|
3559
|
+
var _param_background = param.background, background = _param_background === void 0 ? 'var(--color-brand)' : _param_background, _param_height = param.height, height = _param_height === void 0 ? '6px' : _param_height, _param_polarity = param.polarity, polarity = _param_polarity === void 0 ? Polarity.bipolar : _param_polarity, _param_orientation = param.orientation, orientation = _param_orientation === void 0 ? Orientation.horizontal : _param_orientation, value = param.value, className = param.className, style = param.style;
|
|
3560
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
|
3561
|
+
className: className,
|
|
3562
|
+
style: {
|
|
3563
|
+
width: '100%',
|
|
3564
|
+
height: height,
|
|
3565
|
+
background: 'var(--color-gray-600)',
|
|
3566
|
+
position: 'relative'
|
|
3567
|
+
}
|
|
3568
|
+
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
3569
|
+
style: _object_spread$5({
|
|
3570
|
+
position: 'absolute',
|
|
3571
|
+
background: background
|
|
3572
|
+
}, getBarTransformStyles({
|
|
3573
|
+
polarity: polarity,
|
|
3574
|
+
orientation: orientation,
|
|
3575
|
+
value: value || 0
|
|
3576
|
+
}), style)
|
|
3577
|
+
}));
|
|
3578
|
+
}
|
|
3579
|
+
SingleBarViz.polarity = Polarity;
|
|
3580
|
+
|
|
3581
|
+
function _array_like_to_array$3(arr, len) {
|
|
3582
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3583
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3584
|
+
return arr2;
|
|
3585
|
+
}
|
|
3586
|
+
function _array_with_holes$3(arr) {
|
|
3587
|
+
if (Array.isArray(arr)) return arr;
|
|
3588
|
+
}
|
|
3589
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
3590
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3591
|
+
if (_i == null) return;
|
|
3592
|
+
var _arr = [];
|
|
3593
|
+
var _n = true;
|
|
3594
|
+
var _d = false;
|
|
3595
|
+
var _s, _e;
|
|
3596
|
+
try {
|
|
3597
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
3598
|
+
_arr.push(_s.value);
|
|
3599
|
+
if (i && _arr.length === i) break;
|
|
3600
|
+
}
|
|
3601
|
+
} catch (err) {
|
|
3602
|
+
_d = true;
|
|
3603
|
+
_e = err;
|
|
3604
|
+
} finally{
|
|
3605
|
+
try {
|
|
3606
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3607
|
+
} finally{
|
|
3608
|
+
if (_d) throw _e;
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
return _arr;
|
|
3612
|
+
}
|
|
3613
|
+
function _non_iterable_rest$3() {
|
|
3614
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3615
|
+
}
|
|
3616
|
+
function _sliced_to_array$3(arr, i) {
|
|
3617
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
3618
|
+
}
|
|
3619
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
3620
|
+
if (!o) return;
|
|
3621
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
3622
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3623
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3624
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3625
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
3626
|
+
}
|
|
3627
|
+
var useCombobox = function(param) {
|
|
3628
|
+
var id = param.id, filter = param.filter, onChange = param.onChange;
|
|
3629
|
+
var _Object_values;
|
|
3630
|
+
var comboBoxState = Juce.getComboBoxState(id);
|
|
3631
|
+
var _useState = _sliced_to_array$3(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
3632
|
+
var _useState1 = _sliced_to_array$3(useState(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties), 2), properties = _useState1[0], setProperties = _useState1[1];
|
|
3633
|
+
var _useGlobalContext = useGlobalContext(); _useGlobalContext.highlightedItemChanged; var _useGlobalContext_globalState = _useGlobalContext.globalState, automatableParamLabels = _useGlobalContext_globalState.automatableParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3634
|
+
//TODO: Filter choices for subsequent rows
|
|
3635
|
+
// const availableChoices = properties?.choices;
|
|
3636
|
+
useEffect(function() {
|
|
3637
|
+
setValue(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.getChoiceIndex());
|
|
3638
|
+
}, [
|
|
3639
|
+
id
|
|
3640
|
+
]);
|
|
3641
|
+
useEffect(function() {
|
|
3642
|
+
setProperties(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties);
|
|
3643
|
+
});
|
|
3644
|
+
useEffect(function() {
|
|
3645
|
+
var _comboBoxState_valueChangedEvent, _comboBoxState_propertiesChangedEvent;
|
|
3646
|
+
var valueListenerId = comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_valueChangedEvent = comboBoxState.valueChangedEvent) === null || _comboBoxState_valueChangedEvent === void 0 ? void 0 : _comboBoxState_valueChangedEvent.addListener(function() {
|
|
3647
|
+
setValue(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.getChoiceIndex());
|
|
3648
|
+
});
|
|
3649
|
+
var propertiesListenerId = comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_propertiesChangedEvent = comboBoxState.propertiesChangedEvent) === null || _comboBoxState_propertiesChangedEvent === void 0 ? void 0 : _comboBoxState_propertiesChangedEvent.addListener(function() {
|
|
3650
|
+
setProperties(comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.properties);
|
|
3651
|
+
});
|
|
3652
|
+
return function cleanup() {
|
|
3653
|
+
var _comboBoxState_valueChangedEvent, _comboBoxState_propertiesChangedEvent;
|
|
3654
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_valueChangedEvent = comboBoxState.valueChangedEvent) === null || _comboBoxState_valueChangedEvent === void 0 ? void 0 : _comboBoxState_valueChangedEvent.removeListener(valueListenerId);
|
|
3655
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : (_comboBoxState_propertiesChangedEvent = comboBoxState.propertiesChangedEvent) === null || _comboBoxState_propertiesChangedEvent === void 0 ? void 0 : _comboBoxState_propertiesChangedEvent.removeListener(propertiesListenerId);
|
|
3656
|
+
};
|
|
3657
|
+
}, [
|
|
3658
|
+
window
|
|
3659
|
+
]);
|
|
3660
|
+
var selectedChoices = (_Object_values = Object.values(modSlots)) === null || _Object_values === void 0 ? void 0 : _Object_values.filter(function(item) {
|
|
3661
|
+
return item > 0;
|
|
3662
|
+
});
|
|
3663
|
+
var selectedLabels = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.filter(function(item, i) {
|
|
3664
|
+
return selectedChoices === null || selectedChoices === void 0 ? void 0 : selectedChoices.includes(i);
|
|
3665
|
+
});
|
|
3666
|
+
var displayedLabels = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.filter(function(item) {
|
|
3667
|
+
return !(selectedLabels === null || selectedLabels === void 0 ? void 0 : selectedLabels.includes(item)) || item === automatableParamLabels[value];
|
|
3668
|
+
});
|
|
3669
|
+
var filteredChoices = filter && (filter === null || filter === void 0 ? void 0 : filter.length) > 1 ? displayedLabels === null || displayedLabels === void 0 ? void 0 : displayedLabels.filter(function(item) {
|
|
3670
|
+
var _item_toLowerCase;
|
|
3671
|
+
return item === null || item === void 0 ? void 0 : (_item_toLowerCase = item.toLowerCase()) === null || _item_toLowerCase === void 0 ? void 0 : _item_toLowerCase.includes(filter === null || filter === void 0 ? void 0 : filter.toLowerCase());
|
|
3672
|
+
}) : displayedLabels;
|
|
3673
|
+
var prevValue = useRef(null);
|
|
3674
|
+
var handleChange = function(newValue) {
|
|
3675
|
+
if (newValue !== prevValue.current) {
|
|
3676
|
+
var juceIndex = automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels.indexOf(newValue);
|
|
3677
|
+
comboBoxState === null || comboBoxState === void 0 ? void 0 : comboBoxState.setChoiceIndex(juceIndex);
|
|
3678
|
+
setValue(newValue);
|
|
3679
|
+
onChange && onChange(juceIndex);
|
|
3680
|
+
prevValue.current = juceIndex;
|
|
3681
|
+
}
|
|
3682
|
+
};
|
|
3683
|
+
var onMouseEnter = function() {
|
|
3684
|
+
};
|
|
3685
|
+
return {
|
|
3686
|
+
value: value,
|
|
3687
|
+
valueString: automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels[value],
|
|
3688
|
+
setValue: setValue,
|
|
3689
|
+
choices: properties === null || properties === void 0 ? void 0 : properties.choices,
|
|
3690
|
+
filteredChoices: filteredChoices,
|
|
3691
|
+
onMouseEnter: onMouseEnter,
|
|
3692
|
+
handleChange: handleChange
|
|
3693
|
+
};
|
|
3694
|
+
};
|
|
3695
|
+
|
|
3696
|
+
function _array_like_to_array$2(arr, len) {
|
|
3697
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3698
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
3699
|
+
return arr2;
|
|
3700
|
+
}
|
|
3701
|
+
function _array_with_holes$2(arr) {
|
|
3702
|
+
if (Array.isArray(arr)) return arr;
|
|
3703
|
+
}
|
|
3704
|
+
function _define_property$4(obj, key, value) {
|
|
3705
|
+
if (key in obj) {
|
|
3706
|
+
Object.defineProperty(obj, key, {
|
|
3707
|
+
value: value,
|
|
3708
|
+
enumerable: true,
|
|
3709
|
+
configurable: true,
|
|
3710
|
+
writable: true
|
|
3711
|
+
});
|
|
3712
|
+
} else {
|
|
3713
|
+
obj[key] = value;
|
|
3714
|
+
}
|
|
3715
|
+
return obj;
|
|
3716
|
+
}
|
|
3717
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
3718
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3719
|
+
if (_i == null) return;
|
|
3720
|
+
var _arr = [];
|
|
3721
|
+
var _n = true;
|
|
3722
|
+
var _d = false;
|
|
3723
|
+
var _s, _e;
|
|
3724
|
+
try {
|
|
3725
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
3726
|
+
_arr.push(_s.value);
|
|
3727
|
+
if (i && _arr.length === i) break;
|
|
3728
|
+
}
|
|
3729
|
+
} catch (err) {
|
|
3730
|
+
_d = true;
|
|
3731
|
+
_e = err;
|
|
3732
|
+
} finally{
|
|
3733
|
+
try {
|
|
3734
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
3735
|
+
} finally{
|
|
3736
|
+
if (_d) throw _e;
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
return _arr;
|
|
3740
|
+
}
|
|
3741
|
+
function _non_iterable_rest$2() {
|
|
3742
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3743
|
+
}
|
|
3744
|
+
function _object_spread$4(target) {
|
|
3745
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3746
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3747
|
+
var ownKeys = Object.keys(source);
|
|
3748
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3749
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3750
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3751
|
+
}));
|
|
3752
|
+
}
|
|
3753
|
+
ownKeys.forEach(function(key) {
|
|
3754
|
+
_define_property$4(target, key, source[key]);
|
|
3755
|
+
});
|
|
3756
|
+
}
|
|
3757
|
+
return target;
|
|
3758
|
+
}
|
|
3759
|
+
function _sliced_to_array$2(arr, i) {
|
|
3760
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
3761
|
+
}
|
|
3762
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
3763
|
+
if (!o) return;
|
|
3764
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
3765
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3766
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3767
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
3768
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
3769
|
+
}
|
|
3770
|
+
function ModMatrixComboboxCell(param) {
|
|
3771
|
+
var target = param.target, handleTargetChange = param.handleTargetChange, rowId = param.rowId, key = param.key, color = param.color, style = param.style;
|
|
3772
|
+
var _SingleBarViz_polarity;
|
|
3773
|
+
var _useState = _sliced_to_array$2(useState(), 2), targetValue = _useState[0], setTargetValue = _useState[1];
|
|
3774
|
+
var _useState1 = _sliced_to_array$2(useState(''), 2), filterString = _useState1[0], setFilterString = _useState1[1];
|
|
3775
|
+
var _useGlobalContext = useGlobalContext(), automatableParamLabels = _useGlobalContext.globalState.automatableParamLabels;
|
|
3776
|
+
var _useCombobox = useCombobox({
|
|
3777
|
+
id: rowId,
|
|
3778
|
+
filter: filterString,
|
|
3779
|
+
onChange: handleTargetChange
|
|
3780
|
+
}), value = _useCombobox.value, filteredChoices = _useCombobox.filteredChoices, handleChange = _useCombobox.handleChange;
|
|
3781
|
+
useEffect(function() {
|
|
3782
|
+
if (target) {
|
|
3783
|
+
var sliderState = Juce.getSliderState(target);
|
|
3784
|
+
var normalisedValue = sliderState.getNormalisedValue();
|
|
3785
|
+
setTargetValue(normalisedValue);
|
|
3786
|
+
}
|
|
3787
|
+
}, [
|
|
3788
|
+
target
|
|
3789
|
+
]);
|
|
3790
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3791
|
+
key: key,
|
|
3792
|
+
className: "ModMatrixCell ModMatrixComboboxCell",
|
|
3793
|
+
justifyContent: Box.justifyContent.flexEnd,
|
|
3794
|
+
flexDirection: Box.flexDirection.column,
|
|
3795
|
+
style: _object_spread$4({
|
|
3796
|
+
color: color
|
|
3797
|
+
}, style),
|
|
3798
|
+
padding: [
|
|
3799
|
+
Box.padding.medium,
|
|
3800
|
+
Box.padding.large
|
|
3801
|
+
],
|
|
3802
|
+
alignItems: Box.alignItems.flexStart,
|
|
3803
|
+
height: '2.5rem'
|
|
3804
|
+
}, /*#__PURE__*/ React__default.createElement(Combobox, {
|
|
3805
|
+
value: value,
|
|
3806
|
+
onChange: handleChange
|
|
3807
|
+
}, /*#__PURE__*/ React__default.createElement(Box, null, /*#__PURE__*/ React__default.createElement(ComboboxInput, {
|
|
3808
|
+
displayValue: function(item) {
|
|
3809
|
+
return value ? automatableParamLabels === null || automatableParamLabels === void 0 ? void 0 : automatableParamLabels[value] : '';
|
|
3810
|
+
},
|
|
3811
|
+
placeholder: "Select a target...",
|
|
3812
|
+
onChange: function(e) {
|
|
3813
|
+
var _e_target;
|
|
3814
|
+
setFilterString(e === null || e === void 0 ? void 0 : (_e_target = e.target) === null || _e_target === void 0 ? void 0 : _e_target.value);
|
|
3815
|
+
},
|
|
3816
|
+
autoFocus: true
|
|
3817
|
+
}), /*#__PURE__*/ React__default.createElement(ComboboxButton, {
|
|
3818
|
+
className: "ModMatrixComboboxButton"
|
|
3819
|
+
}, /*#__PURE__*/ React__default.createElement(Icon, {
|
|
3820
|
+
icon: Icon.icon.down,
|
|
3821
|
+
backgroundColor: "transparent",
|
|
3822
|
+
onClick: function(e) {
|
|
3823
|
+
return e.preventDefault();
|
|
3824
|
+
},
|
|
3825
|
+
color: color,
|
|
3826
|
+
width: "20px",
|
|
3827
|
+
height: "20px"
|
|
3828
|
+
}))), /*#__PURE__*/ React__default.createElement(ComboboxOptions, {
|
|
3829
|
+
className: "ModMatrixComboboxItems",
|
|
3830
|
+
// anchor="bottom"
|
|
3831
|
+
transition: true
|
|
3832
|
+
}, filteredChoices === null || filteredChoices === void 0 ? void 0 : filteredChoices.map(function(item) {
|
|
3833
|
+
return /*#__PURE__*/ React__default.createElement(ComboboxOption, {
|
|
3834
|
+
className: "ModMatrixComboboxItem",
|
|
3835
|
+
key: item,
|
|
3836
|
+
value: item
|
|
3837
|
+
}, /*#__PURE__*/ React__default.createElement(Label, null, item));
|
|
3838
|
+
}))), /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
3839
|
+
value: targetValue,
|
|
3840
|
+
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.linear,
|
|
3841
|
+
background: color,
|
|
3842
|
+
style: {
|
|
3843
|
+
alignSelf: 'flex-end'
|
|
3844
|
+
}
|
|
3845
|
+
}));
|
|
3846
|
+
}
|
|
3847
|
+
|
|
3848
|
+
function _define_property$3(obj, key, value) {
|
|
3849
|
+
if (key in obj) {
|
|
3850
|
+
Object.defineProperty(obj, key, {
|
|
3851
|
+
value: value,
|
|
3852
|
+
enumerable: true,
|
|
3853
|
+
configurable: true,
|
|
3854
|
+
writable: true
|
|
3855
|
+
});
|
|
3856
|
+
} else {
|
|
3857
|
+
obj[key] = value;
|
|
3858
|
+
}
|
|
3859
|
+
return obj;
|
|
3860
|
+
}
|
|
3861
|
+
function _object_spread$3(target) {
|
|
3862
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3863
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3864
|
+
var ownKeys = Object.keys(source);
|
|
3865
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3866
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3867
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3868
|
+
}));
|
|
3869
|
+
}
|
|
3870
|
+
ownKeys.forEach(function(key) {
|
|
3871
|
+
_define_property$3(target, key, source[key]);
|
|
3872
|
+
});
|
|
3873
|
+
}
|
|
3874
|
+
return target;
|
|
3875
|
+
}
|
|
3876
|
+
function ModMatrixToggleCell(param) {
|
|
3877
|
+
var modifier = param.modifier, color = param.color, style = param.style;
|
|
3878
|
+
var _useDropdown = useDropdown({
|
|
3879
|
+
id: modifier
|
|
3880
|
+
}), value = _useDropdown.value, handleChange = _useDropdown.handleChange;
|
|
3881
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
3882
|
+
className: "ModMatrixCell ModMatrixToggleCell",
|
|
3883
|
+
justifyContent: Box.justifyContent.flexEnd,
|
|
3884
|
+
alignItems: Box.alignItems.flexStart,
|
|
3885
|
+
flexDirection: Box.flexDirection.column,
|
|
3886
|
+
style: _object_spread$3({
|
|
3887
|
+
color: color,
|
|
3888
|
+
pointerEvents: 'all'
|
|
3889
|
+
}, style),
|
|
3890
|
+
height: '2.5rem',
|
|
3891
|
+
onClick: function() {
|
|
3892
|
+
var newValue = Math.abs(value - 1);
|
|
3893
|
+
handleChange(newValue);
|
|
3894
|
+
}
|
|
3895
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
3896
|
+
flex: "1",
|
|
3897
|
+
style: {
|
|
3898
|
+
pointerEvents: 'none'
|
|
3899
|
+
}
|
|
3900
|
+
}, /*#__PURE__*/ React__default.createElement(Label, {
|
|
3901
|
+
style: {
|
|
3902
|
+
pointerEvents: 'none'
|
|
3903
|
+
}
|
|
3904
|
+
}, Object.keys(Polarity)[value] || '0')));
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
function _define_property$2(obj, key, value) {
|
|
3908
|
+
if (key in obj) {
|
|
3909
|
+
Object.defineProperty(obj, key, {
|
|
3910
|
+
value: value,
|
|
3911
|
+
enumerable: true,
|
|
3912
|
+
configurable: true,
|
|
3913
|
+
writable: true
|
|
3914
|
+
});
|
|
3915
|
+
} else {
|
|
3916
|
+
obj[key] = value;
|
|
3917
|
+
}
|
|
3918
|
+
return obj;
|
|
3919
|
+
}
|
|
3920
|
+
function _object_spread$2(target) {
|
|
3921
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3922
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3923
|
+
var ownKeys = Object.keys(source);
|
|
3924
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3925
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3926
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3927
|
+
}));
|
|
3928
|
+
}
|
|
3929
|
+
ownKeys.forEach(function(key) {
|
|
3930
|
+
_define_property$2(target, key, source[key]);
|
|
3931
|
+
});
|
|
3932
|
+
}
|
|
3933
|
+
return target;
|
|
3934
|
+
}
|
|
3935
|
+
function ModMatrixCell(param) {
|
|
3936
|
+
var modifier = param.modifier, color = param.color, style = param.style;
|
|
3937
|
+
var _SingleBarViz_polarity;
|
|
3938
|
+
var _useSlider = useSlider({
|
|
3939
|
+
id: modifier,
|
|
3940
|
+
displayValInHeader: false
|
|
3941
|
+
}), bindBarSliderDrag = _useSlider.bindBarSliderDrag, normalisedValue = _useSlider.normalisedValue;
|
|
3942
|
+
var scaledNormalisedValue = normalisedValue * 100;
|
|
3943
|
+
return /*#__PURE__*/ React__default.createElement(Box, _object_spread$2({
|
|
3944
|
+
className: "ModMatrixCell",
|
|
3945
|
+
justifyContent: Box.justifyContent.flexEnd,
|
|
3946
|
+
alignItems: Box.alignItems.flexStart,
|
|
3947
|
+
flexDirection: Box.flexDirection.column,
|
|
3948
|
+
style: _object_spread$2({
|
|
3949
|
+
color: color,
|
|
3950
|
+
pointerEvents: 'all'
|
|
3951
|
+
}, style),
|
|
3952
|
+
height: '2.5rem'
|
|
3953
|
+
}, bindBarSliderDrag(Orientation.horizontal)), /*#__PURE__*/ React__default.createElement(Box, {
|
|
3954
|
+
flex: "1",
|
|
3955
|
+
style: {
|
|
3956
|
+
pointerEvents: 'none'
|
|
3957
|
+
}
|
|
3958
|
+
}, /*#__PURE__*/ React__default.createElement(Label, null, parseFloat(scaledNormalisedValue.toFixed(2)) || '0')), /*#__PURE__*/ React__default.createElement(Box, {
|
|
3959
|
+
style: {
|
|
3960
|
+
alignSelf: 'flex-end',
|
|
3961
|
+
pointerEvents: 'none'
|
|
3962
|
+
}
|
|
3963
|
+
}, /*#__PURE__*/ React__default.createElement(SingleBarViz, {
|
|
3964
|
+
value: (modifier === null || modifier === void 0 ? void 0 : modifier.value) || 0,
|
|
3965
|
+
polarity: SingleBarViz === null || SingleBarViz === void 0 ? void 0 : (_SingleBarViz_polarity = SingleBarViz.polarity) === null || _SingleBarViz_polarity === void 0 ? void 0 : _SingleBarViz_polarity.linear,
|
|
3966
|
+
background: color,
|
|
3967
|
+
style: _object_spread$2({
|
|
3968
|
+
alignSelf: 'flex-end',
|
|
3969
|
+
pointerEvents: 'none'
|
|
3970
|
+
}, getBarTransformStyles({
|
|
3971
|
+
orientation: Orientation === null || Orientation === void 0 ? void 0 : Orientation.horizontal,
|
|
3972
|
+
polarity: Polarity === null || Polarity === void 0 ? void 0 : Polarity.linear,
|
|
3973
|
+
value: parseFloat(scaledNormalisedValue === null || scaledNormalisedValue === void 0 ? void 0 : scaledNormalisedValue.toFixed(2))
|
|
3974
|
+
}))
|
|
3975
|
+
})));
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3978
|
+
function ModMatrixRow(param) {
|
|
3979
|
+
var rowId = param.rowId, key = param.key, _param_isPreview = param.// rowIndex,
|
|
3980
|
+
isPreview, isPreview = _param_isPreview === void 0 ? false : _param_isPreview, setIsPreview = param.setIsPreview;
|
|
3981
|
+
var _Object_keys, _modSlotParams_modSlotIndex;
|
|
3982
|
+
// const [rowTarget, setRowTarget] = useState<number>();
|
|
3983
|
+
// const getModSlotsFunc = Juce.getNativeFunction('getModSlots');
|
|
3984
|
+
var _useGlobalContext = useGlobalContext(), modSlotUpdated = _useGlobalContext.modSlotUpdated, _useGlobalContext_globalState = _useGlobalContext.globalState, modSlotParams = _useGlobalContext_globalState.modSlotParams, modSlots = _useGlobalContext_globalState.modSlots;
|
|
3985
|
+
var modSlotIndex = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.indexOf(rowId);
|
|
3986
|
+
var handleTargetChange = function(newTarget) {
|
|
3987
|
+
if (newTarget > 0) {
|
|
3988
|
+
modSlotUpdated([
|
|
3989
|
+
rowId,
|
|
3990
|
+
newTarget
|
|
3991
|
+
]);
|
|
3992
|
+
} else {
|
|
3993
|
+
var _modSlotParams_modSlotIndex;
|
|
3994
|
+
modSlotUpdated([
|
|
3995
|
+
rowId,
|
|
3996
|
+
0
|
|
3997
|
+
]);
|
|
3998
|
+
modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex.forEach(function(item) {
|
|
3999
|
+
var sliderState = Juce.getSliderState(item);
|
|
4000
|
+
sliderState === null || sliderState === void 0 ? void 0 : sliderState.setNormalisedValue(0);
|
|
4001
|
+
});
|
|
4002
|
+
}
|
|
4003
|
+
if (isPreview && newTarget) {
|
|
4004
|
+
setIsPreview(false);
|
|
4005
|
+
}
|
|
4006
|
+
};
|
|
4007
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4008
|
+
className: "ModMatrixBodyRow",
|
|
4009
|
+
gap: Box.gap.medium,
|
|
4010
|
+
key: key
|
|
4011
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
4012
|
+
className: "ModMatrixBodyCell ModMatrixComboboxCell",
|
|
4013
|
+
justifyContent: Box.justifyContent.flexStart,
|
|
4014
|
+
flexDirection: Box.flexDirection.column,
|
|
4015
|
+
style: {
|
|
4016
|
+
color: targetColors[0]
|
|
4017
|
+
}
|
|
4018
|
+
}, /*#__PURE__*/ React__default.createElement(ModMatrixComboboxCell, {
|
|
4019
|
+
target: modSlots[rowId],
|
|
4020
|
+
handleTargetChange: handleTargetChange,
|
|
4021
|
+
rowId: rowId,
|
|
4022
|
+
color: targetColors[0],
|
|
4023
|
+
style: {
|
|
4024
|
+
width: ComboboxCellWidth
|
|
4025
|
+
},
|
|
4026
|
+
key: rowId
|
|
4027
|
+
})), modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex.map(function(item, i, arr) {
|
|
4028
|
+
var _modSlotParams_modSlotIndex, _modSlotParams_modSlotIndex1;
|
|
4029
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4030
|
+
className: "ModMatrixBodyCell",
|
|
4031
|
+
flexDirection: Box.flexDirection.column,
|
|
4032
|
+
style: {
|
|
4033
|
+
color: targetColors[i + 1]
|
|
4034
|
+
},
|
|
4035
|
+
key: item
|
|
4036
|
+
}, i !== arr.length - 1 ? /*#__PURE__*/ React__default.createElement(ModMatrixCell, {
|
|
4037
|
+
modifier: modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex === void 0 ? void 0 : _modSlotParams_modSlotIndex[i],
|
|
4038
|
+
color: targetColors[i + 1]
|
|
4039
|
+
}) : /*#__PURE__*/ React__default.createElement(ModMatrixToggleCell, {
|
|
4040
|
+
modifier: modSlotParams === null || modSlotParams === void 0 ? void 0 : (_modSlotParams_modSlotIndex1 = modSlotParams[modSlotIndex]) === null || _modSlotParams_modSlotIndex1 === void 0 ? void 0 : _modSlotParams_modSlotIndex1[i],
|
|
4041
|
+
color: targetColors[i + 1]
|
|
4042
|
+
}));
|
|
4043
|
+
}));
|
|
4044
|
+
}
|
|
4045
|
+
|
|
4046
|
+
function _array_like_to_array$1(arr, len) {
|
|
4047
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4048
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4049
|
+
return arr2;
|
|
4050
|
+
}
|
|
4051
|
+
function _array_with_holes$1(arr) {
|
|
4052
|
+
if (Array.isArray(arr)) return arr;
|
|
4053
|
+
}
|
|
4054
|
+
function _array_without_holes(arr) {
|
|
4055
|
+
if (Array.isArray(arr)) return _array_like_to_array$1(arr);
|
|
4056
|
+
}
|
|
4057
|
+
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4058
|
+
try {
|
|
4059
|
+
var info = gen[key](arg);
|
|
4060
|
+
var value = info.value;
|
|
4061
|
+
} catch (error) {
|
|
4062
|
+
reject(error);
|
|
4063
|
+
return;
|
|
4064
|
+
}
|
|
4065
|
+
if (info.done) {
|
|
4066
|
+
resolve(value);
|
|
4067
|
+
} else {
|
|
4068
|
+
Promise.resolve(value).then(_next, _throw);
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
function _async_to_generator$1(fn) {
|
|
4072
|
+
return function() {
|
|
4073
|
+
var self = this, args = arguments;
|
|
4074
|
+
return new Promise(function(resolve, reject) {
|
|
4075
|
+
var gen = fn.apply(self, args);
|
|
4076
|
+
function _next(value) {
|
|
4077
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
4078
|
+
}
|
|
4079
|
+
function _throw(err) {
|
|
4080
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
4081
|
+
}
|
|
4082
|
+
_next(undefined);
|
|
4083
|
+
});
|
|
4084
|
+
};
|
|
4085
|
+
}
|
|
4086
|
+
function _define_property$1(obj, key, value) {
|
|
4087
|
+
if (key in obj) {
|
|
4088
|
+
Object.defineProperty(obj, key, {
|
|
4089
|
+
value: value,
|
|
4090
|
+
enumerable: true,
|
|
4091
|
+
configurable: true,
|
|
4092
|
+
writable: true
|
|
4093
|
+
});
|
|
4094
|
+
} else {
|
|
4095
|
+
obj[key] = value;
|
|
4096
|
+
}
|
|
4097
|
+
return obj;
|
|
4098
|
+
}
|
|
4099
|
+
function _iterable_to_array(iter) {
|
|
4100
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
4101
|
+
}
|
|
4102
|
+
function _iterable_to_array_limit$1(arr, i) {
|
|
4103
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4104
|
+
if (_i == null) return;
|
|
4105
|
+
var _arr = [];
|
|
4106
|
+
var _n = true;
|
|
4107
|
+
var _d = false;
|
|
4108
|
+
var _s, _e;
|
|
4109
|
+
try {
|
|
4110
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
4111
|
+
_arr.push(_s.value);
|
|
4112
|
+
if (i && _arr.length === i) break;
|
|
4113
|
+
}
|
|
4114
|
+
} catch (err) {
|
|
4115
|
+
_d = true;
|
|
4116
|
+
_e = err;
|
|
4117
|
+
} finally{
|
|
4118
|
+
try {
|
|
4119
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
4120
|
+
} finally{
|
|
4121
|
+
if (_d) throw _e;
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
return _arr;
|
|
4125
|
+
}
|
|
4126
|
+
function _non_iterable_rest$1() {
|
|
4127
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4128
|
+
}
|
|
4129
|
+
function _non_iterable_spread() {
|
|
4130
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4131
|
+
}
|
|
4132
|
+
function _object_spread$1(target) {
|
|
4133
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4134
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
4135
|
+
var ownKeys = Object.keys(source);
|
|
4136
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
4137
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
4138
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
4139
|
+
}));
|
|
4140
|
+
}
|
|
4141
|
+
ownKeys.forEach(function(key) {
|
|
4142
|
+
_define_property$1(target, key, source[key]);
|
|
4143
|
+
});
|
|
4144
|
+
}
|
|
4145
|
+
return target;
|
|
4146
|
+
}
|
|
4147
|
+
function _sliced_to_array$1(arr, i) {
|
|
4148
|
+
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
|
|
4149
|
+
}
|
|
4150
|
+
function _to_consumable_array(arr) {
|
|
4151
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread();
|
|
4152
|
+
}
|
|
4153
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
4154
|
+
if (!o) return;
|
|
4155
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
4156
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4157
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4158
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4159
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
4160
|
+
}
|
|
4161
|
+
function _ts_generator$1(thisArg, body) {
|
|
4162
|
+
var f, y, t, _ = {
|
|
4163
|
+
label: 0,
|
|
4164
|
+
sent: function() {
|
|
4165
|
+
if (t[0] & 1) throw t[1];
|
|
4166
|
+
return t[1];
|
|
4167
|
+
},
|
|
4168
|
+
trys: [],
|
|
4169
|
+
ops: []
|
|
4170
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
4171
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
4172
|
+
return this;
|
|
4173
|
+
}), g;
|
|
4174
|
+
function verb(n) {
|
|
4175
|
+
return function(v) {
|
|
4176
|
+
return step([
|
|
4177
|
+
n,
|
|
4178
|
+
v
|
|
4179
|
+
]);
|
|
4180
|
+
};
|
|
4181
|
+
}
|
|
4182
|
+
function step(op) {
|
|
4183
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
4184
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
4185
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
4186
|
+
if (y = 0, t) op = [
|
|
4187
|
+
op[0] & 2,
|
|
4188
|
+
t.value
|
|
4189
|
+
];
|
|
4190
|
+
switch(op[0]){
|
|
4191
|
+
case 0:
|
|
4192
|
+
case 1:
|
|
4193
|
+
t = op;
|
|
4194
|
+
break;
|
|
4195
|
+
case 4:
|
|
4196
|
+
_.label++;
|
|
4197
|
+
return {
|
|
4198
|
+
value: op[1],
|
|
4199
|
+
done: false
|
|
4200
|
+
};
|
|
4201
|
+
case 5:
|
|
4202
|
+
_.label++;
|
|
4203
|
+
y = op[1];
|
|
4204
|
+
op = [
|
|
4205
|
+
0
|
|
4206
|
+
];
|
|
4207
|
+
continue;
|
|
4208
|
+
case 7:
|
|
4209
|
+
op = _.ops.pop();
|
|
4210
|
+
_.trys.pop();
|
|
4211
|
+
continue;
|
|
4212
|
+
default:
|
|
4213
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
4214
|
+
_ = 0;
|
|
4215
|
+
continue;
|
|
4216
|
+
}
|
|
4217
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
4218
|
+
_.label = op[1];
|
|
4219
|
+
break;
|
|
4220
|
+
}
|
|
4221
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
4222
|
+
_.label = t[1];
|
|
4223
|
+
t = op;
|
|
4224
|
+
break;
|
|
4225
|
+
}
|
|
4226
|
+
if (t && _.label < t[2]) {
|
|
4227
|
+
_.label = t[2];
|
|
4228
|
+
_.ops.push(op);
|
|
4229
|
+
break;
|
|
4230
|
+
}
|
|
4231
|
+
if (t[2]) _.ops.pop();
|
|
4232
|
+
_.trys.pop();
|
|
4233
|
+
continue;
|
|
4234
|
+
}
|
|
4235
|
+
op = body.call(thisArg, _);
|
|
4236
|
+
} catch (e) {
|
|
4237
|
+
op = [
|
|
4238
|
+
6,
|
|
4239
|
+
e
|
|
4240
|
+
];
|
|
4241
|
+
y = 0;
|
|
4242
|
+
} finally{
|
|
4243
|
+
f = t = 0;
|
|
4244
|
+
}
|
|
4245
|
+
if (op[0] & 5) throw op[1];
|
|
4246
|
+
return {
|
|
4247
|
+
value: op[0] ? op[1] : void 0,
|
|
4248
|
+
done: true
|
|
4249
|
+
};
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
//
|
|
4253
|
+
function ModMatrix(param) {
|
|
4254
|
+
var className = param.className, style = param.style;
|
|
4255
|
+
var _Object_keys, _Object_keys1, _Object_keys2;
|
|
4256
|
+
var _useState = _sliced_to_array$1(useState(), 2), previewRowIsActive = _useState[0], setPreviewRowIsActive = _useState[1];
|
|
4257
|
+
var getAutomatableParamsListFunc = Juce.getNativeFunction('getAutomatableParamsList');
|
|
4258
|
+
var getAllModSlotsFunc = Juce.getNativeFunction('getAllModSlots');
|
|
4259
|
+
var getModSlotParamsFunc = Juce.getNativeFunction('getModSlotParams');
|
|
4260
|
+
var _useGlobalContext = useGlobalContext(), automatableParamsListReceived = _useGlobalContext.automatableParamsListReceived, automatableParamLabelsReceived = _useGlobalContext.automatableParamLabelsReceived, modSlotsReceived = _useGlobalContext.modSlotsReceived, modSlotParamsListReceived = _useGlobalContext.modSlotParamsListReceived, modSlotParamLabelsReceived = _useGlobalContext.modSlotParamLabelsReceived, _useGlobalContext_globalState = _useGlobalContext.globalState, modSlotParamLabels = _useGlobalContext_globalState.modSlotParamLabels, modSlots = _useGlobalContext_globalState.modSlots;
|
|
4261
|
+
var getAPVTSParams = function() {
|
|
4262
|
+
return _async_to_generator$1(function() {
|
|
4263
|
+
var automatableParamsList, modSlotsData, modSlotParams, e;
|
|
4264
|
+
return _ts_generator$1(this, function(_state) {
|
|
4265
|
+
switch(_state.label){
|
|
4266
|
+
case 0:
|
|
4267
|
+
_state.trys.push([
|
|
4268
|
+
0,
|
|
4269
|
+
4,
|
|
4270
|
+
,
|
|
4271
|
+
5
|
|
4272
|
+
]);
|
|
4273
|
+
return [
|
|
4274
|
+
4,
|
|
4275
|
+
getAutomatableParamsListFunc()
|
|
4276
|
+
];
|
|
4277
|
+
case 1:
|
|
4278
|
+
automatableParamsList = _state.sent();
|
|
4279
|
+
return [
|
|
4280
|
+
4,
|
|
4281
|
+
getAllModSlotsFunc()
|
|
4282
|
+
];
|
|
4283
|
+
case 2:
|
|
4284
|
+
modSlotsData = _state.sent();
|
|
4285
|
+
return [
|
|
4286
|
+
4,
|
|
4287
|
+
getModSlotParamsFunc()
|
|
4288
|
+
];
|
|
4289
|
+
case 3:
|
|
4290
|
+
modSlotParams = _state.sent();
|
|
4291
|
+
automatableParamsListReceived(automatableParamsList === null || automatableParamsList === void 0 ? void 0 : automatableParamsList[0]);
|
|
4292
|
+
automatableParamLabelsReceived(automatableParamsList === null || automatableParamsList === void 0 ? void 0 : automatableParamsList[1]);
|
|
4293
|
+
modSlotsReceived(modSlotsData || []);
|
|
4294
|
+
modSlotParamsListReceived(modSlotParams === null || modSlotParams === void 0 ? void 0 : modSlotParams[0]);
|
|
4295
|
+
modSlotParamLabelsReceived(modSlotParams === null || modSlotParams === void 0 ? void 0 : modSlotParams[1]);
|
|
4296
|
+
return [
|
|
4297
|
+
3,
|
|
4298
|
+
5
|
|
4299
|
+
];
|
|
4300
|
+
case 4:
|
|
4301
|
+
e = _state.sent();
|
|
4302
|
+
console.log(e);
|
|
4303
|
+
return [
|
|
4304
|
+
3,
|
|
4305
|
+
5
|
|
4306
|
+
];
|
|
4307
|
+
case 5:
|
|
4308
|
+
return [
|
|
4309
|
+
2
|
|
4310
|
+
];
|
|
4311
|
+
}
|
|
4312
|
+
});
|
|
4313
|
+
})();
|
|
4314
|
+
};
|
|
4315
|
+
useEffect(function() {
|
|
4316
|
+
getAPVTSParams();
|
|
4317
|
+
}, [
|
|
4318
|
+
window
|
|
4319
|
+
]);
|
|
4320
|
+
useEffect(function() {
|
|
4321
|
+
var _Object_keys;
|
|
4322
|
+
var assignedModSlots = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(item) {
|
|
4323
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0;
|
|
4324
|
+
});
|
|
4325
|
+
if (!assignedModSlots.length) {
|
|
4326
|
+
setPreviewRowIsActive(true);
|
|
4327
|
+
}
|
|
4328
|
+
}, [
|
|
4329
|
+
modSlots
|
|
4330
|
+
]);
|
|
4331
|
+
var headers = [
|
|
4332
|
+
'Target'
|
|
4333
|
+
].concat(_to_consumable_array(modSlotParamLabels));
|
|
4334
|
+
// [slot2, slot3] unassigned
|
|
4335
|
+
// [slot1] assigned
|
|
4336
|
+
var assignedModSlots = (_Object_keys = Object.keys(modSlots)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.filter(function(item) {
|
|
4337
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0;
|
|
4338
|
+
});
|
|
4339
|
+
var unassignedModSlots = (_Object_keys1 = Object.keys(modSlots)) === null || _Object_keys1 === void 0 ? void 0 : _Object_keys1.filter(function(item) {
|
|
4340
|
+
return (modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) === 0;
|
|
4341
|
+
});
|
|
4342
|
+
var displayedModSlots = (_Object_keys2 = Object.keys(modSlots)) === null || _Object_keys2 === void 0 ? void 0 : _Object_keys2.reduce(function(acc, item) {
|
|
4343
|
+
if ((modSlots === null || modSlots === void 0 ? void 0 : modSlots[item]) > 0 || previewRowIsActive && item === (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots[0])) {
|
|
4344
|
+
return _to_consumable_array(acc).concat([
|
|
4345
|
+
item
|
|
4346
|
+
]);
|
|
4347
|
+
} else {
|
|
4348
|
+
return _to_consumable_array(acc);
|
|
4349
|
+
}
|
|
4350
|
+
}, []);
|
|
4351
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4352
|
+
gap: Box.gap.medium,
|
|
4353
|
+
padding: [
|
|
4354
|
+
Box.padding.medium,
|
|
4355
|
+
Box.padding.large
|
|
4356
|
+
],
|
|
4357
|
+
className: "".concat(className, " ModMatrix"),
|
|
4358
|
+
style: _object_spread$1({
|
|
4359
|
+
backgroundColor: 'var(--bg-section)'
|
|
4360
|
+
}, style),
|
|
4361
|
+
flexDirection: Box.flexDirection.column
|
|
4362
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
4363
|
+
className: "ModMatrixHeader",
|
|
4364
|
+
gap: Box.gap.medium
|
|
4365
|
+
}, headers === null || headers === void 0 ? void 0 : headers.map(function(item, i) {
|
|
4366
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4367
|
+
style: {
|
|
4368
|
+
color: targetColors[i],
|
|
4369
|
+
flex: i === 0 ? "0 0 ".concat(ComboboxCellWidth) : 'initial'
|
|
4370
|
+
},
|
|
4371
|
+
key: item,
|
|
4372
|
+
className: "ModMatrixHeaderCell",
|
|
4373
|
+
padding: [
|
|
4374
|
+
Box.padding.medium,
|
|
4375
|
+
Box.padding.large
|
|
4376
|
+
]
|
|
4377
|
+
}, /*#__PURE__*/ React__default.createElement(Label, null, item));
|
|
4378
|
+
})), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4379
|
+
className: "ModMatrixBody",
|
|
4380
|
+
gap: Box.gap.medium,
|
|
4381
|
+
flexDirection: Box.flexDirection.column
|
|
4382
|
+
}, (displayedModSlots === null || displayedModSlots === void 0 ? void 0 : displayedModSlots.length) ? displayedModSlots === null || displayedModSlots === void 0 ? void 0 : displayedModSlots.map(function(item, i) {
|
|
4383
|
+
return /*#__PURE__*/ React__default.createElement(ModMatrixRow, {
|
|
4384
|
+
rowId: item,
|
|
4385
|
+
key: item,
|
|
4386
|
+
// rowIndex={i}
|
|
4387
|
+
setIsPreview: setPreviewRowIsActive,
|
|
4388
|
+
isPreview: previewRowIsActive && (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.indexOf(item)) === 0
|
|
4389
|
+
});
|
|
4390
|
+
}) : null), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4391
|
+
justifyContent: Box.justifyContent.flexStart
|
|
4392
|
+
}, /*#__PURE__*/ React__default.createElement(IconButton, {
|
|
4393
|
+
id: "addModMatrixRow",
|
|
4394
|
+
icon: IconButton.icon.add,
|
|
4395
|
+
margin: [
|
|
4396
|
+
IconButton.margin.small
|
|
4397
|
+
],
|
|
4398
|
+
padding: [
|
|
4399
|
+
IconButton.padding.small
|
|
4400
|
+
],
|
|
4401
|
+
disabled: (assignedModSlots === null || assignedModSlots === void 0 ? void 0 : assignedModSlots.length) === 0 || (unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.length) === 0,
|
|
4402
|
+
// color="var(--color-gray-500)"
|
|
4403
|
+
// backgroundColor="transparent"
|
|
4404
|
+
onClick: function(e) {
|
|
4405
|
+
if ((unassignedModSlots === null || unassignedModSlots === void 0 ? void 0 : unassignedModSlots.length) > 0) {
|
|
4406
|
+
setPreviewRowIsActive(true);
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
})));
|
|
4410
|
+
}
|
|
4411
|
+
|
|
4412
|
+
var css_248z = "/* Tab styles */\n/* TODO: Refactor to use utility classes? */\n/* TODO: Clean up */\n\n.ModuleFooter {\n overflow-y: scroll;\n}\n\n.ModuleFooter .Tabs-item {\n background: transparent;\n color: var(--color-text);\n font-family: var(--font-leagueSpartan);\n background: var(--color-gray-600);\n flex: 1 0 auto;\n}\n\n.ModuleFooter .Tabs-item:hover,\n.ModuleFooter .tabs-item:focus,\n.ModuleFooter .tabs-item:focus-visible {\n background: var(--color-gray-700);\n}\n\n.ModuleFooter .Tabs-item[data-headlessui-state='selected'] {\n background: var(--color-gray-700);\n}\n";
|
|
4413
|
+
styleInject(css_248z);
|
|
4414
|
+
|
|
4415
|
+
function _array_like_to_array(arr, len) {
|
|
4416
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4417
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4418
|
+
return arr2;
|
|
4419
|
+
}
|
|
4420
|
+
function _array_with_holes(arr) {
|
|
4421
|
+
if (Array.isArray(arr)) return arr;
|
|
4422
|
+
}
|
|
4423
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
4424
|
+
try {
|
|
4425
|
+
var info = gen[key](arg);
|
|
4426
|
+
var value = info.value;
|
|
4427
|
+
} catch (error) {
|
|
4428
|
+
reject(error);
|
|
4429
|
+
return;
|
|
4430
|
+
}
|
|
4431
|
+
if (info.done) {
|
|
4432
|
+
resolve(value);
|
|
4433
|
+
} else {
|
|
4434
|
+
Promise.resolve(value).then(_next, _throw);
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
function _async_to_generator(fn) {
|
|
4438
|
+
return function() {
|
|
4439
|
+
var self = this, args = arguments;
|
|
4440
|
+
return new Promise(function(resolve, reject) {
|
|
4441
|
+
var gen = fn.apply(self, args);
|
|
4442
|
+
function _next(value) {
|
|
4443
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
4444
|
+
}
|
|
4445
|
+
function _throw(err) {
|
|
4446
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
4447
|
+
}
|
|
4448
|
+
_next(undefined);
|
|
4449
|
+
});
|
|
4450
|
+
};
|
|
4451
|
+
}
|
|
4452
|
+
function _define_property(obj, key, value) {
|
|
4453
|
+
if (key in obj) {
|
|
4454
|
+
Object.defineProperty(obj, key, {
|
|
4455
|
+
value: value,
|
|
4456
|
+
enumerable: true,
|
|
4457
|
+
configurable: true,
|
|
4458
|
+
writable: true
|
|
4459
|
+
});
|
|
4460
|
+
} else {
|
|
4461
|
+
obj[key] = value;
|
|
4462
|
+
}
|
|
4463
|
+
return obj;
|
|
4464
|
+
}
|
|
4465
|
+
function _iterable_to_array_limit(arr, i) {
|
|
4466
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
4467
|
+
if (_i == null) return;
|
|
4468
|
+
var _arr = [];
|
|
4469
|
+
var _n = true;
|
|
4470
|
+
var _d = false;
|
|
4471
|
+
var _s, _e;
|
|
4472
|
+
try {
|
|
4473
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
4474
|
+
_arr.push(_s.value);
|
|
4475
|
+
if (i && _arr.length === i) break;
|
|
4476
|
+
}
|
|
4477
|
+
} catch (err) {
|
|
4478
|
+
_d = true;
|
|
4479
|
+
_e = err;
|
|
4480
|
+
} finally{
|
|
4481
|
+
try {
|
|
4482
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
4483
|
+
} finally{
|
|
4484
|
+
if (_d) throw _e;
|
|
4485
|
+
}
|
|
4486
|
+
}
|
|
4487
|
+
return _arr;
|
|
4488
|
+
}
|
|
4489
|
+
function _non_iterable_rest() {
|
|
4490
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
4491
|
+
}
|
|
4492
|
+
function _object_spread(target) {
|
|
4493
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4494
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
4495
|
+
var ownKeys = Object.keys(source);
|
|
4496
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
4497
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
4498
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
4499
|
+
}));
|
|
4500
|
+
}
|
|
4501
|
+
ownKeys.forEach(function(key) {
|
|
4502
|
+
_define_property(target, key, source[key]);
|
|
4503
|
+
});
|
|
4504
|
+
}
|
|
4505
|
+
return target;
|
|
4506
|
+
}
|
|
4507
|
+
function _sliced_to_array(arr, i) {
|
|
4508
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
4509
|
+
}
|
|
4510
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
4511
|
+
if (!o) return;
|
|
4512
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
4513
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
4514
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
4515
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
4516
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
4517
|
+
}
|
|
4518
|
+
function _ts_generator(thisArg, body) {
|
|
4519
|
+
var f, y, t, _ = {
|
|
4520
|
+
label: 0,
|
|
4521
|
+
sent: function() {
|
|
4522
|
+
if (t[0] & 1) throw t[1];
|
|
4523
|
+
return t[1];
|
|
4524
|
+
},
|
|
4525
|
+
trys: [],
|
|
4526
|
+
ops: []
|
|
4527
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
4528
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
4529
|
+
return this;
|
|
4530
|
+
}), g;
|
|
4531
|
+
function verb(n) {
|
|
4532
|
+
return function(v) {
|
|
4533
|
+
return step([
|
|
4534
|
+
n,
|
|
4535
|
+
v
|
|
4536
|
+
]);
|
|
4537
|
+
};
|
|
4538
|
+
}
|
|
4539
|
+
function step(op) {
|
|
4540
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
4541
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
4542
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
4543
|
+
if (y = 0, t) op = [
|
|
4544
|
+
op[0] & 2,
|
|
4545
|
+
t.value
|
|
4546
|
+
];
|
|
4547
|
+
switch(op[0]){
|
|
4548
|
+
case 0:
|
|
4549
|
+
case 1:
|
|
4550
|
+
t = op;
|
|
4551
|
+
break;
|
|
4552
|
+
case 4:
|
|
4553
|
+
_.label++;
|
|
4554
|
+
return {
|
|
4555
|
+
value: op[1],
|
|
4556
|
+
done: false
|
|
4557
|
+
};
|
|
4558
|
+
case 5:
|
|
4559
|
+
_.label++;
|
|
4560
|
+
y = op[1];
|
|
4561
|
+
op = [
|
|
4562
|
+
0
|
|
4563
|
+
];
|
|
4564
|
+
continue;
|
|
4565
|
+
case 7:
|
|
4566
|
+
op = _.ops.pop();
|
|
4567
|
+
_.trys.pop();
|
|
4568
|
+
continue;
|
|
4569
|
+
default:
|
|
4570
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
4571
|
+
_ = 0;
|
|
4572
|
+
continue;
|
|
4573
|
+
}
|
|
4574
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
4575
|
+
_.label = op[1];
|
|
4576
|
+
break;
|
|
4577
|
+
}
|
|
4578
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
4579
|
+
_.label = t[1];
|
|
4580
|
+
t = op;
|
|
4581
|
+
break;
|
|
4582
|
+
}
|
|
4583
|
+
if (t && _.label < t[2]) {
|
|
4584
|
+
_.label = t[2];
|
|
4585
|
+
_.ops.push(op);
|
|
4586
|
+
break;
|
|
4587
|
+
}
|
|
4588
|
+
if (t[2]) _.ops.pop();
|
|
4589
|
+
_.trys.pop();
|
|
4590
|
+
continue;
|
|
4591
|
+
}
|
|
4592
|
+
op = body.call(thisArg, _);
|
|
4593
|
+
} catch (e) {
|
|
4594
|
+
op = [
|
|
4595
|
+
6,
|
|
4596
|
+
e
|
|
4597
|
+
];
|
|
4598
|
+
y = 0;
|
|
4599
|
+
} finally{
|
|
4600
|
+
f = t = 0;
|
|
4601
|
+
}
|
|
4602
|
+
if (op[0] & 5) throw op[1];
|
|
4603
|
+
return {
|
|
4604
|
+
value: op[0] ? op[1] : void 0,
|
|
4605
|
+
done: true
|
|
4606
|
+
};
|
|
4607
|
+
}
|
|
4608
|
+
}
|
|
4609
|
+
var FooterTabs = /*#__PURE__*/ function(FooterTabs) {
|
|
4610
|
+
FooterTabs["ModMatrix"] = "ModMatrix";
|
|
4611
|
+
FooterTabs["InputMod"] = "InputMod";
|
|
4612
|
+
FooterTabs["LFOs"] = "LFOs";
|
|
4613
|
+
FooterTabs["Sequencer"] = "Sequencer";
|
|
4614
|
+
FooterTabs["Settings"] = "Settings";
|
|
4615
|
+
return FooterTabs;
|
|
4616
|
+
}({});
|
|
4617
|
+
var ModMatrixTab = function() {
|
|
4618
|
+
return /*#__PURE__*/ React__default.createElement(ModMatrix, null);
|
|
4619
|
+
};
|
|
4620
|
+
var InputModTab = function() {
|
|
4621
|
+
return /*#__PURE__*/ React__default.createElement(Box, null, "InputModTab");
|
|
4622
|
+
};
|
|
4623
|
+
var LFOsTab = function() {
|
|
4624
|
+
return /*#__PURE__*/ React__default.createElement(Box, null, "LFOsTab");
|
|
4625
|
+
};
|
|
4626
|
+
var SequencerTab = function() {
|
|
4627
|
+
return /*#__PURE__*/ React__default.createElement(Box, null, "SequencerTab");
|
|
4628
|
+
};
|
|
4629
|
+
var SettingsTab = function() {
|
|
4630
|
+
return /*#__PURE__*/ React__default.createElement(Box, null, "SettingsTab");
|
|
4631
|
+
};
|
|
4632
|
+
function ModuleFooter(param) {
|
|
4633
|
+
var className = param.className, style = param.style;
|
|
4634
|
+
var _useState = _sliced_to_array(useState(0), 2), selectedTab = _useState[0], setSelectedTab = _useState[1];
|
|
4635
|
+
var setSelectedFooterTabFunc = Juce.getNativeFunction('setSelectedFooterTab');
|
|
4636
|
+
var getSelectedFooterTabFunc = Juce.getNativeFunction('getSelectedFooterTab');
|
|
4637
|
+
var isTabSelected = function(tabName) {
|
|
4638
|
+
return Object.keys(FooterTabs)[selectedTab] === tabName;
|
|
4639
|
+
};
|
|
4640
|
+
useEffect(function() {
|
|
4641
|
+
var getTabFromBackend = function() {
|
|
4642
|
+
return _async_to_generator(function() {
|
|
4643
|
+
var selectedIndex, e;
|
|
4644
|
+
return _ts_generator(this, function(_state) {
|
|
4645
|
+
switch(_state.label){
|
|
4646
|
+
case 0:
|
|
4647
|
+
_state.trys.push([
|
|
4648
|
+
0,
|
|
4649
|
+
2,
|
|
4650
|
+
,
|
|
4651
|
+
3
|
|
4652
|
+
]);
|
|
4653
|
+
return [
|
|
4654
|
+
4,
|
|
4655
|
+
getSelectedFooterTabFunc()
|
|
4656
|
+
];
|
|
4657
|
+
case 1:
|
|
4658
|
+
selectedIndex = _state.sent();
|
|
4659
|
+
setSelectedTab(selectedIndex);
|
|
4660
|
+
return [
|
|
4661
|
+
3,
|
|
4662
|
+
3
|
|
4663
|
+
];
|
|
4664
|
+
case 2:
|
|
4665
|
+
e = _state.sent();
|
|
4666
|
+
console.log(e);
|
|
4667
|
+
return [
|
|
4668
|
+
3,
|
|
4669
|
+
3
|
|
4670
|
+
];
|
|
4671
|
+
case 3:
|
|
4672
|
+
return [
|
|
4673
|
+
2
|
|
4674
|
+
];
|
|
4675
|
+
}
|
|
4676
|
+
});
|
|
4677
|
+
})();
|
|
4678
|
+
};
|
|
4679
|
+
getTabFromBackend();
|
|
4680
|
+
}, [
|
|
4681
|
+
window
|
|
4682
|
+
]);
|
|
4683
|
+
var handleTabChange = function(newSelection) {
|
|
4684
|
+
var updateBackend = function() {
|
|
4685
|
+
return _async_to_generator(function() {
|
|
4686
|
+
return _ts_generator(this, function(_state) {
|
|
4687
|
+
try {
|
|
4688
|
+
setSelectedFooterTabFunc(newSelection);
|
|
4689
|
+
setSelectedTab(newSelection);
|
|
4690
|
+
} catch (e) {
|
|
4691
|
+
console.log(e);
|
|
4692
|
+
}
|
|
4693
|
+
return [
|
|
4694
|
+
2
|
|
4695
|
+
];
|
|
4696
|
+
});
|
|
4697
|
+
})();
|
|
4698
|
+
};
|
|
4699
|
+
updateBackend();
|
|
4700
|
+
};
|
|
4701
|
+
return /*#__PURE__*/ React__default.createElement(Box, {
|
|
4702
|
+
gap: Box.gap.medium,
|
|
3240
4703
|
tag: Box.tag.footer,
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
],
|
|
3245
|
-
className: classnames(className),
|
|
4704
|
+
height: "100%",
|
|
4705
|
+
alignItems: Box.alignItems.flexStart,
|
|
4706
|
+
className: "ModuleFooter ".concat(className),
|
|
3246
4707
|
style: _object_spread({
|
|
3247
4708
|
backgroundColor: 'var(--bg-section)'
|
|
3248
4709
|
}, style)
|
|
3249
|
-
}
|
|
4710
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
4711
|
+
flexDirection: Box.flexDirection.column
|
|
4712
|
+
}, /*#__PURE__*/ React__default.createElement(Box, {
|
|
4713
|
+
style: {
|
|
4714
|
+
backgroundColor: 'var(--color-gray-500)'
|
|
4715
|
+
},
|
|
4716
|
+
padding: [
|
|
4717
|
+
Box.padding.small,
|
|
4718
|
+
Box.padding.small,
|
|
4719
|
+
Box.padding.none,
|
|
4720
|
+
Box.padding.small
|
|
4721
|
+
]
|
|
4722
|
+
}, /*#__PURE__*/ React__default.createElement(Tabs, {
|
|
4723
|
+
items: [
|
|
4724
|
+
'Mod Matrix',
|
|
4725
|
+
'Input mod',
|
|
4726
|
+
'LFOs',
|
|
4727
|
+
'Sequencer',
|
|
4728
|
+
'Settings'
|
|
4729
|
+
],
|
|
4730
|
+
onChange: handleTabChange,
|
|
4731
|
+
selectedIndex: selectedTab,
|
|
4732
|
+
gap: "2px",
|
|
4733
|
+
padding: [
|
|
4734
|
+
Tabs.padding.medium,
|
|
4735
|
+
Tabs.padding.large
|
|
4736
|
+
],
|
|
4737
|
+
width: "100%"
|
|
4738
|
+
})), /*#__PURE__*/ React__default.createElement(Box, {
|
|
4739
|
+
padding: [
|
|
4740
|
+
Box.padding.large
|
|
4741
|
+
]
|
|
4742
|
+
}, isTabSelected("ModMatrix") ? /*#__PURE__*/ React__default.createElement(ModMatrixTab, null) : '', isTabSelected("InputMod") ? /*#__PURE__*/ React__default.createElement(InputModTab, null) : '', isTabSelected("LFOs") ? /*#__PURE__*/ React__default.createElement(LFOsTab, null) : '', isTabSelected("Sequencer") ? /*#__PURE__*/ React__default.createElement(SequencerTab, null) : '', isTabSelected("Settings") ? /*#__PURE__*/ React__default.createElement(SettingsTab, null) : '')));
|
|
3250
4743
|
}
|
|
3251
4744
|
|
|
3252
|
-
export { Slider as BarSlider, Box, Button, Dropdown, FontSizes, GlobalContextProvider, Heading, IconButton, IndicatorLight, Input, KeyValueDisplayScreen, Label,
|
|
4745
|
+
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 };
|
|
3253
4746
|
//# sourceMappingURL=index.js.map
|