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.
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 +5 -3
  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 +10 -4
  38. package/dist/types/other/SoundFontProvider.d.ts +2 -2
  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 +14 -7
  66. package/lib/other/SoundFontProvider.tsx +6 -4
  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 -6
  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
@@ -29,4 +29,4 @@ class DrawLine extends React.Component<DrawLineProps> {
29
29
  }
30
30
  }
31
31
 
32
- export default DrawLine
32
+ export { DrawLine }
@@ -40,4 +40,4 @@ class HelpersOverlay extends React.Component<HelpersOverlayProps> {
40
40
  }
41
41
  }
42
42
 
43
- export default HelpersOverlay
43
+ export { HelpersOverlay }
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import type { Point } from '../Types'
3
- import utils from '../utils'
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(utils.toRadians(props.valueAngle - 90))
52
+ props.radius * Math.cos(toRadians(props.valueAngle - 90))
53
53
  const valueMarkerY =
54
- props.radius * Math.sin(utils.toRadians(props.valueAngle - 90))
54
+ props.radius * Math.sin(toRadians(props.valueAngle - 90))
55
55
 
56
56
  return {
57
57
  ...state,
@@ -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 utils from './utils'
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 = utils.getAngleForPoint(startPos.x, startPos.y)
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 = utils.getAngleForPoint(currentPos.x, currentPos.y)
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 = utils.getAngleForPoint(currentPos.x, currentPos.y)
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 default RotaryKnob
417
+ export { RotaryKnob }
@@ -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 default {
105
+ export {
106
106
  // toGlobalCoordinates,
107
107
  // toLocalCoordinates,
108
108
  toRadians,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zds-pickers",
3
- "version": "4.0.13",
3
+ "version": "4.0.15",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -4,4 +4,4 @@
4
4
  export const arraySequence = numberOfElements =>
5
5
  Array.from(new Array(numberOfElements).keys())
6
6
 
7
- export default arraySequence
7
+ export { arraySequence }
@@ -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',