zds-pickers 4.0.5 → 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.es.js +3 -1
- package/dist/types/index.d.ts +266 -2
- package/dist/types/pickers/CCPicker.d.ts +2 -1
- package/dist/types/pickers/ChannelMappingPicker.d.ts +2 -1
- package/dist/types/pickers/ChannelPicker.d.ts +5 -3
- package/dist/types/pickers/LatchPicker.d.ts +5 -3
- package/dist/types/pickers/MappingPicker.d.ts +2 -1
- package/dist/types/pickers/NotePicker.d.ts +2 -1
- package/dist/types/pickers/PolarityPicker.d.ts +6 -4
- package/dist/types/pickers/ResponseCurve.d.ts +14 -5
- package/dist/types/pickers/ResponseCurvePicker.d.ts +6 -4
- package/dist/types/pickers/StatusPicker.d.ts +2 -1
- package/dist/types/pickers/ValuePicker.d.ts +2 -1
- 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 +2 -6
- 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.d.ts +0 -244
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 { }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
2
|
import type { Option, SelectProps } from './Select';
|
|
3
3
|
type CCPickerProps = SelectProps<number>;
|
|
4
|
+
type CCPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
4
5
|
declare const CCPicker: import("react").ForwardRefExoticComponent<CCPickerProps & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
5
6
|
export default CCPicker;
|
|
6
|
-
export type { CCPickerProps };
|
|
7
|
+
export type { CCPickerProps, CCPickerRef };
|
|
@@ -8,6 +8,7 @@ interface ChannelMappingPickerProps extends SelectProps<InternalValue> {
|
|
|
8
8
|
value: number;
|
|
9
9
|
onChange: (value: InternalValue) => void;
|
|
10
10
|
}
|
|
11
|
+
type ChannelMappingPickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
11
12
|
declare const ChannelMappingPicker: import("react").ForwardRefExoticComponent<ChannelMappingPickerProps & import("react").RefAttributes<SelectInstance<Option<InternalValue>, false, GroupBase<Option<InternalValue>>>>>;
|
|
12
13
|
export default ChannelMappingPicker;
|
|
13
|
-
export type { ChannelMappingPickerProps };
|
|
14
|
+
export type { ChannelMappingPickerProps, ChannelMappingPickerRef };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
2
|
import type { Option, SelectProps } from './Select';
|
|
3
|
-
type
|
|
4
|
-
|
|
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>>>>>;
|
|
5
7
|
export default ChannelPicker;
|
|
6
|
-
export type { ChannelPickerProps };
|
|
8
|
+
export type { Channel, ChannelPickerProps, ChannelPickerRef };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
|
+
import type { Polarity } from './PolarityPicker';
|
|
2
3
|
import type { Option, SelectProps } from './Select';
|
|
3
|
-
type LatchPickerProps = SelectProps<
|
|
4
|
-
|
|
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>>>>>;
|
|
5
7
|
export default LatchPicker;
|
|
6
|
-
export type { LatchPickerProps };
|
|
8
|
+
export type { LatchPickerProps, LatchPickerRef };
|
|
@@ -3,8 +3,9 @@ import type { Option, SelectProps } from './Select';
|
|
|
3
3
|
type MappingPickerProps = SelectProps<string> & {
|
|
4
4
|
allowClearing: boolean;
|
|
5
5
|
};
|
|
6
|
+
type MappingPickerRef = SelectInstance<Option<string>, false, GroupBase<Option<string>>>;
|
|
6
7
|
declare const MappingPicker: import("react").ForwardRefExoticComponent<SelectProps<string> & {
|
|
7
8
|
allowClearing: boolean;
|
|
8
9
|
} & import("react").RefAttributes<SelectInstance<Option<string>, false, GroupBase<Option<string>>>>>;
|
|
9
10
|
export default MappingPicker;
|
|
10
|
-
export type { MappingPickerProps };
|
|
11
|
+
export type { MappingPickerProps, MappingPickerRef };
|
|
@@ -8,6 +8,7 @@ type NotePickerProps = SelectProps<number> & {
|
|
|
8
8
|
mapping?: Mapping;
|
|
9
9
|
onChange: (value: number) => void;
|
|
10
10
|
};
|
|
11
|
+
type NotePickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
11
12
|
declare const NotePicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
12
13
|
channel: number;
|
|
13
14
|
disabled?: boolean;
|
|
@@ -16,4 +17,4 @@ declare const NotePicker: import("react").ForwardRefExoticComponent<SelectProps<
|
|
|
16
17
|
onChange: (value: number) => void;
|
|
17
18
|
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
18
19
|
export default NotePicker;
|
|
19
|
-
export type { NotePickerProps };
|
|
20
|
+
export type { NotePickerProps, NotePickerRef };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
2
|
import type { Option, SelectProps } from './Select';
|
|
3
|
-
type
|
|
3
|
+
type Polarity = 0 | 1;
|
|
4
|
+
type PolarityPickerProps = SelectProps<Polarity> & {
|
|
4
5
|
labelOff?: string;
|
|
5
6
|
labelOn?: string;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
type PolarityPickerRef = SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>;
|
|
9
|
+
declare const PolarityPicker: import("react").ForwardRefExoticComponent<SelectProps<Polarity> & {
|
|
8
10
|
labelOff?: string;
|
|
9
11
|
labelOn?: string;
|
|
10
|
-
} & import("react").RefAttributes<SelectInstance<Option<
|
|
12
|
+
} & import("react").RefAttributes<SelectInstance<Option<Polarity>, false, GroupBase<Option<Polarity>>>>>;
|
|
11
13
|
export default PolarityPicker;
|
|
12
|
-
export type { PolarityPickerProps };
|
|
14
|
+
export type { Polarity, PolarityPickerProps, PolarityPickerRef };
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { type TooltipProps } from '../other/DefaultTooltip';
|
|
2
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;
|
|
3
12
|
type ResponseCurve = {
|
|
4
|
-
value:
|
|
13
|
+
value: Curve;
|
|
5
14
|
label: React.ReactNode;
|
|
6
15
|
c1: number;
|
|
7
16
|
c2: number;
|
|
@@ -12,20 +21,20 @@ type ResponseCurve = {
|
|
|
12
21
|
labelX: number;
|
|
13
22
|
labelY: number;
|
|
14
23
|
};
|
|
15
|
-
declare const RESPONSE_CURVES: Option<
|
|
24
|
+
declare const RESPONSE_CURVES: Option<Curve>[];
|
|
16
25
|
type ResponseCurveProps = {
|
|
17
26
|
autosize: boolean;
|
|
18
27
|
disabled?: boolean;
|
|
19
28
|
inverted: boolean;
|
|
20
29
|
onChange: (event: {
|
|
21
30
|
target: {
|
|
22
|
-
value:
|
|
31
|
+
value: Curve;
|
|
23
32
|
};
|
|
24
33
|
}) => void;
|
|
25
34
|
Tooltip: React.FC<TooltipProps>;
|
|
26
|
-
value:
|
|
35
|
+
value: Curve;
|
|
27
36
|
};
|
|
28
37
|
declare const ResponseCurve: (props: ResponseCurveProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
38
|
export default ResponseCurve;
|
|
30
39
|
export { RESPONSE_CURVES };
|
|
31
|
-
export type { ResponseCurveProps };
|
|
40
|
+
export type { Curve, ResponseCurve, ResponseCurveProps };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { GroupBase, SelectInstance } from 'react-select';
|
|
2
2
|
import { type TooltipProps } from '../other/DefaultTooltip';
|
|
3
|
+
import { type Curve } from './ResponseCurve';
|
|
3
4
|
import type { Option, SelectProps } from './Select';
|
|
4
|
-
type ResponseCurvePickerProps = SelectProps<
|
|
5
|
+
type ResponseCurvePickerProps = SelectProps<Curve> & {
|
|
5
6
|
inverted?: boolean;
|
|
6
7
|
Tooltip?: React.FC<TooltipProps>;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
type ResponseCurvePickerRef = SelectInstance<Option<Curve>, false, GroupBase<Option<Curve>>>;
|
|
10
|
+
declare const ResponseCurvePicker: import("react").ForwardRefExoticComponent<SelectProps<Curve> & {
|
|
9
11
|
inverted?: boolean;
|
|
10
12
|
Tooltip?: React.FC<TooltipProps>;
|
|
11
|
-
} & import("react").RefAttributes<SelectInstance<Option<
|
|
13
|
+
} & import("react").RefAttributes<SelectInstance<Option<Curve>, false, GroupBase<Option<Curve>>>>>;
|
|
12
14
|
export default ResponseCurvePicker;
|
|
13
|
-
export type { ResponseCurvePickerProps };
|
|
15
|
+
export type { ResponseCurvePickerProps, ResponseCurvePickerRef };
|
|
@@ -4,8 +4,9 @@ import type { Option, SelectProps } from './Select';
|
|
|
4
4
|
type StatusPickerProps = SelectProps<Status> & {
|
|
5
5
|
statuses: Option<Status>[];
|
|
6
6
|
};
|
|
7
|
+
type StatusPickerRef = SelectInstance<Option<Status>, false, GroupBase<Option<Status>>>;
|
|
7
8
|
declare const StatusPicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
8
9
|
statuses: Option<Status>[];
|
|
9
10
|
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
10
11
|
export default StatusPicker;
|
|
11
|
-
export type { StatusPickerProps };
|
|
12
|
+
export type { StatusPickerProps, StatusPickerRef };
|
|
@@ -5,10 +5,11 @@ type ValuePickerProps = SelectProps<number> & {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
min?: number;
|
|
7
7
|
};
|
|
8
|
+
type ValuePickerRef = SelectInstance<Option<number>, false, GroupBase<Option<number>>>;
|
|
8
9
|
declare const ValuePicker: import("react").ForwardRefExoticComponent<SelectProps<number> & {
|
|
9
10
|
highToLow?: boolean;
|
|
10
11
|
max?: number;
|
|
11
12
|
min?: number;
|
|
12
13
|
} & import("react").RefAttributes<SelectInstance<Option<number>, false, GroupBase<Option<number>>>>>;
|
|
13
14
|
export default ValuePicker;
|
|
14
|
-
export type { ValuePickerProps };
|
|
15
|
+
export type { ValuePickerProps, ValuePickerRef };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare module 'nebiru-react-rotary-knob' {
|
|
2
|
+
const Knob: React.ComponentType<{
|
|
3
|
+
clampMax: number
|
|
4
|
+
clampMin: number
|
|
5
|
+
className: string
|
|
6
|
+
disabled: boolean
|
|
7
|
+
max: number
|
|
8
|
+
min: number
|
|
9
|
+
onChange: (value: number) => void
|
|
10
|
+
onWheel?: (event: WheelEvent) => void
|
|
11
|
+
preciseMode: boolean
|
|
12
|
+
rotateDegrees: number
|
|
13
|
+
skin: typeof import('./knobSkin10').default
|
|
14
|
+
style: React.CSSProperties
|
|
15
|
+
unlockDistance: number
|
|
16
|
+
value: number
|
|
17
|
+
}>
|
|
18
|
+
|
|
19
|
+
export { Knob }
|
|
20
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
declare module 'react-svgmt' {
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
type DrawCircleProps = React.SVGProps<SVGCircleElement> & {
|
|
5
|
+
r: number
|
|
6
|
+
borderColor?: string
|
|
7
|
+
fillColor?: string
|
|
8
|
+
borderWidth?: number
|
|
9
|
+
fillOpacity: number
|
|
10
|
+
cx: number
|
|
11
|
+
cy: number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class DrawCircle extends React.Component<DrawCircleProps> {
|
|
15
|
+
render(): React.JSX.Element
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type InternalInputProps = {
|
|
19
|
+
min: number
|
|
20
|
+
max: number
|
|
21
|
+
value: number
|
|
22
|
+
step?: number
|
|
23
|
+
inputRef: React.RefObject<HTMLInputElement>
|
|
24
|
+
onChange: (val: number) => void
|
|
25
|
+
style?: React.CSSProperties
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
class InternalInput extends React.Component<InternalInputProps> {
|
|
29
|
+
static defaultProps: {
|
|
30
|
+
step: number
|
|
31
|
+
}
|
|
32
|
+
render(): React.JSX.Element
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Point = {
|
|
36
|
+
x: number
|
|
37
|
+
y: number
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type DrawLineProps = React.SVGProps<SVGLineElement> & {
|
|
41
|
+
width?: number
|
|
42
|
+
color?: string
|
|
43
|
+
p1: Point
|
|
44
|
+
p2: Point
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class DrawLine extends React.Component<DrawLineProps> {
|
|
48
|
+
render(): React.JSX.Element
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type SvgLoaderProps = {
|
|
52
|
+
svg?: string
|
|
53
|
+
svgXML?: string
|
|
54
|
+
width?: string | number
|
|
55
|
+
height?: string | number
|
|
56
|
+
style?: React.CSSProperties
|
|
57
|
+
onSVGReady?: (svg: SVGElement) => void
|
|
58
|
+
children?: React.ReactNode
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type SvgProxyProps = {
|
|
62
|
+
children?: React.ReactNode
|
|
63
|
+
selector: string
|
|
64
|
+
transform?: string
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
class SvgLoader extends React.Component<SvgLoaderProps> {
|
|
68
|
+
render(): React.JSX.Element
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class SvgProxy extends React.Component<SvgProxyProps> {
|
|
72
|
+
render(): React.JSX.Element
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
declare module 'zds-mappings' {
|
|
2
|
+
function cloneMapping(mappingName: string): Mapping
|
|
3
|
+
function createUserMapping(mappingName: string): Mapping
|
|
4
|
+
function editUserMapping(
|
|
5
|
+
mappingName: string,
|
|
6
|
+
noteNum: number,
|
|
7
|
+
field: string,
|
|
8
|
+
value: string | number,
|
|
9
|
+
): Mapping
|
|
10
|
+
|
|
11
|
+
function getMapping(mappingName: string): Mapping
|
|
12
|
+
|
|
13
|
+
function emptyMapping(): Mapping
|
|
14
|
+
|
|
15
|
+
function getNextAvailableMappingName(path: string): string
|
|
16
|
+
function reverse(mapping: Mapping): string
|
|
17
|
+
function storeMapping(mappingName: string, rawContent: string): void
|
|
18
|
+
function validateContent(content: string): boolean
|
|
19
|
+
|
|
20
|
+
function getAvailableGroups(): { label: string; value: string }[]
|
|
21
|
+
function getStockNames(): string[]
|
|
22
|
+
function getUserMappingNames(): string[]
|
|
23
|
+
function removeMapping(mappingName: string): void
|
|
24
|
+
function renameUserMapping(
|
|
25
|
+
oldKey: string,
|
|
26
|
+
newKey: string,
|
|
27
|
+
): { [key: string]: string | number }
|
|
28
|
+
|
|
29
|
+
interface MapItem {
|
|
30
|
+
note: number
|
|
31
|
+
group: string
|
|
32
|
+
name: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type Mapping = MapItem[]
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
cloneMapping,
|
|
39
|
+
createUserMapping,
|
|
40
|
+
emptyMapping,
|
|
41
|
+
editUserMapping,
|
|
42
|
+
getAvailableGroups,
|
|
43
|
+
getMapping,
|
|
44
|
+
getNextAvailableMappingName,
|
|
45
|
+
getStockNames,
|
|
46
|
+
getUserMappingNames,
|
|
47
|
+
removeMapping,
|
|
48
|
+
renameUserMapping,
|
|
49
|
+
reverse,
|
|
50
|
+
storeMapping,
|
|
51
|
+
validateContent,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type { MapItem, Mapping }
|
|
55
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare module 'zds-react-piano' {
|
|
2
|
+
type NoteRange = {
|
|
3
|
+
first: number
|
|
4
|
+
last: number
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const ReactPiano: React.ComponentType<{
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
keyWidthToHeight: number
|
|
10
|
+
noteRange: NoteRange
|
|
11
|
+
width: number
|
|
12
|
+
}>
|
|
13
|
+
|
|
14
|
+
export { ReactPiano as Piano }
|
|
15
|
+
|
|
16
|
+
export type { NoteRange }
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useCallback, useLayoutEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
const getSize = (el: HTMLDivElement | null) =>
|
|
4
|
+
el
|
|
5
|
+
? {
|
|
6
|
+
width: el.offsetWidth,
|
|
7
|
+
height: el.offsetHeight,
|
|
8
|
+
}
|
|
9
|
+
: {
|
|
10
|
+
width: 0,
|
|
11
|
+
height: 0,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const useComponentSize = (ref: React.RefObject<HTMLDivElement>) => {
|
|
15
|
+
const [componentSize, setComponentSize] = useState(
|
|
16
|
+
getSize(ref ? ref.current : null),
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
const handleResize = useCallback(() => {
|
|
20
|
+
if (ref.current) {
|
|
21
|
+
setComponentSize(getSize(ref.current))
|
|
22
|
+
}
|
|
23
|
+
}, [ref])
|
|
24
|
+
|
|
25
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
if (!ref.current) return
|
|
28
|
+
|
|
29
|
+
handleResize()
|
|
30
|
+
|
|
31
|
+
if (typeof ResizeObserver === 'function') {
|
|
32
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
33
|
+
handleResize()
|
|
34
|
+
})
|
|
35
|
+
resizeObserver.observe(ref.current)
|
|
36
|
+
|
|
37
|
+
return () => {
|
|
38
|
+
resizeObserver.disconnect()
|
|
39
|
+
// resizeObserver = null
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
window.addEventListener('resize', handleResize)
|
|
43
|
+
|
|
44
|
+
return () => {
|
|
45
|
+
window.removeEventListener('resize', handleResize)
|
|
46
|
+
}
|
|
47
|
+
}, [ref.current])
|
|
48
|
+
|
|
49
|
+
return componentSize
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default useComponentSize
|