zds-pickers 4.1.1 → 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.
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/other/SoundFontProvider.js +4 -4
- package/dist/types/other/SoundFontProvider.d.ts +1 -1
- package/lib/soundfonts/acoustic_grand_piano-mp3.js +107 -0
- package/package.json +5 -1
- package/.editorconfig +0 -19
- package/.github/workflows/codeql-analysis.yml +0 -67
- package/.nvmrc +0 -1
- package/.prettierignore +0 -0
- package/.prettierrc +0 -13
- package/.storybook/main.ts +0 -42
- package/.storybook/manager.ts +0 -12
- package/.storybook/preview.tsx +0 -26
- package/.vscode/extensions.json +0 -32
- package/.vscode/javascript.code-snippets +0 -229
- package/.vscode/settings.json +0 -358
- package/biome.jsonc +0 -158
- package/lib/@types/nebiru-react-rotary-knob.d.ts +0 -20
- package/lib/@types/react-svgmt.d.ts +0 -74
- package/lib/@types/zds-mappings.d.ts +0 -55
- package/lib/@types/zds-react-piano.d.ts +0 -17
- package/lib/hooks/useComponentSize.ts +0 -52
- package/lib/hooks/useStateWithDynamicDefault.ts +0 -13
- package/lib/index.ts +0 -52
- package/lib/midi/ccValues.ts +0 -139
- package/lib/midi/export.ts +0 -88
- package/lib/other/DefaultTooltip.ts +0 -14
- package/lib/other/OctavePlayer.tsx +0 -139
- package/lib/other/SoundFontProvider.tsx +0 -214
- package/lib/other/SvgText.tsx +0 -221
- package/lib/pickers/CCPicker.tsx +0 -28
- package/lib/pickers/ChannelMappingPicker.tsx +0 -150
- package/lib/pickers/ChannelPicker.tsx +0 -84
- package/lib/pickers/KeyPicker.tsx +0 -55
- package/lib/pickers/Knob.tsx +0 -93
- package/lib/pickers/KnobPicker.tsx +0 -93
- package/lib/pickers/LatchPicker.tsx +0 -33
- package/lib/pickers/MappingPicker.tsx +0 -68
- package/lib/pickers/NotePicker.tsx +0 -95
- package/lib/pickers/PianoPicker.tsx +0 -81
- package/lib/pickers/PolarityPicker.tsx +0 -39
- package/lib/pickers/ResponseCurve.tsx +0 -251
- package/lib/pickers/ResponseCurvePicker.tsx +0 -75
- package/lib/pickers/Select.tsx +0 -268
- package/lib/pickers/StatusPicker.tsx +0 -30
- package/lib/pickers/ValuePicker.tsx +0 -67
- package/lib/pickers/knobSkin10.tsx +0 -112
- package/lib/rotaryKnob/InternalInput.tsx +0 -43
- package/lib/rotaryKnob/Types.ts +0 -6
- package/lib/rotaryKnob/helpers/DrawCircle.tsx +0 -41
- package/lib/rotaryKnob/helpers/DrawLine.tsx +0 -32
- package/lib/rotaryKnob/helpers/HelpersOverlay.tsx +0 -43
- package/lib/rotaryKnob/helpers/KnobVisualHelpers.tsx +0 -138
- package/lib/rotaryKnob/index.tsx +0 -417
- package/lib/rotaryKnob/knobdefaultskin.ts +0 -69
- package/lib/rotaryKnob/utils.ts +0 -112
- package/lib/utils.ts +0 -41
- package/stories/assets/sampleStyles.css +0 -365
- package/stories/assets/utils.js +0 -7
- package/stories/picker.stories.tsx +0 -432
- package/tsconfig.json +0 -35
- package/vite.config.ts +0 -41
- /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 '../
|
|
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
|
}
|
|
@@ -108,7 +108,7 @@ const SoundfontProvider = (props) => {
|
|
|
108
108
|
if (instrument) {
|
|
109
109
|
audioContext.resume().then(() => {
|
|
110
110
|
const audioNode = instrument.play(String(midiNumber));
|
|
111
|
-
setActiveAudioNodes(prev => ({ ...prev, [midiNumber]: audioNode }));
|
|
111
|
+
setActiveAudioNodes((prev) => ({ ...prev, [midiNumber]: audioNode }));
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
};
|
|
@@ -119,7 +119,7 @@ const SoundfontProvider = (props) => {
|
|
|
119
119
|
}
|
|
120
120
|
const audioNode = activeAudioNodes[midiNumber];
|
|
121
121
|
audioNode.stop();
|
|
122
|
-
setActiveAudioNodes(prev => {
|
|
122
|
+
setActiveAudioNodes((prev) => {
|
|
123
123
|
const { [midiNumber]: _, ...rest } = prev;
|
|
124
124
|
return rest;
|
|
125
125
|
});
|