zds-pickers 4.0.13 → 4.0.15
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 +12482 -36
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/midi/ccValues.js +2 -2
- package/dist/other/DefaultTooltip.js +1 -1
- package/dist/other/OctavePlayer.js +4 -4
- package/dist/other/SoundFontProvider.js +5 -3
- 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 +4 -4
- package/dist/pickers/ResponseCurvePicker.js +4 -4
- 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/other/DefaultTooltip.d.ts +1 -1
- package/dist/types/other/OctavePlayer.d.ts +10 -4
- package/dist/types/other/SoundFontProvider.d.ts +2 -2
- 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 +3 -3
- package/dist/types/pickers/ResponseCurvePicker.d.ts +1 -1
- 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/other/DefaultTooltip.ts +1 -1
- package/lib/other/OctavePlayer.tsx +14 -7
- package/lib/other/SoundFontProvider.tsx +6 -4
- 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 +8 -8
- package/lib/pickers/ResponseCurvePicker.tsx +4 -4
- 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 -6
- 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,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { Point } from '../Types'
|
|
3
|
-
import
|
|
4
|
-
import DrawCircle from './DrawCircle'
|
|
5
|
-
import DrawLine from './DrawLine'
|
|
6
|
-
import HelpersOverlay from './HelpersOverlay'
|
|
3
|
+
import { toRadians } from '../utils'
|
|
4
|
+
import { DrawCircle } from './DrawCircle'
|
|
5
|
+
import { DrawLine } from './DrawLine'
|
|
6
|
+
import { HelpersOverlay } from './HelpersOverlay'
|
|
7
7
|
|
|
8
8
|
/** Precision visual helpers */
|
|
9
9
|
|
|
@@ -49,9 +49,9 @@ 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(
|
|
52
|
+
props.radius * Math.cos(toRadians(props.valueAngle - 90))
|
|
53
53
|
const valueMarkerY =
|
|
54
|
-
props.radius * Math.sin(
|
|
54
|
+
props.radius * Math.sin(toRadians(props.valueAngle - 90))
|
|
55
55
|
|
|
56
56
|
return {
|
|
57
57
|
...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',
|