zds-pickers 4.0.3 → 4.0.6
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/.editorconfig +19 -0
- package/.github/workflows/codeql-analysis.yml +67 -0
- package/.nvmrc +1 -0
- package/.prettierignore +0 -0
- package/.prettierrc +13 -0
- package/.storybook/main.ts +42 -0
- package/.storybook/manager.ts +12 -0
- package/.storybook/preview.tsx +26 -0
- package/.vscode/extensions.json +32 -0
- package/.vscode/javascript.code-snippets +229 -0
- package/.vscode/settings.json +358 -0
- package/biome.jsonc +158 -0
- package/dist/index.cjs.js +15 -32
- package/dist/index.es.js +4144 -10129
- package/dist/types/hooks/useComponentSize.d.ts +5 -0
- package/dist/types/hooks/useStateWithDynamicDefault.d.ts +2 -0
- package/dist/types/index.d.ts +266 -2
- package/dist/types/main.d.ts +19 -0
- package/dist/types/midi/ccValues.d.ts +3 -0
- package/dist/types/midi/export.d.ts +22 -0
- package/dist/types/other/DefaultTooltip.d.ts +10 -0
- package/dist/types/other/OctavePlayer.d.ts +20 -0
- package/dist/types/other/SVGText.d.ts +17 -0
- package/dist/types/other/SoundFontProvider.d.ts +17 -0
- package/dist/types/pickers/CCPicker.d.ts +7 -0
- package/dist/types/pickers/ChannelMappingPicker.d.ts +14 -0
- package/dist/types/pickers/ChannelPicker.d.ts +8 -0
- package/dist/types/pickers/Knob.d.ts +12 -0
- package/dist/types/pickers/KnobPicker.d.ts +27 -0
- package/dist/types/pickers/LatchPicker.d.ts +8 -0
- package/dist/types/pickers/MappingPicker.d.ts +11 -0
- package/dist/types/pickers/NotePicker.d.ts +20 -0
- package/dist/types/pickers/PianoPicker.d.ts +9 -0
- package/dist/types/pickers/PolarityPicker.d.ts +14 -0
- package/dist/types/pickers/ResponseCurve.d.ts +40 -0
- package/dist/types/pickers/ResponseCurvePicker.d.ts +15 -0
- package/dist/types/pickers/Select.d.ts +29 -0
- package/dist/types/pickers/StatusPicker.d.ts +12 -0
- package/dist/types/pickers/ValuePicker.d.ts +15 -0
- package/dist/types/pickers/knobSkin10.d.ts +14 -0
- package/dist/types/rotaryKnob/InternalInput.d.ts +18 -0
- package/dist/types/rotaryKnob/Types.d.ts +5 -0
- package/dist/types/rotaryKnob/helpers/DrawCircle.d.ts +18 -0
- package/dist/types/rotaryKnob/helpers/DrawLine.d.ts +15 -0
- package/dist/types/rotaryKnob/helpers/HelpersOverlay.d.ts +11 -0
- package/dist/types/rotaryKnob/helpers/KnobVisualHelpers.d.ts +30 -0
- package/dist/types/rotaryKnob/index.d.ts +49 -0
- package/dist/types/rotaryKnob/knobdefaultskin.d.ts +6 -0
- package/dist/types/rotaryKnob/utils.d.ts +49 -0
- package/dist/types/utils.d.ts +9 -0
- package/lib/@types/nebiru-react-rotary-knob.d.ts +20 -0
- package/lib/@types/react-svgmt.d.ts +74 -0
- package/lib/@types/zds-mappings.d.ts +55 -0
- package/lib/@types/zds-react-piano.d.ts +17 -0
- package/lib/hooks/useComponentSize.ts +52 -0
- package/lib/hooks/useStateWithDynamicDefault.ts +13 -0
- package/lib/main.ts +34 -0
- package/lib/midi/ccValues.ts +139 -0
- package/lib/midi/export.ts +54 -0
- package/lib/other/DefaultTooltip.ts +14 -0
- package/lib/other/OctavePlayer.tsx +141 -0
- package/lib/other/SVGText.tsx +221 -0
- package/lib/other/SoundFontProvider.tsx +130 -0
- package/lib/pickers/CCPicker.tsx +28 -0
- package/lib/pickers/ChannelMappingPicker.tsx +135 -0
- package/lib/pickers/ChannelPicker.tsx +76 -0
- package/lib/pickers/Knob.tsx +93 -0
- package/lib/pickers/KnobPicker.tsx +93 -0
- package/lib/pickers/LatchPicker.tsx +33 -0
- package/lib/pickers/MappingPicker.tsx +68 -0
- package/lib/pickers/NotePicker.tsx +95 -0
- package/lib/pickers/PianoPicker.tsx +77 -0
- package/lib/pickers/PolarityPicker.tsx +39 -0
- package/lib/pickers/ResponseCurve.tsx +304 -0
- package/lib/pickers/ResponseCurvePicker.tsx +74 -0
- package/lib/pickers/Select.tsx +248 -0
- package/lib/pickers/StatusPicker.tsx +28 -0
- package/lib/pickers/ValuePicker.tsx +67 -0
- package/lib/pickers/knobSkin10.tsx +94 -0
- package/lib/rotaryKnob/InternalInput.tsx +43 -0
- package/lib/rotaryKnob/Types.ts +6 -0
- package/lib/rotaryKnob/helpers/DrawCircle.tsx +41 -0
- package/lib/rotaryKnob/helpers/DrawLine.tsx +32 -0
- package/lib/rotaryKnob/helpers/HelpersOverlay.tsx +43 -0
- package/lib/rotaryKnob/helpers/KnobVisualHelpers.tsx +138 -0
- package/lib/rotaryKnob/index.tsx +417 -0
- package/lib/rotaryKnob/knobdefaultskin.ts +56 -0
- package/lib/rotaryKnob/utils.ts +112 -0
- package/lib/temp/acoustic_grand_piano-mp3.js +94 -0
- package/lib/utils.ts +41 -0
- package/package.json +3 -7
- package/stories/assets/sampleStyles.css +349 -0
- package/stories/assets/utils.js +7 -0
- package/stories/picker.stories.tsx +313 -0
- package/tsconfig.app.json +26 -0
- package/tsconfig.json +34 -0
- package/tsconfig.node.json +24 -0
- package/vite.config.ts +45 -0
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -244
- package/dist/index.es.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,266 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { default as default_2 } from 'soundfont-player';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { GroupBase } from 'react-select';
|
|
4
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
5
|
+
import { JSX as JSX_3 } from 'react';
|
|
6
|
+
import { JSXElementConstructor } from 'react';
|
|
7
|
+
import { Mapping } from 'zds-mappings';
|
|
8
|
+
import { ReactElement } from 'react';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { RefAttributes } from 'react';
|
|
11
|
+
import { SelectInstance } from 'react-select';
|
|
12
|
+
|
|
13
|
+
export declare const CCPicker: ForwardRefExoticComponent<CCPickerProps & RefAttributes<SelectInstance<Option_2<number>, false, GroupBase<Option_2<number>>>>>;
|
|
14
|
+
|
|
15
|
+
declare type CCPickerProps = SelectProps<number>;
|
|
16
|
+
|
|
17
|
+
export declare const ccValues: Option_2<number>[];
|
|
18
|
+
|
|
19
|
+
declare type Channel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
|
|
20
|
+
|
|
21
|
+
export declare const ChannelMappingPicker: ForwardRefExoticComponent<ChannelMappingPickerProps & RefAttributes<SelectInstance<Option_2<InternalValue>, false, GroupBase<Option_2<InternalValue>>>>>;
|
|
22
|
+
|
|
23
|
+
declare interface ChannelMappingPickerProps extends SelectProps<InternalValue> {
|
|
24
|
+
channels: Option_2<number>[];
|
|
25
|
+
className?: string;
|
|
26
|
+
filterOptions?: (candidate: Option_2<InternalValue>, inputValue: string) => boolean;
|
|
27
|
+
value: number;
|
|
28
|
+
onChange: (value: InternalValue) => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare const ChannelPicker: ForwardRefExoticComponent<ChannelPickerProps & RefAttributes<SelectInstance<Option_2<Channel>, false, GroupBase<Option_2<Channel>>>>>;
|
|
32
|
+
|
|
33
|
+
declare type ChannelPickerProps = SelectProps<Channel>;
|
|
34
|
+
|
|
35
|
+
export declare const combineStatusWithChannel: (channel: number, status: Status_2) => number;
|
|
36
|
+
|
|
37
|
+
declare type Curve = typeof RESPONSE_CURVE_0 | typeof RESPONSE_CURVE_1 | typeof RESPONSE_CURVE_2 | typeof RESPONSE_CURVE_3 | typeof RESPONSE_CURVE_4 | typeof RESPONSE_CURVE_5 | typeof RESPONSE_CURVE_6 | typeof RESPONSE_CURVE_7;
|
|
38
|
+
|
|
39
|
+
export declare const extractStatusAndChannel: (status: number) => {
|
|
40
|
+
status: Status_2;
|
|
41
|
+
channel: number;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export declare const getStatusLabel: (val: Status_2) => string | number | true | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode>;
|
|
45
|
+
|
|
46
|
+
declare type InternalValue = number | 'separator';
|
|
47
|
+
|
|
48
|
+
export declare const Knob: (props: KnobProps) => JSX_2.Element;
|
|
49
|
+
|
|
50
|
+
export declare const KnobPicker: ForwardRefExoticComponent<SelectProps<number> & {
|
|
51
|
+
highToLow?: boolean;
|
|
52
|
+
includeLabel?: boolean;
|
|
53
|
+
includePicker?: boolean;
|
|
54
|
+
knobProps?: Partial<KnobPickerProps>;
|
|
55
|
+
max?: number;
|
|
56
|
+
min?: number;
|
|
57
|
+
wheelEnabled?: boolean;
|
|
58
|
+
wheelSensitivity?: number;
|
|
59
|
+
value: number;
|
|
60
|
+
} & RefAttributes<SelectInstance<Option_2<number>, false, GroupBase<Option_2<number>>>>>;
|
|
61
|
+
|
|
62
|
+
declare type KnobPickerProps = SelectProps<number> & {
|
|
63
|
+
highToLow?: boolean;
|
|
64
|
+
includeLabel?: boolean;
|
|
65
|
+
includePicker?: boolean;
|
|
66
|
+
knobProps?: Partial<KnobPickerProps>;
|
|
67
|
+
max?: number;
|
|
68
|
+
min?: number;
|
|
69
|
+
wheelEnabled?: boolean;
|
|
70
|
+
wheelSensitivity?: number;
|
|
71
|
+
value: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
declare type KnobProps = {
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
max?: number;
|
|
77
|
+
min?: number;
|
|
78
|
+
onChange?: (value: number) => void;
|
|
79
|
+
value?: number;
|
|
80
|
+
wheelEnabled?: boolean;
|
|
81
|
+
wheelSensitivity?: number;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export declare const LatchPicker: ForwardRefExoticComponent<LatchPickerProps & RefAttributes<SelectInstance<Option_2<Polarity>, false, GroupBase<Option_2<Polarity>>>>>;
|
|
85
|
+
|
|
86
|
+
declare type LatchPickerProps = SelectProps<Polarity>;
|
|
87
|
+
|
|
88
|
+
export declare const MappingPicker: ForwardRefExoticComponent<SelectProps<string> & {
|
|
89
|
+
allowClearing: boolean;
|
|
90
|
+
} & RefAttributes<SelectInstance<Option_2<string>, false, GroupBase<Option_2<string>>>>>;
|
|
91
|
+
|
|
92
|
+
export declare const MASK_CHANNEL = 15;
|
|
93
|
+
|
|
94
|
+
export declare const MASK_STATUS = 240;
|
|
95
|
+
|
|
96
|
+
export declare const NotePicker: ForwardRefExoticComponent<SelectProps<number> & {
|
|
97
|
+
channel: number;
|
|
98
|
+
disabled?: boolean;
|
|
99
|
+
isMelodicMode?: boolean;
|
|
100
|
+
mapping?: Mapping;
|
|
101
|
+
onChange: (value: number) => void;
|
|
102
|
+
} & RefAttributes<SelectInstance<Option_2<number>, false, GroupBase<Option_2<number>>>>>;
|
|
103
|
+
|
|
104
|
+
export declare const OctavePlayer: ({ format, height, hostname, instrumentName, octave, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, Tooltip, width, }: WithProviderProps) => JSX_2.Element;
|
|
105
|
+
|
|
106
|
+
declare type Option_2<T> = {
|
|
107
|
+
label: React.ReactNode;
|
|
108
|
+
value: T;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export declare const PianoPicker: ({ format, height, hostname, instrumentName, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, width, }: WithProviderProps) => JSX_2.Element;
|
|
112
|
+
|
|
113
|
+
declare type Polarity = 0 | 1;
|
|
114
|
+
|
|
115
|
+
export declare const PolarityPicker: ForwardRefExoticComponent<SelectProps<Polarity> & {
|
|
116
|
+
labelOff?: string;
|
|
117
|
+
labelOn?: string;
|
|
118
|
+
} & RefAttributes<SelectInstance<Option_2<Polarity>, false, GroupBase<Option_2<Polarity>>>>>;
|
|
119
|
+
|
|
120
|
+
declare const RESPONSE_CURVE_0 = 0;
|
|
121
|
+
|
|
122
|
+
declare const RESPONSE_CURVE_1 = 1;
|
|
123
|
+
|
|
124
|
+
declare const RESPONSE_CURVE_2 = 2;
|
|
125
|
+
|
|
126
|
+
declare const RESPONSE_CURVE_3 = 3;
|
|
127
|
+
|
|
128
|
+
declare const RESPONSE_CURVE_4 = 4;
|
|
129
|
+
|
|
130
|
+
declare const RESPONSE_CURVE_5 = 5;
|
|
131
|
+
|
|
132
|
+
declare const RESPONSE_CURVE_6 = 6;
|
|
133
|
+
|
|
134
|
+
declare const RESPONSE_CURVE_7 = 7;
|
|
135
|
+
|
|
136
|
+
export declare const RESPONSE_CURVES: Option_2<Curve>[];
|
|
137
|
+
|
|
138
|
+
export declare type ResponseCurve = {
|
|
139
|
+
value: Curve;
|
|
140
|
+
label: React.ReactNode;
|
|
141
|
+
c1: number;
|
|
142
|
+
c2: number;
|
|
143
|
+
x1: number;
|
|
144
|
+
y1: number;
|
|
145
|
+
x2: number;
|
|
146
|
+
y2: number;
|
|
147
|
+
labelX: number;
|
|
148
|
+
labelY: number;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export declare const ResponseCurve: (props: ResponseCurveProps) => JSX_2.Element;
|
|
152
|
+
|
|
153
|
+
export declare const ResponseCurvePicker: ForwardRefExoticComponent<SelectProps<Curve> & {
|
|
154
|
+
inverted?: boolean;
|
|
155
|
+
Tooltip?: React.FC<TooltipProps>;
|
|
156
|
+
} & RefAttributes<SelectInstance<Option_2<Curve>, false, GroupBase<Option_2<Curve>>>>>;
|
|
157
|
+
|
|
158
|
+
declare type ResponseCurveProps = {
|
|
159
|
+
autosize: boolean;
|
|
160
|
+
disabled?: boolean;
|
|
161
|
+
inverted: boolean;
|
|
162
|
+
onChange: (event: {
|
|
163
|
+
target: {
|
|
164
|
+
value: Curve;
|
|
165
|
+
};
|
|
166
|
+
}) => void;
|
|
167
|
+
Tooltip: React.FC<TooltipProps>;
|
|
168
|
+
value: Curve;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export declare const Select: <T>(props: SelectProps<T> & {
|
|
172
|
+
ref?: React.ForwardedRef<SelectInstance<Option_2<T>, false, GroupBase<Option_2<T>>>>;
|
|
173
|
+
}) => JSX_3.Element;
|
|
174
|
+
|
|
175
|
+
declare type SelectProps<T> = {
|
|
176
|
+
className?: string;
|
|
177
|
+
components?: object;
|
|
178
|
+
disabled?: boolean;
|
|
179
|
+
filterOptions?: (candidate: Option_2<T>, inputValue: string) => boolean;
|
|
180
|
+
formatOptionLabel?: (option: Option_2<unknown>, { context }: {
|
|
181
|
+
context: 'menu' | 'value';
|
|
182
|
+
}) => React.ReactNode;
|
|
183
|
+
isSearchable?: boolean;
|
|
184
|
+
label?: string;
|
|
185
|
+
onChange: (value: Option_2<T>['value']) => void;
|
|
186
|
+
options: Option_2<T>[] | {
|
|
187
|
+
entries: Option_2<T>[];
|
|
188
|
+
}[];
|
|
189
|
+
preserveMenuWidth?: boolean;
|
|
190
|
+
shrinkLabel?: boolean;
|
|
191
|
+
value: Option_2<T>['value'];
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
declare type Status = (typeof Statuses_2)[keyof typeof Statuses_2]
|
|
195
|
+
|
|
196
|
+
declare type Status_2 = (typeof Statuses)[keyof typeof Statuses];
|
|
197
|
+
|
|
198
|
+
export declare const Statuses: {
|
|
199
|
+
noteOff: number;
|
|
200
|
+
noteOn: number;
|
|
201
|
+
aftertouch: number;
|
|
202
|
+
controlChange: number;
|
|
203
|
+
programChange: number;
|
|
204
|
+
channelPressure: number;
|
|
205
|
+
pitchWheel: number;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
declare const Statuses_2 = {
|
|
209
|
+
noteOff: 8, // 1000
|
|
210
|
+
noteOn: 9, // 1001
|
|
211
|
+
aftertouch: 10, // 1010
|
|
212
|
+
controlChange: 11, // 1011
|
|
213
|
+
programChange: 12, // 1100
|
|
214
|
+
channelPressure: 13, // 1101
|
|
215
|
+
pitchWheel: 14, // 1110
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export declare const StatusPicker: ForwardRefExoticComponent<SelectProps<number> & {
|
|
219
|
+
statuses: Option_2<Status>[];
|
|
220
|
+
} & RefAttributes<SelectInstance<Option_2<number>, false, GroupBase<Option_2<number>>>>>;
|
|
221
|
+
|
|
222
|
+
export declare const SVGText: (props: TextProps) => JSX_2.Element;
|
|
223
|
+
|
|
224
|
+
declare type TextProps = Partial<HTMLOrSVGElement> & {
|
|
225
|
+
className?: string;
|
|
226
|
+
dx?: number;
|
|
227
|
+
dy?: number;
|
|
228
|
+
maxHeight?: number;
|
|
229
|
+
maxWidth?: number;
|
|
230
|
+
transform?: string;
|
|
231
|
+
text: string;
|
|
232
|
+
textAnchor?: React.CSSProperties['textAnchor'];
|
|
233
|
+
verticalAnchor?: 'start' | 'middle' | 'end';
|
|
234
|
+
x?: number;
|
|
235
|
+
y?: number;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
declare type TooltipProps = {
|
|
239
|
+
children?: React.ReactNode;
|
|
240
|
+
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
241
|
+
title: React.ReactNode;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export declare const ValuePicker: ForwardRefExoticComponent<SelectProps<number> & {
|
|
245
|
+
highToLow?: boolean;
|
|
246
|
+
max?: number;
|
|
247
|
+
min?: number;
|
|
248
|
+
} & RefAttributes<SelectInstance<Option_2<number>, false, GroupBase<Option_2<number>>>>>;
|
|
249
|
+
|
|
250
|
+
declare type WithProviderProps = {
|
|
251
|
+
format?: 'mp3' | 'ogg';
|
|
252
|
+
height: number;
|
|
253
|
+
hostname?: string;
|
|
254
|
+
instrumentName: default_2.InstrumentName;
|
|
255
|
+
octave?: number;
|
|
256
|
+
onChange?: (note: number) => void;
|
|
257
|
+
onClick?: (note: number) => void;
|
|
258
|
+
onDoubleClick?: (note: number) => void;
|
|
259
|
+
onKeyMouseEnter?: (note: number) => void;
|
|
260
|
+
onKeyMouseLeave?: (note: number) => void;
|
|
261
|
+
soundfont?: 'MusyngKite' | 'FluidR3_GM';
|
|
262
|
+
Tooltip?: TooltipProps;
|
|
263
|
+
width: number;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export { }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as CCPicker } from './pickers/CCPicker';
|
|
2
|
+
export { default as ChannelMappingPicker } from './pickers/ChannelMappingPicker';
|
|
3
|
+
export { default as ChannelPicker } from './pickers/ChannelPicker';
|
|
4
|
+
export { default as Knob } from './pickers/Knob';
|
|
5
|
+
export { default as KnobPicker } from './pickers/KnobPicker';
|
|
6
|
+
export { default as LatchPicker } from './pickers/LatchPicker';
|
|
7
|
+
export { default as MappingPicker } from './pickers/MappingPicker';
|
|
8
|
+
export { default as NotePicker } from './pickers/NotePicker';
|
|
9
|
+
export { default as OctavePlayer } from './other/OctavePlayer';
|
|
10
|
+
export { default as PianoPicker } from './pickers/PianoPicker';
|
|
11
|
+
export { default as PolarityPicker } from './pickers/PolarityPicker';
|
|
12
|
+
export { default as ResponseCurvePicker } from './pickers/ResponseCurvePicker';
|
|
13
|
+
export { default as Select } from './pickers/Select';
|
|
14
|
+
export { default as StatusPicker } from './pickers/StatusPicker';
|
|
15
|
+
export { default as SVGText } from './other/SVGText';
|
|
16
|
+
export { default as ValuePicker } from './pickers/ValuePicker';
|
|
17
|
+
export { combineStatusWithChannel, extractStatusAndChannel, getStatusLabel, MASK_CHANNEL, MASK_STATUS, Statuses, } from './midi/export';
|
|
18
|
+
export { default as ResponseCurve, RESPONSE_CURVES, } from './pickers/ResponseCurve';
|
|
19
|
+
export { default as ccValues } from './midi/ccValues';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Option } from 'lib/pickers/Select';
|
|
2
|
+
declare const Statuses: {
|
|
3
|
+
noteOff: number;
|
|
4
|
+
noteOn: number;
|
|
5
|
+
aftertouch: number;
|
|
6
|
+
controlChange: number;
|
|
7
|
+
programChange: number;
|
|
8
|
+
channelPressure: number;
|
|
9
|
+
pitchWheel: number;
|
|
10
|
+
};
|
|
11
|
+
type Status = (typeof Statuses)[keyof typeof Statuses];
|
|
12
|
+
declare const MASK_CHANNEL = 15;
|
|
13
|
+
declare const MASK_STATUS = 240;
|
|
14
|
+
declare const statusOptions: Option<Status>[];
|
|
15
|
+
declare const getStatusLabel: (val: Status) => string | number | true | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode>;
|
|
16
|
+
declare const combineStatusWithChannel: (channel: number, status: Status) => number;
|
|
17
|
+
declare const extractStatusAndChannel: (status: number) => {
|
|
18
|
+
status: Status;
|
|
19
|
+
channel: number;
|
|
20
|
+
};
|
|
21
|
+
export { combineStatusWithChannel, extractStatusAndChannel, getStatusLabel, MASK_CHANNEL, MASK_STATUS, statusOptions, Statuses, };
|
|
22
|
+
export type { Status };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type TooltipProps = {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
declare const DefaultTooltip: ({ children }: React.PropsWithoutRef<TooltipProps>) => import("react").FunctionComponentElement<{
|
|
7
|
+
children?: import("react").ReactNode | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export default DefaultTooltip;
|
|
10
|
+
export type { TooltipProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type Soundfont from 'soundfont-player';
|
|
2
|
+
import type { TooltipProps } from './DefaultTooltip';
|
|
3
|
+
type WithProviderProps = {
|
|
4
|
+
format?: 'mp3' | 'ogg';
|
|
5
|
+
height: number;
|
|
6
|
+
hostname?: string;
|
|
7
|
+
instrumentName: Soundfont.InstrumentName;
|
|
8
|
+
octave?: number;
|
|
9
|
+
onChange?: (note: number) => void;
|
|
10
|
+
onClick?: (note: number) => void;
|
|
11
|
+
onDoubleClick?: (note: number) => void;
|
|
12
|
+
onKeyMouseEnter?: (note: number) => void;
|
|
13
|
+
onKeyMouseLeave?: (note: number) => void;
|
|
14
|
+
soundfont?: 'MusyngKite' | 'FluidR3_GM';
|
|
15
|
+
Tooltip?: TooltipProps;
|
|
16
|
+
width: number;
|
|
17
|
+
};
|
|
18
|
+
declare const WithProvider: ({ format, height, hostname, instrumentName, octave, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, Tooltip, width, }: WithProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default WithProvider;
|
|
20
|
+
export type { WithProviderProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const MEASUREMENT_ELEMENT_ID = "__react_svg_text_measurement_id";
|
|
2
|
+
type TextProps = Partial<HTMLOrSVGElement> & {
|
|
3
|
+
className?: string;
|
|
4
|
+
dx?: number;
|
|
5
|
+
dy?: number;
|
|
6
|
+
maxHeight?: number;
|
|
7
|
+
maxWidth?: number;
|
|
8
|
+
transform?: string;
|
|
9
|
+
text: string;
|
|
10
|
+
textAnchor?: React.CSSProperties['textAnchor'];
|
|
11
|
+
verticalAnchor?: 'start' | 'middle' | 'end';
|
|
12
|
+
x?: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
};
|
|
15
|
+
declare const Text: (props: TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default Text;
|
|
17
|
+
export { MEASUREMENT_ELEMENT_ID };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Soundfont from 'soundfont-player';
|
|
2
|
+
type SoundfontProviderProps = {
|
|
3
|
+
audioContext: AudioContext;
|
|
4
|
+
format?: 'mp3' | 'ogg';
|
|
5
|
+
hostname?: string;
|
|
6
|
+
instrumentName: Soundfont.InstrumentName;
|
|
7
|
+
onChange?: (midiNumber: number) => void;
|
|
8
|
+
render: (props: {
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
playNote: (midiNumber: number) => void;
|
|
11
|
+
stopNote: (midiNumber: number) => void;
|
|
12
|
+
stopAllNotes: () => void;
|
|
13
|
+
}) => React.ReactNode;
|
|
14
|
+
soundfont?: 'MusyngKite' | 'FluidR3_GM';
|
|
15
|
+
};
|
|
16
|
+
declare const SoundfontProvider: (props: SoundfontProviderProps) => import("react").ReactNode;
|
|
17
|
+
export default SoundfontProvider;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type CCPickerProps = SelectProps<number>;
|
|
4
|
+
type CCPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
5
|
+
declare const CCPicker: import("react").ForwardRefExoticComponent<CCPickerProps & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
6
|
+
export default CCPicker;
|
|
7
|
+
export type { CCPickerProps, CCPickerRef };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type InternalValue = number | 'separator';
|
|
4
|
+
interface ChannelMappingPickerProps extends SelectProps<InternalValue> {
|
|
5
|
+
channels: Option<number>[];
|
|
6
|
+
className?: string;
|
|
7
|
+
filterOptions?: (candidate: Option<InternalValue>, inputValue: string) => boolean;
|
|
8
|
+
value: number;
|
|
9
|
+
onChange: (value: InternalValue) => void;
|
|
10
|
+
}
|
|
11
|
+
type ChannelMappingPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
12
|
+
declare const ChannelMappingPicker: import("react").ForwardRefExoticComponent<ChannelMappingPickerProps & import("react").RefAttributes<SelectInstance<Option<InternalValue>, false, GroupBase<Option<InternalValue>>>>>;
|
|
13
|
+
export default ChannelMappingPicker;
|
|
14
|
+
export type { ChannelMappingPickerProps, ChannelMappingPickerRef };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type Channel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
|
|
4
|
+
type ChannelPickerProps = SelectProps<Channel>;
|
|
5
|
+
type ChannelPickerRef = SelectInstance<Option<Channel>, false, GroupBase<Option<Channel>>>;
|
|
6
|
+
declare const ChannelPicker: import("react").ForwardRefExoticComponent<ChannelPickerProps & import("react").RefAttributes<SelectInstance<Option<Channel>, false, GroupBase<Option<Channel>>>>>;
|
|
7
|
+
export default ChannelPicker;
|
|
8
|
+
export type { Channel, ChannelPickerProps, ChannelPickerRef };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type KnobProps = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
max?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
onChange?: (value: number) => void;
|
|
6
|
+
value?: number;
|
|
7
|
+
wheelEnabled?: boolean;
|
|
8
|
+
wheelSensitivity?: number;
|
|
9
|
+
};
|
|
10
|
+
declare const Knob: (props: KnobProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default Knob;
|
|
12
|
+
export type { KnobProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type KnobPickerProps = SelectProps<number> & {
|
|
4
|
+
highToLow?: boolean;
|
|
5
|
+
includeLabel?: boolean;
|
|
6
|
+
includePicker?: boolean;
|
|
7
|
+
knobProps?: Partial<KnobPickerProps>;
|
|
8
|
+
max?: number;
|
|
9
|
+
min?: number;
|
|
10
|
+
wheelEnabled?: boolean;
|
|
11
|
+
wheelSensitivity?: number;
|
|
12
|
+
value: number;
|
|
13
|
+
};
|
|
14
|
+
type KnobPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
15
|
+
declare const KnobPicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
16
|
+
highToLow?: boolean;
|
|
17
|
+
includeLabel?: boolean;
|
|
18
|
+
includePicker?: boolean;
|
|
19
|
+
knobProps?: Partial<KnobPickerProps>;
|
|
20
|
+
max?: number;
|
|
21
|
+
min?: number;
|
|
22
|
+
wheelEnabled?: boolean;
|
|
23
|
+
wheelSensitivity?: number;
|
|
24
|
+
value: number;
|
|
25
|
+
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
26
|
+
export default KnobPicker;
|
|
27
|
+
export type { KnobPickerProps, KnobPickerRef };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Polarity } from './PolarityPicker';
|
|
3
|
+
import type { Option, SelectProps } from './Select';
|
|
4
|
+
type LatchPickerProps = SelectProps<Polarity>;
|
|
5
|
+
type LatchPickerRef = SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>;
|
|
6
|
+
declare const LatchPicker: import("react").ForwardRefExoticComponent<LatchPickerProps & import("react").RefAttributes<SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>>>;
|
|
7
|
+
export default LatchPicker;
|
|
8
|
+
export type { LatchPickerProps, LatchPickerRef };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type MappingPickerProps = SelectProps<string> & {
|
|
4
|
+
allowClearing: boolean;
|
|
5
|
+
};
|
|
6
|
+
type MappingPickerRef = SelectInstance<Option<string>, false, GroupBase<Option<string>>>;
|
|
7
|
+
declare const MappingPicker: import("react").ForwardRefExoticComponent<SelectProps<string> & {
|
|
8
|
+
allowClearing: boolean;
|
|
9
|
+
} & import("react").RefAttributes<SelectInstance<Option<string>, false, GroupBase<Option<string>>>>>;
|
|
10
|
+
export default MappingPicker;
|
|
11
|
+
export type { MappingPickerProps, MappingPickerRef };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import { type Mapping } from 'zds-mappings';
|
|
3
|
+
import type { Option, SelectProps } from './Select';
|
|
4
|
+
type NotePickerProps = SelectProps<number> & {
|
|
5
|
+
channel: number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
isMelodicMode?: boolean;
|
|
8
|
+
mapping?: Mapping;
|
|
9
|
+
onChange: (value: number) => void;
|
|
10
|
+
};
|
|
11
|
+
type NotePickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
12
|
+
declare const NotePicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
13
|
+
channel: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
isMelodicMode?: boolean;
|
|
16
|
+
mapping?: Mapping;
|
|
17
|
+
onChange: (value: number) => void;
|
|
18
|
+
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
19
|
+
export default NotePicker;
|
|
20
|
+
export type { NotePickerProps, NotePickerRef };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WithProviderProps } from '../other/OctavePlayer';
|
|
2
|
+
type PianoProps = {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
height: number;
|
|
5
|
+
width: number;
|
|
6
|
+
};
|
|
7
|
+
declare const WithProvider: ({ format, height, hostname, instrumentName, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, width, }: WithProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default WithProvider;
|
|
9
|
+
export type { PianoProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type Polarity = 0 | 1;
|
|
4
|
+
type PolarityPickerProps = SelectProps<Polarity> & {
|
|
5
|
+
labelOff?: string;
|
|
6
|
+
labelOn?: string;
|
|
7
|
+
};
|
|
8
|
+
type PolarityPickerRef = SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>;
|
|
9
|
+
declare const PolarityPicker: import("react").ForwardRefExoticComponent<SelectProps<Polarity> & {
|
|
10
|
+
labelOff?: string;
|
|
11
|
+
labelOn?: string;
|
|
12
|
+
} & import("react").RefAttributes<SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>>>;
|
|
13
|
+
export default PolarityPicker;
|
|
14
|
+
export type { Polarity, PolarityPickerProps, PolarityPickerRef };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type TooltipProps } from '../other/DefaultTooltip';
|
|
2
|
+
import type { Option } from './Select';
|
|
3
|
+
declare const RESPONSE_CURVE_0 = 0;
|
|
4
|
+
declare const RESPONSE_CURVE_1 = 1;
|
|
5
|
+
declare const RESPONSE_CURVE_2 = 2;
|
|
6
|
+
declare const RESPONSE_CURVE_3 = 3;
|
|
7
|
+
declare const RESPONSE_CURVE_4 = 4;
|
|
8
|
+
declare const RESPONSE_CURVE_5 = 5;
|
|
9
|
+
declare const RESPONSE_CURVE_6 = 6;
|
|
10
|
+
declare const RESPONSE_CURVE_7 = 7;
|
|
11
|
+
type Curve = typeof RESPONSE_CURVE_0 | typeof RESPONSE_CURVE_1 | typeof RESPONSE_CURVE_2 | typeof RESPONSE_CURVE_3 | typeof RESPONSE_CURVE_4 | typeof RESPONSE_CURVE_5 | typeof RESPONSE_CURVE_6 | typeof RESPONSE_CURVE_7;
|
|
12
|
+
type ResponseCurve = {
|
|
13
|
+
value: Curve;
|
|
14
|
+
label: React.ReactNode;
|
|
15
|
+
c1: number;
|
|
16
|
+
c2: number;
|
|
17
|
+
x1: number;
|
|
18
|
+
y1: number;
|
|
19
|
+
x2: number;
|
|
20
|
+
y2: number;
|
|
21
|
+
labelX: number;
|
|
22
|
+
labelY: number;
|
|
23
|
+
};
|
|
24
|
+
declare const RESPONSE_CURVES: Option<Curve>[];
|
|
25
|
+
type ResponseCurveProps = {
|
|
26
|
+
autosize: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
inverted: boolean;
|
|
29
|
+
onChange: (event: {
|
|
30
|
+
target: {
|
|
31
|
+
value: Curve;
|
|
32
|
+
};
|
|
33
|
+
}) => void;
|
|
34
|
+
Tooltip: React.FC<TooltipProps>;
|
|
35
|
+
value: Curve;
|
|
36
|
+
};
|
|
37
|
+
declare const ResponseCurve: (props: ResponseCurveProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export default ResponseCurve;
|
|
39
|
+
export { RESPONSE_CURVES };
|
|
40
|
+
export type { Curve, ResponseCurve, ResponseCurveProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import { type TooltipProps } from '../other/DefaultTooltip';
|
|
3
|
+
import { type Curve } from './ResponseCurve';
|
|
4
|
+
import type { Option, SelectProps } from './Select';
|
|
5
|
+
type ResponseCurvePickerProps = SelectProps<Curve> & {
|
|
6
|
+
inverted?: boolean;
|
|
7
|
+
Tooltip?: React.FC<TooltipProps>;
|
|
8
|
+
};
|
|
9
|
+
type ResponseCurvePickerRef = SelectInstance<Option<Curve>, false, GroupBase<Option<Curve>>>;
|
|
10
|
+
declare const ResponseCurvePicker: import("react").ForwardRefExoticComponent<SelectProps<Curve> & {
|
|
11
|
+
inverted?: boolean;
|
|
12
|
+
Tooltip?: React.FC<TooltipProps>;
|
|
13
|
+
} & import("react").RefAttributes<SelectInstance<Option<Curve>, false, GroupBase<Option<Curve>>>>>;
|
|
14
|
+
export default ResponseCurvePicker;
|
|
15
|
+
export type { ResponseCurvePickerProps, ResponseCurvePickerRef };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import { type GroupBase, type SelectInstance } from 'react-select';
|
|
3
|
+
type Option<T> = {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: T;
|
|
6
|
+
};
|
|
7
|
+
type SelectProps<T> = {
|
|
8
|
+
className?: string;
|
|
9
|
+
components?: object;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
filterOptions?: (candidate: Option<T>, inputValue: string) => boolean;
|
|
12
|
+
formatOptionLabel?: (option: Option<unknown>, { context }: {
|
|
13
|
+
context: 'menu' | 'value';
|
|
14
|
+
}) => React.ReactNode;
|
|
15
|
+
isSearchable?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
onChange: (value: Option<T>['value']) => void;
|
|
18
|
+
options: Option<T>[] | {
|
|
19
|
+
entries: Option<T>[];
|
|
20
|
+
}[];
|
|
21
|
+
preserveMenuWidth?: boolean;
|
|
22
|
+
shrinkLabel?: boolean;
|
|
23
|
+
value: Option<T>['value'];
|
|
24
|
+
};
|
|
25
|
+
declare const Select: <T>(props: SelectProps<T> & {
|
|
26
|
+
ref?: React.ForwardedRef<SelectInstance<Option<T>, false, GroupBase<Option<T>>>>;
|
|
27
|
+
}) => JSX.Element;
|
|
28
|
+
export default Select;
|
|
29
|
+
export type { Option, SelectProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Status } from 'lib/midi/export';
|
|
2
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
3
|
+
import type { Option, SelectProps } from './Select';
|
|
4
|
+
type StatusPickerProps = SelectProps<Status> & {
|
|
5
|
+
statuses: Option<Status>[];
|
|
6
|
+
};
|
|
7
|
+
type StatusPickerRef = SelectInstance<Option<Status>, false, GroupBase<Option<Status>>>;
|
|
8
|
+
declare const StatusPicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
9
|
+
statuses: Option<Status>[];
|
|
10
|
+
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
11
|
+
export default StatusPicker;
|
|
12
|
+
export type { StatusPickerProps, StatusPickerRef };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Option, SelectProps } from './Select';
|
|
3
|
+
type ValuePickerProps = SelectProps<number> & {
|
|
4
|
+
highToLow?: boolean;
|
|
5
|
+
max?: number;
|
|
6
|
+
min?: number;
|
|
7
|
+
};
|
|
8
|
+
type ValuePickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
9
|
+
declare const ValuePicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
10
|
+
highToLow?: boolean;
|
|
11
|
+
max?: number;
|
|
12
|
+
min?: number;
|
|
13
|
+
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
14
|
+
export default ValuePicker;
|
|
15
|
+
export type { ValuePickerProps, ValuePickerRef };
|