zds-pickers 4.0.13 → 4.0.14

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.
Files changed (93) hide show
  1. package/dist/index.cjs.js +160 -1
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.es.js +12482 -36
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/midi/ccValues.js +2 -2
  7. package/dist/other/DefaultTooltip.js +1 -1
  8. package/dist/other/OctavePlayer.js +4 -4
  9. package/dist/other/SoundFontProvider.js +1 -1
  10. package/dist/other/{SVGText.js → SvgText.js} +2 -3
  11. package/dist/pickers/CCPicker.js +4 -4
  12. package/dist/pickers/ChannelMappingPicker.js +2 -2
  13. package/dist/pickers/ChannelPicker.js +2 -2
  14. package/dist/pickers/Knob.js +3 -3
  15. package/dist/pickers/KnobPicker.js +3 -3
  16. package/dist/pickers/LatchPicker.js +2 -2
  17. package/dist/pickers/MappingPicker.js +2 -2
  18. package/dist/pickers/NotePicker.js +2 -2
  19. package/dist/pickers/PianoPicker.js +4 -4
  20. package/dist/pickers/PolarityPicker.js +2 -2
  21. package/dist/pickers/ResponseCurve.js +4 -4
  22. package/dist/pickers/ResponseCurvePicker.js +4 -4
  23. package/dist/pickers/Select.js +1 -1
  24. package/dist/pickers/StatusPicker.js +2 -2
  25. package/dist/pickers/ValuePicker.js +2 -2
  26. package/dist/pickers/knobSkin10.js +1 -1
  27. package/dist/rotaryKnob/InternalInput.js +1 -1
  28. package/dist/rotaryKnob/helpers/DrawCircle.js +1 -1
  29. package/dist/rotaryKnob/helpers/DrawLine.js +1 -1
  30. package/dist/rotaryKnob/helpers/HelpersOverlay.js +1 -1
  31. package/dist/rotaryKnob/helpers/KnobVisualHelpers.js +6 -6
  32. package/dist/rotaryKnob/index.js +6 -6
  33. package/dist/rotaryKnob/utils.js +4 -8
  34. package/dist/types/index.d.ts +2 -2
  35. package/dist/types/midi/ccValues.d.ts +2 -2
  36. package/dist/types/other/DefaultTooltip.d.ts +1 -1
  37. package/dist/types/other/OctavePlayer.d.ts +1 -1
  38. package/dist/types/other/SoundFontProvider.d.ts +1 -1
  39. package/dist/types/other/{SVGText.d.ts → SvgText.d.ts} +2 -3
  40. package/dist/types/pickers/CCPicker.d.ts +1 -1
  41. package/dist/types/pickers/ChannelMappingPicker.d.ts +1 -1
  42. package/dist/types/pickers/ChannelPicker.d.ts +1 -1
  43. package/dist/types/pickers/Knob.d.ts +1 -1
  44. package/dist/types/pickers/KnobPicker.d.ts +1 -1
  45. package/dist/types/pickers/LatchPicker.d.ts +1 -1
  46. package/dist/types/pickers/MappingPicker.d.ts +1 -1
  47. package/dist/types/pickers/NotePicker.d.ts +1 -1
  48. package/dist/types/pickers/PianoPicker.d.ts +1 -1
  49. package/dist/types/pickers/PolarityPicker.d.ts +1 -1
  50. package/dist/types/pickers/ResponseCurve.d.ts +3 -3
  51. package/dist/types/pickers/ResponseCurvePicker.d.ts +1 -1
  52. package/dist/types/pickers/Select.d.ts +1 -1
  53. package/dist/types/pickers/StatusPicker.d.ts +1 -1
  54. package/dist/types/pickers/ValuePicker.d.ts +1 -1
  55. package/dist/types/pickers/knobSkin10.d.ts +1 -1
  56. package/dist/types/rotaryKnob/InternalInput.d.ts +1 -1
  57. package/dist/types/rotaryKnob/helpers/DrawCircle.d.ts +1 -1
  58. package/dist/types/rotaryKnob/helpers/DrawLine.d.ts +1 -1
  59. package/dist/types/rotaryKnob/helpers/HelpersOverlay.d.ts +1 -1
  60. package/dist/types/rotaryKnob/index.d.ts +1 -1
  61. package/dist/types/rotaryKnob/utils.d.ts +1 -7
  62. package/lib/index.ts +2 -2
  63. package/lib/midi/ccValues.ts +2 -2
  64. package/lib/other/DefaultTooltip.ts +1 -1
  65. package/lib/other/OctavePlayer.tsx +4 -4
  66. package/lib/other/SoundFontProvider.tsx +1 -1
  67. package/lib/other/{SVGText.tsx → SvgText.tsx} +2 -4
  68. package/lib/pickers/CCPicker.tsx +4 -4
  69. package/lib/pickers/ChannelMappingPicker.tsx +2 -2
  70. package/lib/pickers/ChannelPicker.tsx +2 -2
  71. package/lib/pickers/Knob.tsx +3 -3
  72. package/lib/pickers/KnobPicker.tsx +3 -3
  73. package/lib/pickers/LatchPicker.tsx +2 -2
  74. package/lib/pickers/MappingPicker.tsx +2 -2
  75. package/lib/pickers/NotePicker.tsx +2 -2
  76. package/lib/pickers/PianoPicker.tsx +4 -4
  77. package/lib/pickers/PolarityPicker.tsx +2 -2
  78. package/lib/pickers/ResponseCurve.tsx +8 -8
  79. package/lib/pickers/ResponseCurvePicker.tsx +4 -4
  80. package/lib/pickers/Select.tsx +1 -1
  81. package/lib/pickers/StatusPicker.tsx +2 -2
  82. package/lib/pickers/ValuePicker.tsx +2 -2
  83. package/lib/pickers/knobSkin10.tsx +1 -1
  84. package/lib/rotaryKnob/InternalInput.tsx +1 -1
  85. package/lib/rotaryKnob/helpers/DrawCircle.tsx +1 -1
  86. package/lib/rotaryKnob/helpers/DrawLine.tsx +1 -1
  87. package/lib/rotaryKnob/helpers/HelpersOverlay.tsx +1 -1
  88. package/lib/rotaryKnob/helpers/KnobVisualHelpers.tsx +6 -7
  89. package/lib/rotaryKnob/index.tsx +6 -6
  90. package/lib/rotaryKnob/utils.ts +1 -1
  91. package/package.json +1 -1
  92. package/stories/assets/utils.js +1 -1
  93. package/stories/picker.stories.tsx +15 -15
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ export * from './midi/ccValues';
2
2
  export * from './midi/export';
