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.
- package/dist/index.cjs.js +9 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +56 -57
- package/dist/index.es.js.map +1 -1
- package/dist/other/SoundFontProvider.js +5 -4
- package/dist/pickers/KeyPicker.js +1 -2
- package/dist/types/other/SoundFontProvider.d.ts +1 -1
- package/dist/types/pickers/KeyPicker.d.ts +1 -4
- 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 -213
- 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 -56
- 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
|
}
|
|
@@ -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 };
|
|
@@ -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 };
|