zds-pickers 4.1.0 → 4.1.3

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 (68) hide show
  1. package/dist/index.cjs.js +9 -9
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.es.js +56 -57
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/other/SoundFontProvider.js +5 -4
  6. package/dist/pickers/KeyPicker.js +1 -2
  7. package/dist/types/other/SoundFontProvider.d.ts +1 -1
  8. package/dist/types/pickers/KeyPicker.d.ts +1 -4
  9. package/lib/soundfonts/acoustic_grand_piano-mp3.js +107 -0
  10. package/package.json +5 -1
  11. package/.editorconfig +0 -19
  12. package/.github/workflows/codeql-analysis.yml +0 -67
  13. package/.nvmrc +0 -1
  14. package/.prettierignore +0 -0
  15. package/.prettierrc +0 -13
  16. package/.storybook/main.ts +0 -42
  17. package/.storybook/manager.ts +0 -12
  18. package/.storybook/preview.tsx +0 -26
  19. package/.vscode/extensions.json +0 -32
  20. package/.vscode/javascript.code-snippets +0 -229
  21. package/.vscode/settings.json +0 -358
  22. package/biome.jsonc +0 -158
  23. package/lib/@types/nebiru-react-rotary-knob.d.ts +0 -20
  24. package/lib/@types/react-svgmt.d.ts +0 -74
  25. package/lib/@types/zds-mappings.d.ts +0 -55
  26. package/lib/@types/zds-react-piano.d.ts +0 -17
  27. package/lib/hooks/useComponentSize.ts +0 -52
  28. package/lib/hooks/useStateWithDynamicDefault.ts +0 -13
  29. package/lib/index.ts +0 -52
  30. package/lib/midi/ccValues.ts +0 -139
  31. package/lib/midi/export.ts +0 -88
  32. package/lib/other/DefaultTooltip.ts +0 -14
  33. package/lib/other/OctavePlayer.tsx +0 -139
  34. package/lib/other/SoundFontProvider.tsx +0 -213
  35. package/lib/other/SvgText.tsx +0 -221
  36. package/lib/pickers/CCPicker.tsx +0 -28
  37. package/lib/pickers/ChannelMappingPicker.tsx +0 -150
  38. package/lib/pickers/ChannelPicker.tsx +0 -84
  39. package/lib/pickers/KeyPicker.tsx +0 -56
  40. package/lib/pickers/Knob.tsx +0 -93
  41. package/lib/pickers/KnobPicker.tsx +0 -93
  42. package/lib/pickers/LatchPicker.tsx +0 -33
  43. package/lib/pickers/MappingPicker.tsx +0 -68
  44. package/lib/pickers/NotePicker.tsx +0 -95
  45. package/lib/pickers/PianoPicker.tsx +0 -81
  46. package/lib/pickers/PolarityPicker.tsx +0 -39
  47. package/lib/pickers/ResponseCurve.tsx +0 -251
  48. package/lib/pickers/ResponseCurvePicker.tsx +0 -75
  49. package/lib/pickers/Select.tsx +0 -268
  50. package/lib/pickers/StatusPicker.tsx +0 -30
  51. package/lib/pickers/ValuePicker.tsx +0 -67
  52. package/lib/pickers/knobSkin10.tsx +0 -112
  53. package/lib/rotaryKnob/InternalInput.tsx +0 -43
  54. package/lib/rotaryKnob/Types.ts +0 -6
  55. package/lib/rotaryKnob/helpers/DrawCircle.tsx +0 -41
  56. package/lib/rotaryKnob/helpers/DrawLine.tsx +0 -32
  57. package/lib/rotaryKnob/helpers/HelpersOverlay.tsx +0 -43
  58. package/lib/rotaryKnob/helpers/KnobVisualHelpers.tsx +0 -138
  59. package/lib/rotaryKnob/index.tsx +0 -417
  60. package/lib/rotaryKnob/knobdefaultskin.ts +0 -69
  61. package/lib/rotaryKnob/utils.ts +0 -112
  62. package/lib/utils.ts +0 -41
  63. package/stories/assets/sampleStyles.css +0 -365
  64. package/stories/assets/utils.js +0 -7
  65. package/stories/picker.stories.tsx +0 -432
  66. package/tsconfig.json +0 -35
  67. package/vite.config.ts +0 -41
  68. /package/{lib/temp → dist/soundfonts}/acoustic_grand_piano-mp3.js +0 -0