3
3
  export * from './other/DefaultTooltip';
4
4
  export * from './other/OctavePlayer';
5
- export * from './other/SVGText';
5
+ export * from './other/SvgText';
6
6
  export * from './pickers/ChannelMappingPicker';
7
7
  export * from './pickers/ChannelPicker';
8
8
  export * from './pickers/Knob';
@@ -1,4 +1,4 @@
1
- const CC_NAMES = [
1
+ const changeControllerOptions = [
2
2
  'Bank Select',
3
3
  'Modulation Wheel',
4
4
  'Breath Controller',
@@ -131,4 +131,4 @@ const CC_NAMES = [
131
131
  label: String(label).length ? `${value} - ${label}` : String(value),
132
132
  value,
133
133
  }));
134
- export default CC_NAMES;
134
+ export { changeControllerOptions };
@@ -1,3 +1,3 @@
1
1
  import { Fragment, createElement } from 'react';
2
2
  const DefaultTooltip = ({ children }) => createElement(Fragment, null, children);
3
- export default DefaultTooltip;
3
+ export { DefaultTooltip };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { /* Midi, */ Note } from 'tonal';
3
3
  import { Piano as ReactPiano } from 'zds-react-piano';
4
- import SoundfontProvider from './SoundFontProvider';
4
+ import { SoundfontProvider } from './SoundFontProvider';
5
5
  const baseNotes = [
6
6
  'C',
7
7
  'C#',
@@ -23,7 +23,7 @@ const baseNotes = [
23
23
  const numNotes = 12;
24
24
  const whiteNotes = numNotes * 0.7; // approx
25
25
  const audioContext = new window.AudioContext();
26
- const OctavePlayer = ({ octave, height, width, ...rest }) => {
26
+ const BaseOctavePlayer = ({ octave, height, width, ...rest }) => {
27
27
  const keyWidth = width / whiteNotes + 2;
28
28
  const keyWidthToHeight = keyWidth / height;
29
29
  const firstNote = Note.midi(baseNotes[0] + String(octave)) || 0;
@@ -35,7 +35,7 @@ const WithProvider = ({ format, height, hostname, instrumentName, octave = 4, on
35
35
  hostname,
36
36
  instrumentName,
37
37
  onChange,
38
- soundfont, render: ({ isLoading, playNote, stopNote, }) => (_jsxs(_Fragment, { children: [_jsx("div", { children: _jsxs("h2", { children: ["Octave: ", octave] }) }), _jsx(OctavePlayer, { disabled: isLoading, height,
38
+ soundfont, render: ({ isLoading, playNote, stopNote, }) => (_jsxs(_Fragment, { children: [_jsx("div", { children: _jsxs("h2", { children: ["Octave: ", octave] }) }), _jsx(BaseOctavePlayer, { disabled: isLoading, height,
39
39
  octave,
40
40
  onClick,
41
41
  onDoubleClick,
@@ -45,4 +45,4 @@ const WithProvider = ({ format, height, hostname, instrumentName, octave = 4, on
45
45
  stopNote,
46
46
  Tooltip,
47
47
  width })] })) }));
48
- export default WithProvider;
48
+ export { WithProvider as OctavePlayer };
@@ -84,4 +84,4 @@ const SoundfontProvider = (props) => {
84
84
  };
85
85
  // https://gleitz.github.io/midi-js-soundfonts/MusyngKite/acoustic_grand_piano-mp3.js
86
86
  // https://gleitz.github.io/midi-js-soundfonts/FluidR3_GM/.js
87
- export default SoundfontProvider;
87
+ export { SoundfontProvider };
@@ -43,7 +43,7 @@ const calculateWordWidths = (style, textNode, text) => {
43
43
  }
44
44
  return undefined;
45
45
  };
46
- const Text = (props) => {
46
+ const SvgText = (props) => {
47
47
  const { className = '', dx = 0, dy = 0, maxHeight = 1000, maxWidth = 1000,
48
48
  // textAnchor = 'start',
49
49
  text = '', verticalAnchor = 'start', x = 0, y = 0, transform = '', ...rest } = props;
@@ -105,5 +105,4 @@ const Text = (props) => {
105
105
  // textAnchor={textAnchor}
106
106
  transform: transform, ...rest, children: _jsxs(_Fragment, { children: [displayedLines.map((line, idx) => (_jsx("tspan", { dx: x + dx, dy: idx === 0 ? startDy + dy : wordWidths?.lineHeight || 0, x: 0, children: line.words.join(' ') }, idx))), textLines.length && displayedLines.length !== textLines.length && (_jsxs(_Fragment, { children: [_jsx("tspan", { children: "..." }), _jsx("title", { children: text })] }))] }) }));
107
107
  };
108
- export default Text;
109
- export { MEASUREMENT_ELEMENT_ID };
108
+ export { SvgText, MEASUREMENT_ELEMENT_ID };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import ccValues from '../midi/ccValues';
4
- import Select from './Select';
5
- const CCPicker = forwardRef((props, ref) => (_jsx(Select, { ...props, options: ccValues, ref: ref })));
6
- export default CCPicker;
3
+ import { changeControllerOptions } from '../midi/ccValues';
4
+ import { Select } from './Select';
5
+ const CCPicker = forwardRef((props, ref) => (_jsx(Select, { ...props, options: changeControllerOptions, ref: ref })));
6
+ export { CCPicker };
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import cl from 'classnames';
3
3
  import { forwardRef, useCallback, useEffect, useState } from 'react';
4
4
  import { arraySequence } from '../utils';
5
- import Select from './Select';
5
+ import { Select } from './Select';
6
6
  const defaultOptions = arraySequence(16).map(value => ({
7
7
  value,
8
8
  label: value,
@@ -47,4 +47,4 @@ const ChannelMappingPicker = forwardRef(({ channels, className, ...rest }, ref)
47
47
  }, [channels]);
48
48
  return (_jsx(Select, { ...rest, className: cl(className, 'channel-mapping-picker'), formatOptionLabel: formatOptionLabel, options: options, ref: ref }));
49
49
  });
50
- export default ChannelMappingPicker;
50
+ export { ChannelMappingPicker };
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import cl from 'classnames';
3
3
  import { forwardRef } from 'react';
4
4
  import { arraySequence } from '../utils';
5
- import Select from './Select';
5
+ import { Select } from './Select';
6
6
  const options = arraySequence(16).map(value => ({
7
7
  value: value,
8
8
  label: `Channel ${value + 1}`,
@@ -18,4 +18,4 @@ const filterOptions = (option, input) => {
18
18
  const ChannelPicker = forwardRef(({ className, ...rest }, ref) => {
19
19
  return (_jsx(Select, { ...rest, className: cl(className, 'channel-picker'), filterOptions: filterOptions, formatOptionLabel: formatOptionLabel, options: options, ref: ref }));
20
20
  });
21
- export default ChannelPicker;
21
+ export { ChannelPicker };
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback } from 'react';
3
3
  import useStateWithDynamicDefault from '../hooks/useStateWithDynamicDefault';
4
- import RotaryKnob from '../rotaryKnob';
4
+ import { RotaryKnob } from '../rotaryKnob';
5
5
  import { assertRange } from '../utils';
6
- import knobSkin10 from './knobSkin10';
6
+ import { knobSkin10 } from './knobSkin10';
7
7
  const Knob = (props) => {
8
8
  const { disabled = false, max = 127, min = 0, onChange, value: initialValue = 0, wheelEnabled = false, wheelSensitivity = 0.1, ...rest } = props;
9
9
  const [value, setValue] = useStateWithDynamicDefault(initialValue);
@@ -46,4 +46,4 @@ const Knob = (props) => {
46
46
  */
47
47
  skin: knobSkin10, style: { opacity: disabled ? 0.4 : 1 }, unlockDistance: 0, defaultValue: value, max, min, value, ...rest }));
48
48
  };
49
- export default Knob;
49
+ export { Knob };
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useMemo } from 'react';
3
3
  import { arraySequence } from '../utils';
4
- import Knob from './Knob';
5
- import Select from './Select';
4
+ import { Knob } from './Knob';
5
+ import { Select } from './Select';
6
6
  const KnobPicker = forwardRef((props, ref) => {
7
7
  const { disabled, highToLow, includeLabel, includePicker, knobProps, label, max = 127, min = 0, onChange, shrinkLabel, value = 0, wheelEnabled, wheelSensitivity = 0.1, ...rest } = props;
8
8
  const options = useMemo(() => {
@@ -26,4 +26,4 @@ const KnobPicker = forwardRef((props, ref) => {
26
26
  wheelSensitivity,
27
27
  ...knobProps })] })] }));
28
28
  });
29
- export default KnobPicker;
29
+ export { KnobPicker };
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import Select from './Select';
3
+ import { Select } from './Select';
4
4
  const options = [
5
5
  { value: 0, label: 'Momentary' },
6
6
  { value: 1, label: 'Latching' },
7
7
  ];
8
8
  const LatchPicker = forwardRef((props, ref) => (_jsx(Select, { ...props, options: options, ref: ref })));
9
- export default LatchPicker;
9
+ export { LatchPicker };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useMemo } from 'react';
3
3
  import { getStockNames, getUserMappingNames } from 'zds-mappings';
4
- import Select from './Select';
4
+ import { Select } from './Select';
5
5
  const MappingPicker = forwardRef(({ allowClearing, ...rest }, ref) => {
6
6
  const stockMappings = getStockNames();
7
7
  const userMappings = getUserMappingNames();
@@ -34,4 +34,4 @@ const MappingPicker = forwardRef(({ allowClearing, ...rest }, ref) => {
34
34
  }, [allowClearing, stockMappings, userMappings]);
35
35
  return (_jsx(Select, { ...rest, options: options, ref: ref }));
36
36
  });
37
- export default MappingPicker;
37
+ export { MappingPicker };
@@ -4,7 +4,7 @@ import { Midi } from 'tonal';
4
4
  import { emptyMapping } from 'zds-mappings';
5
5
  import useStateWithDynamicDefault from '../hooks/useStateWithDynamicDefault';
6
6
  import { assertRange } from '../utils';
7
- import Select from './Select';
7
+ import { Select } from './Select';
8
8
  const { midiToNoteName } = Midi;
9
9
  const formattedMapEntry = ({ note, name }) => `${note} ${name.length ? '-' : ''} ${name}`;
10
10
  const formattedListEntry = (label, idx) => ({
@@ -42,4 +42,4 @@ const NotePicker = forwardRef((props, ref) => {
42
42
  // isDisabled={disabled}
43
43
  onChange: handleChange, options: options, ref: ref, value: value }));
44
44
  });
45
- export default NotePicker;
45
+ export { NotePicker };
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Piano as ReactPiano } from 'zds-react-piano';
3
- import SoundfontProvider from '../other/SoundFontProvider';
3
+ import { SoundfontProvider } from '../other/SoundFontProvider';
4
4
  const firstNote = 21;
5
5
  const lastNote = 108;
6
6
  const numNotes = lastNote - firstNote - 1;
7
7
  const whiteNotes = numNotes * 0.7; // approx
8
8
  const audioContext = new window.AudioContext();
9
- const PianoPicker = ({ height, width, ...rest }) => {
9
+ const BasePianoPicker = ({ height, width, ...rest }) => {
10
10
  const keyWidth = width / whiteNotes + 2;
11
11
  const keyWidthToHeight = keyWidth / height;
12
12
  return (_jsx("div", { children: _jsx(ReactPiano, { keyWidthToHeight: keyWidthToHeight, noteRange: { first: firstNote, last: lastNote }, width: width, ...rest }) }));
@@ -16,7 +16,7 @@ const WithProvider = ({ format, height, hostname, instrumentName, onChange, onCl
16
16
  hostname,
17
17
  instrumentName,
18
18
  onChange,
19
- soundfont, render: ({ isLoading, playNote, stopNote }) => (_jsx(PianoPicker, { disabled: isLoading, height,
19
+ soundfont, render: ({ isLoading, playNote, stopNote }) => (_jsx(BasePianoPicker, { disabled: isLoading, height,
20
20
  onClick,
21
21
  onDoubleClick,
22
22
  onKeyMouseEnter,
@@ -24,4 +24,4 @@ const WithProvider = ({ format, height, hostname, instrumentName, onChange, onCl
24
24
  playNote,
25
25
  stopNote,
26
26
  width })) }));
27
- export default WithProvider;
27
+ export { WithProvider as PianoPicker };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import Select from './Select';
3
+ import { Select } from './Select';
4
4
  const PolarityPicker = forwardRef(({ labelOff = 'Normally Off', labelOn = 'Normally On', ...rest }, ref) => {
5
5
  const options = [
6
6
  { value: 0, label: labelOff },
@@ -8,4 +8,4 @@ const PolarityPicker = forwardRef(({ labelOff = 'Normally Off', labelOn = 'Norma
8
8
  ];
9
9
  return (_jsx(Select, { ...rest, options: options, ref: ref }));
10
10
  });
11
- export default PolarityPicker;
11
+ export { PolarityPicker };
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef } from 'react';
3
3
  import useComponentSize from '../hooks/useComponentSize';
4
4
  import { responseCurves as origResponseCurves, } from '../midi/export';
5
- import DefaultTooltip from '../other/DefaultTooltip';
6
- import SVGText from '../other/SVGText';
5
+ import { DefaultTooltip } from '../other/DefaultTooltip';
6
+ import { SvgText } from '../other/SvgText';
7
7
  // const width = 218
8
8
  // const height = 150
9
9
  const axisOffset = 20;
@@ -101,7 +101,7 @@ const ResponseCurve = (props) => {
101
101
  labelY,
102
102
  };
103
103
  });
104
- return (_jsx("div", { className: "response-curve-picker", ref: ref, children: _jsxs("svg", { ...svgProps, children: [_jsx("rect", { className: "container", height: height, rx: 3, ry: 3, width: width, x: 0, y: 0 }), _jsx(SVGText, { className: "axis", textAnchor: "middle", transform: `translate(${axisX1 - 14} ${height / 2}) rotate(90)`, x: 0, y: 0, text: "Applied force" }), _jsx(SVGText, { className: "axis", textAnchor: "middle", transform: `translate(${width / 2} ${axisY2 + 13})`, x: 0, y: 0, text: "Output (velocity)" }), _jsx("line", { className: "axis", x1: axisX1, x2: axisX1, y1: axisY1, y2: axisY2 }), _jsx("line", { className: "axis", x1: axisX1, x2: axisX2, y1: axisY2, y2: axisY2 }), responseCurves.map(({ value, label, x1, y1, x2, y2, c1, c2, labelX, labelY }) => (_jsxs("g", { children: [_jsx("path", { className: value === responseCurve ? 'curve-selected' : 'curve', d: `M${x1} ${y1} C ${c1} ${c2}, ${c1} ${c2}, ${x2} ${y2}` }), _jsx(Tooltip, { placement: "left", title: label, children: _jsx("rect", { className: value === responseCurve ? 'button-selected' : 'button', height: buttonSize, onClick: disabled
104
+ return (_jsx("div", { className: "response-curve-picker", ref: ref, children: _jsxs("svg", { ...svgProps, children: [_jsx("rect", { className: "container", height: height, rx: 3, ry: 3, width: width, x: 0, y: 0 }), _jsx(SvgText, { className: "axis", textAnchor: "middle", transform: `translate(${axisX1 - 14} ${height / 2}) rotate(90)`, x: 0, y: 0, text: "Applied force" }), _jsx(SvgText, { className: "axis", textAnchor: "middle", transform: `translate(${width / 2} ${axisY2 + 13})`, x: 0, y: 0, text: "Output (velocity)" }), _jsx("line", { className: "axis", x1: axisX1, x2: axisX1, y1: axisY1, y2: axisY2 }), _jsx("line", { className: "axis", x1: axisX1, x2: axisX2, y1: axisY2, y2: axisY2 }), responseCurves.map(({ value, label, x1, y1, x2, y2, c1, c2, labelX, labelY }) => (_jsxs("g", { children: [_jsx("path", { className: value === responseCurve ? 'curve-selected' : 'curve', d: `M${x1} ${y1} C ${c1} ${c2}, ${c1} ${c2}, ${x2} ${y2}` }), _jsx(Tooltip, { placement: "left", title: label, children: _jsx("rect", { className: value === responseCurve ? 'button-selected' : 'button', height: buttonSize, onClick: disabled
105
105
  ? f => f
106
106
  : () => onChange({
107
107
  target: {
@@ -109,4 +109,4 @@ const ResponseCurve = (props) => {
109
109
  },
110
110
  }), transform: `translate(${labelX + 3} ${labelY - buttonSize / 1.05}) rotate(45)`, width: buttonSize }) }), _jsxs("text", { className: value === responseCurve ? 'button-selected' : 'button', transform: `translate(${labelX} ${labelY})`, children: [value, _jsx("title", { children: label })] })] }, value)))] }) }));
111
111
  };
112
- export default ResponseCurve;
112
+ export { ResponseCurve };
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback } from 'react';
3
3
  import { responseCurves } from '../midi/export';
4
- import DefaultTooltip from '../other/DefaultTooltip';
4
+ import { DefaultTooltip } from '../other/DefaultTooltip';
5
5
  import { findObj } from '../utils';
6
- import ResponseCurve from './ResponseCurve';
7
- import Select from './Select';
6
+ import { ResponseCurve } from './ResponseCurve';
7
+ import { Select } from './Select';
8
8
  const ResponseCurvePicker = forwardRef((props, ref) => {
9
9
  const { Tooltip = DefaultTooltip, inverted = false, onChange, value, ...rest } = props;
10
10
  const Placeholder = useCallback(() => (_jsx("div", { className: "singleValue", children: findObj('value', value)(responseCurves)?.label })), [value]);
@@ -17,4 +17,4 @@ const ResponseCurvePicker = forwardRef((props, ref) => {
17
17
  MenuList,
18
18
  }, isSearchable: false, onChange: f => f, ref: ref, value: value }));
19
19
  });
20
- export default ResponseCurvePicker;
20
+ export { ResponseCurvePicker };
@@ -76,4 +76,4 @@ const Select = forwardRef((props, ref) => {
76
76
  // biome-ignore lint/suspicious/noExplicitAny: <explanation>
77
77
  ref: ref, styles: styles, value: selectedOption })] }));
78
78
  });
79
- export default Select;
79
+ export { Select };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import Select from './Select';
3
+ import { Select } from './Select';
4
4
  const StatusPicker = forwardRef(({ statuses, ...rest }, ref) => (_jsx(Select, { ...rest, options: statuses, ref: ref })));
5
- export default StatusPicker;
5
+ export { StatusPicker };
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useMemo } from 'react';
3
3
  import useStateWithDynamicDefault from '../hooks/useStateWithDynamicDefault';
4
4
  import { arraySequence, assertRange } from '../utils';
5
- import Select from './Select';
5
+ import { Select } from './Select';
6
6
  const ValuePicker = forwardRef((props, ref) => {
7
7
  const { disabled, highToLow, max = 127, min = 0, onChange, value: initialValue = 0, ...rest } = props;
8
8
  const options = useMemo(() => {
@@ -20,4 +20,4 @@ const ValuePicker = forwardRef((props, ref) => {
20
20
  }, [max, min, onChange, setValue]);
21
21
  return (_jsx(Select, { ...rest, disabled: disabled, onChange: handleChange, options: options, ref: ref, value: value }));
22
22
  });
23
- export default ValuePicker;
23
+ export { ValuePicker };
@@ -90,4 +90,4 @@ const knobSkin10 = {
90
90
  },
91
91
  ],
92
92
  };
93
- export default knobSkin10;
93
+ export { knobSkin10 };
@@ -19,4 +19,4 @@ Object.defineProperty(InternalInput, "defaultProps", {
19
19
  step: 1,
20
20
  }
21
21
  });
22
- export default InternalInput;
22
+ export { InternalInput };
@@ -6,4 +6,4 @@ class DrawCircle extends React.Component {
6
6
  return (_jsx("circle", { stroke: borderColor, fill: fillColor, fillOpacity: fillOpacity, r: r, ...rest }));
7
7
  }
8
8
  }
9
- export default DrawCircle;
9
+ export { DrawCircle };
@@ -6,4 +6,4 @@ class DrawLine extends React.Component {
6
6
  return (_jsx("line", { ...rest, stroke: color, strokeWidth: width, x1: p1.x, y1: p1.y, x2: p2.x, y2: p2.y }));
7
7
  }
8
8
  }
9
- export default DrawLine;
9
+ export { DrawLine };
@@ -23,4 +23,4 @@ class HelpersOverlay extends React.Component {
23
23
  return ReactDOM.createPortal(_jsx("div", { style: styles.overlay, ...rest, children: children }), document.body);
24
24
  }
25
25
  }
26
- export default HelpersOverlay;
26
+ export { HelpersOverlay };
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import utils from '../utils';
4
- import DrawCircle from './DrawCircle';
5
- import DrawLine from './DrawLine';
6
- import HelpersOverlay from './HelpersOverlay';
3
+ import { DrawCircle } from './DrawCircle';
4
+ import { DrawLine } from './DrawLine';
5
+ import { HelpersOverlay } from './HelpersOverlay';
6
+ import { toRadians } from '../utils';
7
7
  class KnobVisualHelpers extends React.Component {
8
8
  constructor() {
9
9
  super(...arguments);
@@ -27,8 +27,8 @@ class KnobVisualHelpers extends React.Component {
27
27
  const halfWidth = vbox.width / 2;
28
28
  //Calculate current angle segment end point
29
29
  //Note: Not sure why we need to subtract 90 here
30
- const valueMarkerX = props.radius * Math.cos(utils.toRadians(props.valueAngle - 90));
31
- const valueMarkerY = props.radius * Math.sin(utils.toRadians(props.valueAngle - 90));
30
+ const valueMarkerX = props.radius * Math.cos(toRadians(props.valueAngle - 90));
31
+ const valueMarkerY = props.radius * Math.sin(toRadians(props.valueAngle - 90));
32
32
  return {
33
33
  ...state,
34
34
  centerX: vbox.left + halfWidth,
@@ -8,10 +8,10 @@ import { scaleLinear } from 'd3-scale';
8
8
  import { select } from 'd3-selection';
9
9
  import { useEffect, useRef, useState } from 'react';
10
10
  import { SvgLoader, SvgProxy } from 'react-svgmt';
11
- import InternalInput from './InternalInput';
11
+ import { InternalInput } from './InternalInput';
12
12
  import { KnobVisualHelpers } from './helpers/KnobVisualHelpers';
13
13
  import defaultSkin from './knobdefaultskin';
14
- import utils from './utils';
14
+ import { getAngleForPoint } from './utils';
15
15
  // function printDebugValues(obj) {
16
16
  // console.log('------------')
17
17
  // Object.keys(obj).forEach(key => {
@@ -145,7 +145,7 @@ const RotaryKnob = (props) => {
145
145
  elem.classed('dragging', true);
146
146
  onStart();
147
147
  startPos = { x: event.x - cx, y: event.y - cy };
148
- startAngle = utils.getAngleForPoint(startPos.x, startPos.y);
148
+ startAngle = getAngleForPoint(startPos.x, startPos.y);
149
149
  initialAngle = convertValueToAngle(currentValue);
150
150
  monitoring = false;
151
151
  // ...existing setState code...
@@ -156,14 +156,14 @@ const RotaryKnob = (props) => {
156
156
  if (preciseMode) {
157
157
  if (!monitoring && distanceFromCenter >= unlockDistance) {
158
158
  startPos = currentPos;
159
- startAngle = utils.getAngleForPoint(currentPos.x, currentPos.y);
159
+ startAngle = getAngleForPoint(currentPos.x, currentPos.y);
160
160
  monitoring = true;
161
161
  }
162
162
  }
163
163
  else {
164
164
  monitoring = true;
165
165
  }
166
- const currentAngle = utils.getAngleForPoint(currentPos.x, currentPos.y);
166
+ const currentAngle = getAngleForPoint(currentPos.x, currentPos.y);
167
167
  const deltaAngle = currentAngle - startAngle;
168
168
  let finalAngle = initialAngle + deltaAngle;
169
169
  finalAngle = normalizeAngle(finalAngle);
@@ -241,4 +241,4 @@ const RotaryKnob = (props) => {
241
241
  : null;
242
242
  return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: container, style: styles.container, ...rest, children: [_jsx(InternalInput, { disabled: disabled, inputRef: inputRef, style: styles.input, value: currentValue, min: min, max: max, step: step, onChange: onFormControlChange }), _jsxs(SvgLoader, { height: "100%", svgXML: skin.svg, width: "100%", onSVGReady: saveRef, children: [_jsx(SvgProxy, { selector: "#knob", transform: `$ORIGINAL rotate(${angle}, ${skin.knobX}, ${skin.knobY})` }), skinElemUpdates] })] }), state.dragging && preciseMode && (_jsx(KnobVisualHelpers, { svgRef: state.svgRef, radius: state.dragDistance, mousePos: state.mousePos, minimumDragDistance: unlockDistance, valueAngle: state.valueAngle }))] }));
243
243
  };
244
- export default RotaryKnob;
244
+ export { RotaryKnob };
@@ -96,11 +96,7 @@ function transformBoundingClientRectToDocument(box) {
96
96
  //info needed to draw line from center to mousepos
97
97
  return { top: ttop, left: tleft, width: box.width, height: box.height };
98
98
  }
99
- export default {
100
- // toGlobalCoordinates,
101
- // toLocalCoordinates,
102
- toRadians,
103
- getQuadrant,
104
- getAngleForPoint,
105
- transformBoundingClientRectToDocument,
106
- };
99
+ export {
100
+ // toGlobalCoordinates,
101
+ // toLocalCoordinates,
102
+ toRadians, getQuadrant, getAngleForPoint, transformBoundingClientRectToDocument, };
@@ -2,7 +2,7 @@ export * from './midi/ccValues';
2
2
  export * from './midi/export';
3
3
  export * from './other/DefaultTooltip';
4
4
  export * from './other/OctavePlayer';
5
- export * from './other/SVGText';
5
+ export * from './other/SvgText';
6
6
  export * from './pickers/ChannelMappingPicker';
7
7
  export * from './pickers/ChannelPicker';
8
8
  export * from './pickers/Knob';
@@ -21,7 +21,7 @@ export type * from './midi/export';
21
21
  export type * from './other/DefaultTooltip';
22
22
  export type * from './other/OctavePlayer';
23
23
  export type * from './other/SoundFontProvider';
24
- export type * from './other/SVGText';
24
+ export type * from './other/SvgText';
25
25
  export type * from './pickers/CCPicker';
26
26
  export type * from './pickers/ChannelMappingPicker';
27
27
  export type * from './pickers/ChannelPicker';
@@ -1,3 +1,3 @@
1
1
  import type { Option } from '../pickers/Select';
2
- declare const CC_NAMES: Option<number>[];
3
- export default CC_NAMES;
2
+ declare const changeControllerOptions: Option<number>[];
3
+ export { changeControllerOptions };
@@ -6,5 +6,5 @@ type TooltipProps = {
6
6
  declare const DefaultTooltip: ({ children }: React.PropsWithoutRef<TooltipProps>) => import("react").FunctionComponentElement<{
7
7
  children?: import("react").ReactNode | undefined;
8
8
  }>;
9
- export default DefaultTooltip;
9
+ export { DefaultTooltip };
10
10
  export type { TooltipProps };
@@ -22,5 +22,5 @@ type WithProviderProps = {
22
22
  width: number;
23
23
  };
24
24
  declare const WithProvider: ({ format, height, hostname, instrumentName, octave, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, Tooltip, width, }: WithProviderProps) => import("react/jsx-runtime").JSX.Element;
25
- export default WithProvider;
25
+ export { WithProvider as OctavePlayer };
26
26
  export type { OctavePlayerProps, WithProviderProps };
@@ -14,5 +14,5 @@ type SoundfontProviderProps = {
14
14
  soundfont?: 'MusyngKite' | 'FluidR3_GM';
15
15
  };
16
16
  declare const SoundfontProvider: (props: SoundfontProviderProps) => import("react").ReactNode;
17
- export default SoundfontProvider;
17
+ export { SoundfontProvider };
18
18
  export type { SoundfontProviderProps };
@@ -22,7 +22,6 @@ type TextProps = Partial<HTMLOrSVGElement> & {
22
22
  x?: number;
23
23
  y?: number;
24
24
  };
25
- declare const Text: (props: TextProps) => import("react/jsx-runtime").JSX.Element;
26
- export default Text;
27
- export { MEASUREMENT_ELEMENT_ID };
25
+ declare const SvgText: (props: TextProps) => import("react/jsx-runtime").JSX.Element;
26
+ export { SvgText, MEASUREMENT_ELEMENT_ID };
28
27
  export type { TextProps, WordWidths, WordsByLine };
@@ -3,5 +3,5 @@ import type { Option, SelectProps } from './Select';
3
3
  type CCPickerProps = SelectProps<number>;
4
4
  type CCPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
5
5
  declare const CCPicker: import("react").ForwardRefExoticComponent<CCPickerProps & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
6
- export default CCPicker;
6
+ export { CCPicker };
7
7
  export type { CCPickerProps, CCPickerRef };
@@ -11,5 +11,5 @@ interface ChannelMappingPickerProps extends SelectProps<InternalValue> {
11
11
  }
12
12
  type ChannelMappingPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
13
13
  declare const ChannelMappingPicker: import("react").ForwardRefExoticComponent<ChannelMappingPickerProps & import("react").RefAttributes<SelectInstance<Option<InternalValue>, false, GroupBase<Option<InternalValue>>>>>;
14
- export default ChannelMappingPicker;
14
+ export { ChannelMappingPicker };
15
15
  export type { ChannelMappingOption, ChannelMappingPickerProps, ChannelMappingPickerRef, };
@@ -4,5 +4,5 @@ type Channel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
4
4
  type ChannelPickerProps = SelectProps<Channel>;
5
5
  type ChannelPickerRef = SelectInstance<Option<Channel>, false, GroupBase<Option<Channel>>>;
6
6
  declare const ChannelPicker: import("react").ForwardRefExoticComponent<ChannelPickerProps & import("react").RefAttributes<SelectInstance<Option<Channel>, false, GroupBase<Option<Channel>>>>>;
7
- export default ChannelPicker;
7
+ export { ChannelPicker };
8
8
  export type { Channel, ChannelPickerProps, ChannelPickerRef };
@@ -8,5 +8,5 @@ type KnobProps = {
8
8
  wheelSensitivity?: number;
9
9
  };
10
10
  declare const Knob: (props: KnobProps) => import("react/jsx-runtime").JSX.Element;
11
- export default Knob;
11
+ export { Knob };
12
12
  export type { KnobProps };
@@ -23,5 +23,5 @@ declare const KnobPicker: import("react").ForwardRefExoticComponent<SelectProps<
23
23
  wheelSensitivity?: number;
24
24
  value: number;
25
25
  } & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
26
- export default KnobPicker;
26
+ export { KnobPicker };
27
27
  export type { KnobPickerProps, KnobPickerRef };
@@ -4,5 +4,5 @@ import type { Option, SelectProps } from './Select';
4
4
  type LatchPickerProps = SelectProps<Polarity>;
5
5
  type LatchPickerRef = SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>;
6
6
  declare const LatchPicker: import("react").ForwardRefExoticComponent<LatchPickerProps & import("react").RefAttributes<SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>>>;
7
- export default LatchPicker;
7
+ export { LatchPicker };
8
8
  export type { LatchPickerProps, LatchPickerRef };
@@ -7,5 +7,5 @@ type MappingPickerRef = SelectInstance<Option<string>, false, GroupBase<Option<s
7
7
  declare const MappingPicker: import("react").ForwardRefExoticComponent<SelectProps<string> & {
8
8
  allowClearing: boolean;
9
9
  } & import("react").RefAttributes<SelectInstance<Option<string>, false, GroupBase<Option<string>>>>>;
10
- export default MappingPicker;
10
+ export { MappingPicker };
11
11
  export type { MappingPickerProps, MappingPickerRef };
@@ -16,5 +16,5 @@ declare const NotePicker: import("react").ForwardRefExoticComponent<SelectProps<
16
16
  mapping?: Mapping;
17
17
  onChange: (value: number) => void;
18
18
  } & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
19
- export default NotePicker;
19
+ export { NotePicker };
20
20
  export type { NotePickerProps, NotePickerRef };
@@ -5,5 +5,5 @@ type PianoProps = {
5
5
  width: number;
6
6
  };
7
7
  declare const WithProvider: ({ format, height, hostname, instrumentName, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, width, }: WithProviderProps) => import("react/jsx-runtime").JSX.Element;
8
- export default WithProvider;
8
+ export { WithProvider as PianoPicker };
9
9
  export type { PianoProps };
@@ -10,5 +10,5 @@ declare const PolarityPicker: import("react").ForwardRefExoticComponent<SelectPr
10
10
  labelOff?: string;
11
11
  labelOn?: string;
12
12
  } & import("react").RefAttributes<SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>>>;
13
- export default PolarityPicker;
13
+ export { PolarityPicker };
14
14
  export type { Polarity, PolarityPickerProps, PolarityPickerRef };