zds-pickers 4.0.12 → 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.
- package/dist/index.cjs.js +160 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +12481 -35
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/midi/ccValues.js +2 -2
- package/dist/midi/export.js +43 -1
- package/dist/other/DefaultTooltip.js +1 -1
- package/dist/other/OctavePlayer.js +4 -4
- package/dist/other/SoundFontProvider.js +1 -1
- package/dist/other/{SVGText.js → SvgText.js} +2 -3
- package/dist/pickers/CCPicker.js +4 -4
- package/dist/pickers/ChannelMappingPicker.js +2 -2
- package/dist/pickers/ChannelPicker.js +2 -2
- package/dist/pickers/Knob.js +3 -3
- package/dist/pickers/KnobPicker.js +3 -3
- package/dist/pickers/LatchPicker.js +2 -2
- package/dist/pickers/MappingPicker.js +2 -2
- package/dist/pickers/NotePicker.js +2 -2
- package/dist/pickers/PianoPicker.js +4 -4
- package/dist/pickers/PolarityPicker.js +2 -2
- package/dist/pickers/ResponseCurve.js +14 -56
- package/dist/pickers/ResponseCurvePicker.js +6 -5
- package/dist/pickers/Select.js +1 -1
- package/dist/pickers/StatusPicker.js +2 -2
- package/dist/pickers/ValuePicker.js +2 -2
- package/dist/pickers/knobSkin10.js +1 -1
- package/dist/rotaryKnob/InternalInput.js +1 -1
- package/dist/rotaryKnob/helpers/DrawCircle.js +1 -1
- package/dist/rotaryKnob/helpers/DrawLine.js +1 -1
- package/dist/rotaryKnob/helpers/HelpersOverlay.js +1 -1
- package/dist/rotaryKnob/helpers/KnobVisualHelpers.js +6 -6
- package/dist/rotaryKnob/index.js +6 -6
- package/dist/rotaryKnob/utils.js +4 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/types/midi/ccValues.d.ts +2 -2
- package/dist/types/midi/export.d.ts +12 -1
- package/dist/types/other/DefaultTooltip.d.ts +1 -1
- package/dist/types/other/OctavePlayer.d.ts +1 -1
- package/dist/types/other/SoundFontProvider.d.ts +1 -1
- package/dist/types/other/{SVGText.d.ts → SvgText.d.ts} +2 -3
- package/dist/types/pickers/CCPicker.d.ts +1 -1
- package/dist/types/pickers/ChannelMappingPicker.d.ts +1 -1
- package/dist/types/pickers/ChannelPicker.d.ts +1 -1
- package/dist/types/pickers/Knob.d.ts +1 -1
- package/dist/types/pickers/KnobPicker.d.ts +1 -1
- package/dist/types/pickers/LatchPicker.d.ts +1 -1
- package/dist/types/pickers/MappingPicker.d.ts +1 -1
- package/dist/types/pickers/NotePicker.d.ts +1 -1
- package/dist/types/pickers/PianoPicker.d.ts +1 -1
- package/dist/types/pickers/PolarityPicker.d.ts +1 -1
- package/dist/types/pickers/ResponseCurve.d.ts +4 -15
- package/dist/types/pickers/ResponseCurvePicker.d.ts +2 -2
- package/dist/types/pickers/Select.d.ts +1 -1
- package/dist/types/pickers/StatusPicker.d.ts +1 -1
- package/dist/types/pickers/ValuePicker.d.ts +1 -1
- package/dist/types/pickers/knobSkin10.d.ts +1 -1
- package/dist/types/rotaryKnob/InternalInput.d.ts +1 -1
- package/dist/types/rotaryKnob/helpers/DrawCircle.d.ts +1 -1
- package/dist/types/rotaryKnob/helpers/DrawLine.d.ts +1 -1
- package/dist/types/rotaryKnob/helpers/HelpersOverlay.d.ts +1 -1
- package/dist/types/rotaryKnob/index.d.ts +1 -1
- package/dist/types/rotaryKnob/utils.d.ts +1 -7
- package/lib/index.ts +2 -2
- package/lib/midi/ccValues.ts +2 -2
- package/lib/midi/export.ts +58 -2
- package/lib/other/DefaultTooltip.ts +1 -1
- package/lib/other/OctavePlayer.tsx +4 -4
- package/lib/other/SoundFontProvider.tsx +1 -1
- package/lib/other/{SVGText.tsx → SvgText.tsx} +2 -4
- package/lib/pickers/CCPicker.tsx +4 -4
- package/lib/pickers/ChannelMappingPicker.tsx +2 -2
- package/lib/pickers/ChannelPicker.tsx +2 -2
- package/lib/pickers/Knob.tsx +3 -3
- package/lib/pickers/KnobPicker.tsx +3 -3
- package/lib/pickers/LatchPicker.tsx +2 -2
- package/lib/pickers/MappingPicker.tsx +2 -2
- package/lib/pickers/NotePicker.tsx +2 -2
- package/lib/pickers/PianoPicker.tsx +4 -4
- package/lib/pickers/PolarityPicker.tsx +2 -2
- package/lib/pickers/ResponseCurve.tsx +22 -75
- package/lib/pickers/ResponseCurvePicker.tsx +6 -5
- package/lib/pickers/Select.tsx +1 -1
- package/lib/pickers/StatusPicker.tsx +2 -2
- package/lib/pickers/ValuePicker.tsx +2 -2
- package/lib/pickers/knobSkin10.tsx +1 -1
- package/lib/rotaryKnob/InternalInput.tsx +1 -1
- package/lib/rotaryKnob/helpers/DrawCircle.tsx +1 -1
- package/lib/rotaryKnob/helpers/DrawLine.tsx +1 -1
- package/lib/rotaryKnob/helpers/HelpersOverlay.tsx +1 -1
- package/lib/rotaryKnob/helpers/KnobVisualHelpers.tsx +6 -7
- package/lib/rotaryKnob/index.tsx +6 -6
- package/lib/rotaryKnob/utils.ts +1 -1
- package/package.json +1 -1
- package/stories/assets/utils.js +1 -1
- package/stories/picker.stories.tsx +15 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Piano as ReactPiano } from 'zds-react-piano'
|
|
2
2
|
import type { WithProviderProps } from '../other/OctavePlayer'
|
|
3
|
-
import SoundfontProvider from '../other/SoundFontProvider'
|
|
3
|
+
import { SoundfontProvider } from '../other/SoundFontProvider'
|
|
4
4
|
|
|
5
5
|
const firstNote = 21
|
|
6
6
|
const lastNote = 108
|
|
@@ -16,7 +16,7 @@ type PianoProps = {
|
|
|
16
16
|
width: number
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const BasePianoPicker = ({ height, width, ...rest }: PianoProps) => {
|
|
20
20
|
const keyWidth = width / whiteNotes + 2
|
|
21
21
|
const keyWidthToHeight = keyWidth / height
|
|
22
22
|
|
|
@@ -55,7 +55,7 @@ const WithProvider = ({
|
|
|
55
55
|
soundfont,
|
|
56
56
|
}}
|
|
57
57
|
render={({ isLoading, playNote, stopNote }) => (
|
|
58
|
-
<
|
|
58
|
+
<BasePianoPicker
|
|
59
59
|
disabled={isLoading}
|
|
60
60
|
{...{
|
|
61
61
|
height,
|
|
@@ -72,6 +72,6 @@ const WithProvider = ({
|
|
|
72
72
|
/>
|
|
73
73
|
)
|
|
74
74
|
|
|
75
|
-
export
|
|
75
|
+
export { WithProvider as PianoPicker }
|
|
76
76
|
|
|
77
77
|
export type { PianoProps }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react'
|
|
2
2
|
import type { GroupBase, SelectInstance } from 'react-select'
|
|
3
|
-
import Select from './Select'
|
|
3
|
+
import { Select } from './Select'
|
|
4
4
|
import type { Option, SelectProps } from './Select'
|
|
5
5
|
|
|
6
6
|
type Polarity = 0 | 1
|
|
@@ -34,6 +34,6 @@ const PolarityPicker = forwardRef<
|
|
|
34
34
|
)
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
-
export
|
|
37
|
+
export { PolarityPicker }
|
|
38
38
|
|
|
39
39
|
export type { Polarity, PolarityPickerProps, PolarityPickerRef }
|
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import { useRef } from 'react'
|
|
2
2
|
import useComponentSize from '../hooks/useComponentSize'
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const RESPONSE_CURVE_4 = 4
|
|
12
|
-
const RESPONSE_CURVE_5 = 5
|
|
13
|
-
const RESPONSE_CURVE_6 = 6
|
|
14
|
-
const RESPONSE_CURVE_7 = 7
|
|
15
|
-
|
|
16
|
-
type Curve =
|
|
17
|
-
| typeof RESPONSE_CURVE_0
|
|
18
|
-
| typeof RESPONSE_CURVE_1
|
|
19
|
-
| typeof RESPONSE_CURVE_2
|
|
20
|
-
| typeof RESPONSE_CURVE_3
|
|
21
|
-
| typeof RESPONSE_CURVE_4
|
|
22
|
-
| typeof RESPONSE_CURVE_5
|
|
23
|
-
| typeof RESPONSE_CURVE_6
|
|
24
|
-
| typeof RESPONSE_CURVE_7
|
|
25
|
-
|
|
26
|
-
type ResponseCurve = {
|
|
3
|
+
import {
|
|
4
|
+
type Curve,
|
|
5
|
+
responseCurves as origResponseCurves,
|
|
6
|
+
} from '../midi/export'
|
|
7
|
+
import { DefaultTooltip, type TooltipProps } from '../other/DefaultTooltip'
|
|
8
|
+
import { SvgText } from '../other/SvgText'
|
|
9
|
+
|
|
10
|
+
type ResponseCurveType = {
|
|
27
11
|
value: Curve
|
|
28
12
|
label: React.ReactNode
|
|
29
13
|
c1: number
|
|
@@ -36,41 +20,6 @@ type ResponseCurve = {
|
|
|
36
20
|
labelY: number
|
|
37
21
|
}
|
|
38
22
|
|
|
39
|
-
const RESPONSE_CURVES: Option<Curve>[] = [
|
|
40
|
-
{
|
|
41
|
-
value: RESPONSE_CURVE_7,
|
|
42
|
-
label: 'Always maxed out.',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
value: RESPONSE_CURVE_6,
|
|
46
|
-
label: 'Most sensitive.',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
value: RESPONSE_CURVE_5,
|
|
50
|
-
label: 'Moderately sensitive.',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
value: RESPONSE_CURVE_4,
|
|
54
|
-
label: 'A little sensitive.',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: RESPONSE_CURVE_0,
|
|
58
|
-
label: 'Linear, no change.',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
value: RESPONSE_CURVE_1,
|
|
62
|
-
label: 'A little less sensitive.',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
value: RESPONSE_CURVE_2,
|
|
66
|
-
label: 'Even less sensitive.',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
value: RESPONSE_CURVE_3,
|
|
70
|
-
label: 'Least sensitive.',
|
|
71
|
-
},
|
|
72
|
-
]
|
|
73
|
-
|
|
74
23
|
// const width = 218
|
|
75
24
|
// const height = 150
|
|
76
25
|
const axisOffset = 20
|
|
@@ -113,9 +62,9 @@ const ResponseCurve = (props: ResponseCurveProps) => {
|
|
|
113
62
|
|
|
114
63
|
const svgProps = { ref: svgRef }
|
|
115
64
|
|
|
116
|
-
const responseCurves =
|
|
65
|
+
const responseCurves = origResponseCurves.map(
|
|
117
66
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: <explanation>
|
|
118
|
-
({ value, label }):
|
|
67
|
+
({ value, label }): ResponseCurveType => {
|
|
119
68
|
let c1 = 0
|
|
120
69
|
let c2 = 0
|
|
121
70
|
let x1 = axisX1
|
|
@@ -125,55 +74,55 @@ const ResponseCurve = (props: ResponseCurveProps) => {
|
|
|
125
74
|
let labelX = xMid
|
|
126
75
|
let labelY = yMid
|
|
127
76
|
switch (value) {
|
|
128
|
-
case
|
|
77
|
+
case responseCurves[0].value:
|
|
129
78
|
c1 = xMid
|
|
130
79
|
c2 = yMid
|
|
131
80
|
labelY += 3
|
|
132
81
|
|
|
133
82
|
break
|
|
134
|
-
case
|
|
83
|
+
case responseCurves[1].value:
|
|
135
84
|
c1 = inverted ? xMid + width * 0.13 : xMid - width * 0.13
|
|
136
85
|
c2 = yMid - height * 0.13
|
|
137
86
|
labelX = inverted ? xMid + width * 0.1 : xMid - width * 0.1
|
|
138
87
|
labelY = yMid - height * 0.09
|
|
139
88
|
break
|
|
140
89
|
|
|
141
|
-
case
|
|
90
|
+
case responseCurves[2].value:
|
|
142
91
|
c1 = inverted ? xMid + width * 0.25 : xMid - width * 0.25
|
|
143
92
|
c2 = yMid - height * 0.25
|
|
144
93
|
labelX = inverted ? xMid + width * 0.2 : xMid - width * 0.2
|
|
145
94
|
labelY = yMid - height * 0.17
|
|
146
95
|
break
|
|
147
96
|
|
|
148
|
-
case
|
|
97
|
+
case responseCurves[3].value:
|
|
149
98
|
c1 = inverted ? xMid + width * 0.35 : xMid - width * 0.35
|
|
150
99
|
c2 = yMid - height * 0.35
|
|
151
100
|
labelX = inverted ? xMid + width * 0.28 : xMid - width * 0.28
|
|
152
101
|
labelY = yMid - height * 0.25
|
|
153
102
|
break
|
|
154
103
|
|
|
155
|
-
case
|
|
104
|
+
case responseCurves[4].value:
|
|
156
105
|
c1 = inverted ? xMid - width * 0.13 : xMid + width * 0.13
|
|
157
106
|
c2 = yMid + height * 0.13
|
|
158
107
|
labelX = inverted ? xMid - width * 0.1 : xMid + width * 0.1
|
|
159
108
|
labelY = yMid + height * 0.1
|
|
160
109
|
break
|
|
161
110
|
|
|
162
|
-
case
|
|
111
|
+
case responseCurves[5].value:
|
|
163
112
|
c1 = inverted ? xMid - width * 0.25 : xMid + width * 0.25
|
|
164
113
|
c2 = yMid + height * 0.25
|
|
165
114
|
labelX = inverted ? xMid - width * 0.2 : xMid + width * 0.2
|
|
166
115
|
labelY = yMid + height * 0.18
|
|
167
116
|
break
|
|
168
117
|
|
|
169
|
-
case
|
|
118
|
+
case responseCurves[6].value:
|
|
170
119
|
c1 = inverted ? xMid - width * 0.35 : xMid + width * 0.35
|
|
171
120
|
c2 = yMid + height * 0.35
|
|
172
121
|
labelX = inverted ? xMid - width * 0.28 : xMid + width * 0.28
|
|
173
122
|
labelY = yMid + height * 0.25
|
|
174
123
|
break
|
|
175
124
|
|
|
176
|
-
case
|
|
125
|
+
case responseCurves[7].value:
|
|
177
126
|
x1 = inverted ? axisX1 : axisX2
|
|
178
127
|
y1 = axisY1
|
|
179
128
|
x2 = x1
|
|
@@ -217,7 +166,7 @@ const ResponseCurve = (props: ResponseCurveProps) => {
|
|
|
217
166
|
y={0}
|
|
218
167
|
/>
|
|
219
168
|
|
|
220
|
-
<
|
|
169
|
+
<SvgText
|
|
221
170
|
className="axis"
|
|
222
171
|
textAnchor="middle"
|
|
223
172
|
transform={`translate(${axisX1 - 14} ${height / 2}) rotate(90)`}
|
|
@@ -226,7 +175,7 @@ const ResponseCurve = (props: ResponseCurveProps) => {
|
|
|
226
175
|
text="Applied force"
|
|
227
176
|
/>
|
|
228
177
|
|
|
229
|
-
<
|
|
178
|
+
<SvgText
|
|
230
179
|
className="axis"
|
|
231
180
|
textAnchor="middle"
|
|
232
181
|
transform={`translate(${width / 2} ${axisY2 + 13})`}
|
|
@@ -297,8 +246,6 @@ const ResponseCurve = (props: ResponseCurveProps) => {
|
|
|
297
246
|
)
|
|
298
247
|
}
|
|
299
248
|
|
|
300
|
-
export
|
|
301
|
-
|
|
302
|
-
export { RESPONSE_CURVES }
|
|
249
|
+
export { ResponseCurve }
|
|
303
250
|
|
|
304
|
-
export type {
|
|
251
|
+
export type { ResponseCurveType, ResponseCurveProps }
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { forwardRef, useCallback } from 'react'
|
|
2
2
|
import type { GroupBase, SelectInstance } from 'react-select'
|
|
3
|
-
import
|
|
3
|
+
import { type Curve, responseCurves } from '../midi/export'
|
|
4
|
+
import { DefaultTooltip, type TooltipProps } from '../other/DefaultTooltip'
|
|
4
5
|
import { findObj } from '../utils'
|
|
5
|
-
import
|
|
6
|
-
import Select from './Select'
|
|
6
|
+
import { ResponseCurve } from './ResponseCurve'
|
|
7
|
+
import { Select } from './Select'
|
|
7
8
|
import type { Option, SelectProps } from './Select'
|
|
8
9
|
|
|
9
10
|
type ResponseCurvePickerProps = SelectProps<Curve> & {
|
|
@@ -32,7 +33,7 @@ const ResponseCurvePicker = forwardRef<
|
|
|
32
33
|
const Placeholder = useCallback(
|
|
33
34
|
() => (
|
|
34
35
|
<div className="singleValue">
|
|
35
|
-
{(findObj('value', value)(
|
|
36
|
+
{(findObj('value', value)(responseCurves) as Option<Curve>)?.label}
|
|
36
37
|
</div>
|
|
37
38
|
),
|
|
38
39
|
[value],
|
|
@@ -69,6 +70,6 @@ const ResponseCurvePicker = forwardRef<
|
|
|
69
70
|
)
|
|
70
71
|
})
|
|
71
72
|
|
|
72
|
-
export
|
|
73
|
+
export { ResponseCurvePicker }
|
|
73
74
|
|
|
74
75
|
export type { ResponseCurvePickerProps, ResponseCurvePickerRef }
|
package/lib/pickers/Select.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Status } from 'lib/midi/export'
|
|
2
2
|
import { forwardRef } from 'react'
|
|
3
3
|
import type { GroupBase, SelectInstance } from 'react-select'
|
|
4
|
-
import Select from './Select'
|
|
4
|
+
import { Select } from './Select'
|
|
5
5
|
import type { Option, SelectProps } from './Select'
|
|
6
6
|
|
|
7
7
|
type StatusPickerProps = SelectProps<Status> & { statuses: Option<Status>[] }
|
|
@@ -23,6 +23,6 @@ const StatusPicker = forwardRef<
|
|
|
23
23
|
/>
|
|
24
24
|
))
|
|
25
25
|
|
|
26
|
-
export
|
|
26
|
+
export { StatusPicker }
|
|
27
27
|
|
|
28
28
|
export type { StatusPickerProps, StatusPickerRef }
|
|
@@ -2,7 +2,7 @@ import { forwardRef, useCallback, useMemo } from 'react'
|
|
|
2
2
|
import type { GroupBase, SelectInstance } from 'react-select'
|
|
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
|
import type { Option, SelectProps } from './Select'
|
|
7
7
|
|
|
8
8
|
type ValuePickerProps = SelectProps<number> & {
|
|
@@ -62,6 +62,6 @@ const ValuePicker = forwardRef<
|
|
|
62
62
|
)
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
-
export
|
|
65
|
+
export { ValuePicker }
|
|
66
66
|
|
|
67
67
|
export type { ValuePickerProps, ValuePickerRef }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { Point } from '../Types'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { DrawCircle } from './DrawCircle'
|
|
4
|
+
import { DrawLine } from './DrawLine'
|
|
5
|
+
import { HelpersOverlay } from './HelpersOverlay'
|
|
6
|
+
import { toRadians } from '../utils'
|
|
7
7
|
|
|
8
8
|
/** Precision visual helpers */
|
|
9
9
|
|
|
@@ -49,9 +49,8 @@ class KnobVisualHelpers extends React.Component<
|
|
|
49
49
|
//Calculate current angle segment end point
|
|
50
50
|
//Note: Not sure why we need to subtract 90 here
|
|
51
51
|
const valueMarkerX =
|
|
52
|
-
props.radius * Math.cos(
|
|
53
|
-
const valueMarkerY =
|
|
54
|
-
props.radius * Math.sin(utils.toRadians(props.valueAngle - 90))
|
|
52
|
+
props.radius * Math.cos(toRadians(props.valueAngle - 90))
|
|
53
|
+
const valueMarkerY = props.radius * Math.sin(toRadians(props.valueAngle - 90))
|
|
55
54
|
|
|
56
55
|
return {
|
|
57
56
|
...state,
|
package/lib/rotaryKnob/index.tsx
CHANGED
|
@@ -9,11 +9,11 @@ import { select } from 'd3-selection'
|
|
|
9
9
|
import type { BaseType, Selection } from 'd3-selection'
|
|
10
10
|
import { useEffect, useRef, useState } from 'react'
|
|
11
11
|
import { SvgLoader, SvgProxy } from 'react-svgmt'
|
|
12
|
-
import InternalInput from './InternalInput'
|
|
12
|
+
import { InternalInput } from './InternalInput'
|
|
13
13
|
import type { Point } from './Types'
|
|
14
14
|
import { KnobVisualHelpers } from './helpers/KnobVisualHelpers'
|
|
15
15
|
import defaultSkin from './knobdefaultskin'
|
|
16
|
-
import
|
|
16
|
+
import { getAngleForPoint } from './utils'
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* type definition for the skin system attribute modification element
|
|
@@ -247,7 +247,7 @@ const RotaryKnob = (props: KnobProps) => {
|
|
|
247
247
|
onStart()
|
|
248
248
|
|
|
249
249
|
startPos = { x: event.x - cx, y: event.y - cy }
|
|
250
|
-
startAngle =
|
|
250
|
+
startAngle = getAngleForPoint(startPos.x, startPos.y)
|
|
251
251
|
initialAngle = convertValueToAngle(currentValue)
|
|
252
252
|
monitoring = false
|
|
253
253
|
|
|
@@ -263,14 +263,14 @@ const RotaryKnob = (props: KnobProps) => {
|
|
|
263
263
|
if (preciseMode) {
|
|
264
264
|
if (!monitoring && distanceFromCenter >= unlockDistance) {
|
|
265
265
|
startPos = currentPos
|
|
266
|
-
startAngle =
|
|
266
|
+
startAngle = getAngleForPoint(currentPos.x, currentPos.y)
|
|
267
267
|
monitoring = true
|
|
268
268
|
}
|
|
269
269
|
} else {
|
|
270
270
|
monitoring = true
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
const currentAngle =
|
|
273
|
+
const currentAngle = getAngleForPoint(currentPos.x, currentPos.y)
|
|
274
274
|
const deltaAngle = currentAngle - startAngle
|
|
275
275
|
let finalAngle = initialAngle + deltaAngle
|
|
276
276
|
finalAngle = normalizeAngle(finalAngle)
|
|
@@ -414,4 +414,4 @@ const RotaryKnob = (props: KnobProps) => {
|
|
|
414
414
|
)
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
export
|
|
417
|
+
export { RotaryKnob }
|
package/lib/rotaryKnob/utils.ts
CHANGED
|
@@ -102,7 +102,7 @@ function transformBoundingClientRectToDocument(box: DOMRect) {
|
|
|
102
102
|
return { top: ttop, left: tleft, width: box.width, height: box.height }
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
export
|
|
105
|
+
export {
|
|
106
106
|
// toGlobalCoordinates,
|
|
107
107
|
// toLocalCoordinates,
|
|
108
108
|
toRadians,
|
package/package.json
CHANGED
package/stories/assets/utils.js
CHANGED
|
@@ -4,21 +4,21 @@ import React from 'react'
|
|
|
4
4
|
import type * as Soundfont from 'soundfont-player'
|
|
5
5
|
import { getMapping } from 'zds-mappings'
|
|
6
6
|
import { Statuses, statusOptions } from '../lib/midi/export'
|
|
7
|
-
import OctavePlayer from '../lib/other/OctavePlayer'
|
|
8
|
-
import CCPicker from '../lib/pickers/CCPicker'
|
|
9
|
-
import ChannelMappingPicker from '../lib/pickers/ChannelMappingPicker'
|
|
10
|
-
import ChannelPicker from '../lib/pickers/ChannelPicker'
|
|
11
|
-
import Knob from '../lib/pickers/Knob'
|
|
12
|
-
import KnobPicker from '../lib/pickers/KnobPicker'
|
|
13
|
-
import LatchPicker from '../lib/pickers/LatchPicker'
|
|
14
|
-
import MappingPicker from '../lib/pickers/MappingPicker'
|
|
15
|
-
import NotePicker from '../lib/pickers/NotePicker'
|
|
16
|
-
import PianoPicker from '../lib/pickers/PianoPicker'
|
|
17
|
-
import PolarityPicker from '../lib/pickers/PolarityPicker'
|
|
18
|
-
import ResponseCurve from '../lib/pickers/ResponseCurve'
|
|
19
|
-
import ResponseCurvePicker from '../lib/pickers/ResponseCurvePicker'
|
|
20
|
-
import StatusPicker from '../lib/pickers/StatusPicker'
|
|
21
|
-
import ValuePicker from '../lib/pickers/ValuePicker'
|
|
7
|
+
import { OctavePlayer } from '../lib/other/OctavePlayer'
|
|
8
|
+
import { CCPicker } from '../lib/pickers/CCPicker'
|
|
9
|
+
import { ChannelMappingPicker } from '../lib/pickers/ChannelMappingPicker'
|
|
10
|
+
import { ChannelPicker } from '../lib/pickers/ChannelPicker'
|
|
11
|
+
import { Knob } from '../lib/pickers/Knob'
|
|
12
|
+
import { KnobPicker } from '../lib/pickers/KnobPicker'
|
|
13
|
+
import { LatchPicker } from '../lib/pickers/LatchPicker'
|
|
14
|
+
import { MappingPicker } from '../lib/pickers/MappingPicker'
|
|
15
|
+
import { NotePicker } from '../lib/pickers/NotePicker'
|
|
16
|
+
import { PianoPicker } from '../lib/pickers/PianoPicker'
|
|
17
|
+
import { PolarityPicker } from '../lib/pickers/PolarityPicker'
|
|
18
|
+
import { ResponseCurve } from '../lib/pickers/ResponseCurve'
|
|
19
|
+
import { ResponseCurvePicker } from '../lib/pickers/ResponseCurvePicker'
|
|
20
|
+
import { StatusPicker } from '../lib/pickers/StatusPicker'
|
|
21
|
+
import { ValuePicker } from '../lib/pickers/ValuePicker'
|
|
22
22
|
|
|
23
23
|
const meta: Meta = {
|
|
24
24
|
title: 'Pickers',
|