@@ -25,7 +25,7 @@ if (typeof global !== 'undefined') {
25
25
  // NOTE: This adds ~2.2MB to the bundle size. Currently all consumers need piano,
26
26
  // but if future web apps don't need audio, consider making this import conditional
27
27
  // or implementing lazy loading to reduce bundle size for audio-free use cases.
28
- import '../temp/acoustic_grand_piano-mp3';
28
+ import '../soundfonts/acoustic_grand_piano-mp3';
29
29
  const isDefined = (item) => item !== undefined && item !== null && !Number.isNaN(item);
30
30
  const SoundfontProvider = (props) => {
31
31
  const { audioContext, format, hostname, instrumentName, onChange, render, soundfont, } = props;
@@ -41,7 +41,7 @@ const SoundfontProvider = (props) => {
41
41
  format,
42
42
  soundfont,
43
43
  nameToUrl: (name, sf, fmt) => `${hostname}/${sf}/${name}-${fmt}.js`,
44
- }).then(newInstrument => {
44
+ }).then((newInstrument) => {
45
45
  setInstrument(newInstrument);
46
46
  });
47
47
  }
@@ -83,6 +83,7 @@ const SoundfontProvider = (props) => {
83
83
  },
84
84
  };
85
85
  setInstrument(player);
86
+ setIsLoading(false);
86
87
  }
87
88
  else {
88
89
  setIsLoading(false);
@@ -107,7 +108,7 @@ const SoundfontProvider = (props) => {
107
108
  if (instrument) {
108
109
  audioContext.resume().then(() => {
109
110
  const audioNode = instrument.play(String(midiNumber));
110
- setActiveAudioNodes(prev => ({ ...prev, [midiNumber]: audioNode }));
111
+ setActiveAudioNodes((prev) => ({ ...prev, [midiNumber]: audioNode }));
111
112
  });
112
113
  }
113
114
  };
@@ -118,7 +119,7 @@ const SoundfontProvider = (props) => {
118
119
  }
119
120
  const audioNode = activeAudioNodes[midiNumber];
120
121
  audioNode.stop();
121
- setActiveAudioNodes(prev => {
122
+ setActiveAudioNodes((prev) => {
122
123
  const { [midiNumber]: _, ...rest } = prev;
123
124
  return rest;
124
125
  });
@@ -14,7 +14,6 @@ const KeyPicker = (props) => {
14
14
  const octaveStart = 60 + (octave - 4) * 12;
15
15
  const octaveEnd = octaveStart + 11;
16
16
  const shouldHighlight = value !== noSelection && value >= octaveStart && value <= octaveEnd;
17
- return (_jsx(OctavePlayer, { ...rest, selectedNotes: shouldHighlight ? [value] : [], disabled: disabled, height: height, width: width, octave: octave, onClick: handleKeyClick }));
17
+ return (_jsx(OctavePlayer, { ...rest, selectedNotes: shouldHighlight ? [value] : [], disabled: disabled, height: height, width: width, octave: octave, onClick: handleKeyClick, instrumentName: "acoustic_grand_piano" }));
18
18
  };
19
- KeyPicker.propTypes = {};
20
19
  export { KeyPicker };
@@ -11,7 +11,7 @@ declare global {
11
11
  var MIDI: MIDIGlobal | undefined;
12
12
  }
13
13
  }
14
- import '../temp/acoustic_grand_piano-mp3';
14
+ import '../soundfonts/acoustic_grand_piano-mp3';
15
15
  type SoundfontProviderProps = {
16
16
  audioContext: AudioContext;
17
17
  format?: 'mp3' | 'ogg';
@@ -7,9 +7,6 @@ type KeyPickerProps = Omit<OctavePlayerProps, 'selectedNotes' | 'onClick'> & {
7
7
  width?: number;
8
8
  octave?: number;
9
9
  };
10
- declare const KeyPicker: {
11
- (props: KeyPickerProps): import("react/jsx-runtime").JSX.Element;
12
- propTypes: {};
13
- };
10
+ declare const KeyPicker: (props: KeyPickerProps) => import("react/jsx-runtime").JSX.Element;
14
11
  export { KeyPicker };
15
12
  export type { KeyPickerProps };