zds-pickers 3.11.2 → 4.0.0
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 +196 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +23698 -0
- package/dist/index.es.js.map +1 -0
- package/dist/main.d.ts +232 -0
- package/package.json +56 -65
- package/dist/hooks/useComponentSize.js +0 -54
- package/dist/hooks/useStateWithDynamicDefault.js +0 -11
- package/dist/index.js +0 -43
- package/dist/midi/ccValues.js +0 -137
- package/dist/midi/statuses.js +0 -33
- package/dist/other/DefaultTooltip.js +0 -8
- package/dist/other/OctavePlayer.js +0 -121
- package/dist/other/SVGText.js +0 -116
- package/dist/other/SoundFontProvider.js +0 -124
- package/dist/other/utils.js +0 -52
- package/dist/pickers/CCPicker.js +0 -19
- package/dist/pickers/ChannelMappingPicker.js +0 -79
- package/dist/pickers/ChannelPicker.js +0 -40
- package/dist/pickers/Knob.js +0 -86
- package/dist/pickers/KnobPicker.js +0 -101
- package/dist/pickers/LatchPicker.js +0 -23
- package/dist/pickers/MappingPicker.js +0 -61
- package/dist/pickers/NotePicker.js +0 -83
- package/dist/pickers/PianoPicker.js +0 -104
- package/dist/pickers/PolarityPicker.js +0 -32
- package/dist/pickers/ResponseCurve.js +0 -263
- package/dist/pickers/ResponseCurvePicker.js +0 -58
- package/dist/pickers/Select.js +0 -174
- package/dist/pickers/StatusPicker.js +0 -22
- package/dist/pickers/ValuePicker.js +0 -57
- package/dist/pickers/knobSkin10.js +0 -94
- package/dist/shapes.js +0 -11
- package/dist/stories/assets/General MIDI.js +0 -69
- package/dist/stories/assets/mapper.js +0 -82
- package/dist/stories/assets/utils.js +0 -6
- package/dist/temp/acoustic_grand_piano-mp3.js +0 -94
- package/dist/utils.js +0 -45
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
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 { Mapping } from 'zds-mappings';
|
|
6
|
+
import { RefAttributes } from 'react';
|
|
7
|
+
import { SelectInstance } from 'react-select';
|
|
8
|
+
|
|
9
|
+
export declare const CCPicker: ForwardRefExoticComponent<SelectProps & {
|
|
10
|
+
onChange: (value: number | string) => void;
|
|
11
|
+
value: number;
|
|
12
|
+
} & RefAttributes<SelectRef>>;
|
|
13
|
+
|
|
14
|
+
export declare const ccValues: Option_2[];
|
|
15
|
+
|
|
16
|
+
export declare const ChannelMappingPicker: ForwardRefExoticComponent<SelectProps & {
|
|
17
|
+
channels: Option_2[];
|
|
18
|
+
className?: string;
|
|
19
|
+
onChange: (value: number) => void;
|
|
20
|
+
value: number;
|
|
21
|
+
} & RefAttributes<SelectRef>>;
|
|
22
|
+
|
|
23
|
+
export declare const ChannelPicker: ForwardRefExoticComponent<SelectProps & RefAttributes<SelectRef>>;
|
|
24
|
+
|
|
25
|
+
export declare const combineStatus: (channel: number, status: number) => number;
|
|
26
|
+
|
|
27
|
+
export declare const extractStatus: (status: number) => {
|
|
28
|
+
status: number;
|
|
29
|
+
channel: number;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export declare const getStatusLabel: (val: Status) => string;
|
|
33
|
+
|
|
34
|
+
export declare const Knob: (props: KnobProps) => JSX_2.Element;
|
|
35
|
+
|
|
36
|
+
export declare const KnobPicker: ForwardRefExoticComponent<SelectProps & {
|
|
37
|
+
highToLow?: boolean;
|
|
38
|
+
includeLabel?: boolean;
|
|
39
|
+
includePicker?: boolean;
|
|
40
|
+
knobProps?: Partial<KnobPickerProps>;
|
|
41
|
+
max?: number;
|
|
42
|
+
min?: number;
|
|
43
|
+
wheelEnabled?: boolean;
|
|
44
|
+
wheelSensitivity?: number;
|
|
45
|
+
value: number;
|
|
46
|
+
} & RefAttributes<SelectRef>>;
|
|
47
|
+
|
|
48
|
+
declare type KnobPickerProps = SelectProps & {
|
|
49
|
+
highToLow?: boolean;
|
|
50
|
+
includeLabel?: boolean;
|
|
51
|
+
includePicker?: boolean;
|
|
52
|
+
knobProps?: Partial<KnobPickerProps>;
|
|
53
|
+
max?: number;
|
|
54
|
+
min?: number;
|
|
55
|
+
wheelEnabled?: boolean;
|
|
56
|
+
wheelSensitivity?: number;
|
|
57
|
+
value: number;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare type KnobProps = {
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
max?: number;
|
|
63
|
+
min?: number;
|
|
64
|
+
onChange?: (value: number) => void;
|
|
65
|
+
value?: number;
|
|
66
|
+
wheelEnabled?: boolean;
|
|
67
|
+
wheelSensitivity?: number;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export declare const LatchPicker: ForwardRefExoticComponent<SelectProps & RefAttributes<SelectRef>>;
|
|
71
|
+
|
|
72
|
+
export declare const MappingPicker: ForwardRefExoticComponent<SelectProps & {
|
|
73
|
+
allowClearing: boolean;
|
|
74
|
+
} & RefAttributes<SelectRef>>;
|
|
75
|
+
|
|
76
|
+
export declare const MASK_CHANNEL = 15;
|
|
77
|
+
|
|
78
|
+
export declare const MASK_STATUS = 240;
|
|
79
|
+
|
|
80
|
+
export declare const NotePicker: ForwardRefExoticComponent<SelectProps & {
|
|
81
|
+
channel: number;
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
isMelodicMode?: boolean;
|
|
84
|
+
mapping?: Mapping;
|
|
85
|
+
onChange: (value: number) => void;
|
|
86
|
+
value?: number;
|
|
87
|
+
} & RefAttributes<SelectRef>>;
|
|
88
|
+
|
|
89
|
+
export declare const OctavePlayer: ({ format, height, hostname, instrumentName, octave, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, Tooltip, width, }: WithProviderProps) => JSX_2.Element;
|
|
90
|
+
|
|
91
|
+
declare type Option_2 = {
|
|
92
|
+
label: React.ReactNode;
|
|
93
|
+
value: number | string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export declare const PianoPicker: ({ format, height, hostname, instrumentName, onChange, onClick, onDoubleClick, onKeyMouseEnter, onKeyMouseLeave, soundfont, width, }: WithProviderProps) => JSX_2.Element;
|
|
97
|
+
|
|
98
|
+
export declare const PolarityPicker: ForwardRefExoticComponent<SelectProps & {
|
|
99
|
+
labelOff?: string;
|
|
100
|
+
labelOn?: string;
|
|
101
|
+
} & RefAttributes<SelectRef>>;
|
|
102
|
+
|
|
103
|
+
declare type Props = {
|
|
104
|
+
autosize: boolean;
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
inverted: boolean;
|
|
107
|
+
onChange: (event: {
|
|
108
|
+
target: {
|
|
109
|
+
value: number;
|
|
110
|
+
};
|
|
111
|
+
}) => void;
|
|
112
|
+
Tooltip: React.FC<TooltipProps>;
|
|
113
|
+
value: number;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export declare const RESPONSE_CURVES: Option_2[];
|
|
117
|
+
|
|
118
|
+
export declare type ResponseCurve = {
|
|
119
|
+
value: string | number;
|
|
120
|
+
label: React.ReactNode;
|
|
121
|
+
c1: number;
|
|
122
|
+
c2: number;
|
|
123
|
+
x1: number;
|
|
124
|
+
y1: number;
|
|
125
|
+
x2: number;
|
|
126
|
+
y2: number;
|
|
127
|
+
labelX: number;
|
|
128
|
+
labelY: number;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export declare const ResponseCurve: (props: Props) => JSX_2.Element;
|
|
132
|
+
|
|
133
|
+
export declare const ResponseCurvePicker: ForwardRefExoticComponent<SelectProps & {
|
|
134
|
+
inverted?: boolean;
|
|
135
|
+
Tooltip?: React.FC<TooltipProps>;
|
|
136
|
+
} & RefAttributes<SelectRef>>;
|
|
137
|
+
|
|
138
|
+
export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<SelectRef>>;
|
|
139
|
+
|
|
140
|
+
declare type SelectProps = {
|
|
141
|
+
className?: string;
|
|
142
|
+
components?: object;
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
filterOptions?: (candidate: Option_2, inputValue: string) => boolean;
|
|
145
|
+
formatOptionLabel?: (option: Option_2, { context }: {
|
|
146
|
+
context: 'menu' | 'value';
|
|
147
|
+
}) => React.ReactNode;
|
|
148
|
+
isSearchable?: boolean;
|
|
149
|
+
label?: string;
|
|
150
|
+
onChange: (value: Option_2['value']) => void;
|
|
151
|
+
options: Option_2[] | {
|
|
152
|
+
entries: Option_2[];
|
|
153
|
+
}[];
|
|
154
|
+
preserveMenuWidth?: boolean;
|
|
155
|
+
shrinkLabel?: boolean;
|
|
156
|
+
value: Option_2['value'];
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
declare type SelectRef = SelectInstance<Option_2, false, GroupBase<Option_2>>;
|
|
160
|
+
|
|
161
|
+
declare type Status = typeof STATUS_NOTE_OFF | typeof STATUS_NOTE_ON | typeof STATUS_AFTER_TOUCH | typeof STATUS_CONTROL_CHANGE | typeof STATUS_PROGRAM_CHANGE | typeof STATUS_CHANNEL_PRESSURE | typeof STATUS_PITCH_WHEEL;
|
|
162
|
+
|
|
163
|
+
export declare const STATUS_AFTER_TOUCH = 10;
|
|
164
|
+
|
|
165
|
+
export declare const STATUS_CHANNEL_PRESSURE = 13;
|
|
166
|
+
|
|
167
|
+
export declare const STATUS_CONTROL_CHANGE = 11;
|
|
168
|
+
|
|
169
|
+
export declare const STATUS_NOTE_OFF = 8;
|
|
170
|
+
|
|
171
|
+
export declare const STATUS_NOTE_ON = 9;
|
|
172
|
+
|
|
173
|
+
export declare const STATUS_PITCH_WHEEL = 14;
|
|
174
|
+
|
|
175
|
+
export declare const STATUS_PROGRAM_CHANGE = 12;
|
|
176
|
+
|
|
177
|
+
export declare const Statuses: Record<string, Status>;
|
|
178
|
+
|
|
179
|
+
export declare const statuses: {
|
|
180
|
+
value: Status;
|
|
181
|
+
label: string;
|
|
182
|
+
}[];
|
|
183
|
+
|
|
184
|
+
export declare const StatusPicker: ForwardRefExoticComponent<SelectProps & {
|
|
185
|
+
statuses: Option_2[];
|
|
186
|
+
} & RefAttributes<SelectRef>>;
|
|
187
|
+
|
|
188
|
+
export declare const SVGText: (props: TextProps) => JSX_2.Element;
|
|
189
|
+
|
|
190
|
+
declare type TextProps = Partial<HTMLOrSVGElement> & {
|
|
191
|
+
className?: string;
|
|
192
|
+
dx?: number;
|
|
193
|
+
dy?: number;
|
|
194
|
+
maxHeight?: number;
|
|
195
|
+
maxWidth?: number;
|
|
196
|
+
transform?: string;
|
|
197
|
+
text: string;
|
|
198
|
+
textAnchor?: React.CSSProperties['textAnchor'];
|
|
199
|
+
verticalAnchor?: 'start' | 'middle' | 'end';
|
|
200
|
+
x?: number;
|
|
201
|
+
y?: number;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
declare type TooltipProps = {
|
|
205
|
+
children?: React.ReactNode;
|
|
206
|
+
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
207
|
+
title: React.ReactNode;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export declare const ValuePicker: ForwardRefExoticComponent<SelectProps & {
|
|
211
|
+
highToLow?: boolean;
|
|
212
|
+
max?: number;
|
|
213
|
+
min?: number;
|
|
214
|
+
} & RefAttributes<SelectRef>>;
|
|
215
|
+
|
|
216
|
+
declare type WithProviderProps = {
|
|
217
|
+
format?: 'mp3' | 'ogg';
|
|
218
|
+
height: number;
|
|
219
|
+
hostname?: string;
|
|
220
|
+
instrumentName: default_2.InstrumentName;
|
|
221
|
+
octave?: number;
|
|
222
|
+
onChange?: (note: number) => void;
|
|
223
|
+
onClick?: (note: number) => void;
|
|
224
|
+
onDoubleClick?: (note: number) => void;
|
|
225
|
+
onKeyMouseEnter?: (note: number) => void;
|
|
226
|
+
onKeyMouseLeave?: (note: number) => void;
|
|
227
|
+
soundfont?: 'MusyngKite' | 'FluidR3_GM';
|
|
228
|
+
Tooltip?: TooltipProps;
|
|
229
|
+
width: number;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zds-pickers",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"main": "./dist/index.cjs.js",
|
|
5
|
+
"module": "./dist/index.es.js",
|
|
6
|
+
"types": "./dist/main.d.ts",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist
|
|
9
|
-
"README.md",
|
|
10
|
-
"LICENSE"
|
|
8
|
+
"dist"
|
|
11
9
|
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/main.d.ts",
|
|
13
|
+
"import": "./dist/index.es.js",
|
|
14
|
+
"require": "./dist/index.cjs.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"private": false,
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"homepage": "https://github.com/dkadrios/zds-pickers#readme",
|
|
24
|
+
"license": "MIT",
|
|
12
25
|
"author": "Darin Kadrioski <dkadrios@gmail.com>",
|
|
13
26
|
"bugs": {
|
|
14
27
|
"url": "https://github.com/dkadrios/zds-pickers/issues"
|
|
@@ -19,79 +32,57 @@
|
|
|
19
32
|
"url": "git+https://github.com/dkadrios/zds-pickers.git"
|
|
20
33
|
},
|
|
21
34
|
"scripts": {
|
|
35
|
+
"dev": "vite",
|
|
36
|
+
"build": "tsc --p ./tsconfig.json && vite build",
|
|
22
37
|
"build-storybook": "storybook build",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"prepare": "npm run build",
|
|
29
|
-
"sb": "storybook dev --quiet -p 6006 --ci"
|
|
38
|
+
"lint": "biome check --write",
|
|
39
|
+
"preview": "vite preview",
|
|
40
|
+
"sb": "storybook dev --quiet -p 6006 --no-open",
|
|
41
|
+
"sb:watch": "nodemon --watch .storybook -e ts,tsx,js,jsx --exec 'npm run sb'",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
30
43
|
},
|
|
31
44
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"@storybook/addon-mdx-gfm": "7.5.3",
|
|
48
|
-
"@storybook/react": "7.5.3",
|
|
49
|
-
"@storybook/react-webpack5": "7.5.3",
|
|
50
|
-
"@studysync/eslint-plugin-jsx-conditionals": "2.0.2",
|
|
51
|
-
"@studysync/eslint-plugin-material-ui": "1.2.1",
|
|
52
|
-
"@studysync/eslint-plugin-persnickety": "1.0.5",
|
|
53
|
-
"babel-loader": "9.1.3",
|
|
54
|
-
"classnames": "2.3.2",
|
|
55
|
-
"eslint": "8.54.0",
|
|
56
|
-
"eslint-config-airbnb": "19.0.4",
|
|
57
|
-
"eslint-config-prettier": "9.0.0",
|
|
58
|
-
"eslint-import-resolver-alias": "1.1.2",
|
|
59
|
-
"eslint-import-resolver-parcel": "1.10.6",
|
|
60
|
-
"eslint-plugin-custom-jsx-props-order": "1.0.0",
|
|
61
|
-
"eslint-plugin-import": "2.29.0",
|
|
62
|
-
"eslint-plugin-json": "3.1.0",
|
|
63
|
-
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
64
|
-
"eslint-plugin-ocd": "1.1.0",
|
|
65
|
-
"eslint-plugin-prettier": "5.0.1",
|
|
66
|
-
"eslint-plugin-react": "7.33.2",
|
|
67
|
-
"eslint-plugin-react-hooks": "4.6.0",
|
|
68
|
-
"eslint-plugin-storybook": "^0.6.15",
|
|
69
|
-
"immer": "10.0.3",
|
|
45
|
+
"@biomejs/biome": "1.9.4",
|
|
46
|
+
"@storybook/addon-actions": "8.5.0",
|
|
47
|
+
"@storybook/addon-docs": "8.5.0",
|
|
48
|
+
"@storybook/addon-essentials": "8.5.0",
|
|
49
|
+
"@storybook/addon-links": "8.5.0",
|
|
50
|
+
"@storybook/builder-vite": "8.5.0",
|
|
51
|
+
"@storybook/react": "8.5.0",
|
|
52
|
+
"@storybook/react-vite": "8.5.0",
|
|
53
|
+
"@types/react": "18.3.18",
|
|
54
|
+
"@types/react-dom": "18.3.5",
|
|
55
|
+
"@vitejs/plugin-react-swc": "3.7.2",
|
|
56
|
+
"classnames": "2.5.1",
|
|
57
|
+
"globals": "15.14.0",
|
|
58
|
+
"immer": "10.1.1",
|
|
59
|
+
"nodemon": "3.1.9",
|
|
70
60
|
"nebiru-react-rotary-knob": "1.1.8",
|
|
71
61
|
"prop-types": "15.8.1",
|
|
72
62
|
"react": "18.2.0",
|
|
73
63
|
"react-dom": "18.2.0",
|
|
74
|
-
"react-select": "5.
|
|
75
|
-
"reduce-css-calc": "2.1.8",
|
|
64
|
+
"react-select": "5.9.0",
|
|
76
65
|
"soundfont-player": "0.12.0",
|
|
77
|
-
"storybook": "
|
|
78
|
-
"tonal": "5.
|
|
66
|
+
"storybook": "8.5.0",
|
|
67
|
+
"tonal": "5.2.1",
|
|
68
|
+
"typescript": "5.7.3",
|
|
69
|
+
"vite": "6.0.7",
|
|
70
|
+
"vite-plugin-dts": "4.5.0",
|
|
79
71
|
"zds-mappings": "1.4.9",
|
|
80
72
|
"zds-react-piano": "4.0.10"
|
|
81
73
|
},
|
|
82
74
|
"dependencies": {
|
|
83
|
-
"caniuse-lite": "
|
|
75
|
+
"caniuse-lite": "1.0.30001692"
|
|
84
76
|
},
|
|
85
77
|
"peerDependencies": {
|
|
86
|
-
"classnames": "
|
|
78
|
+
"classnames": "2.5.1",
|
|
87
79
|
"nebiru-react-rotary-knob": "1.1.8",
|
|
88
|
-
"
|
|
89
|
-
"react": ">=18.
|
|
90
|
-
"react-select": ">=5.
|
|
91
|
-
"reduce-css-calc": ">=2.1.8",
|
|
80
|
+
"react": ">=18.0.0",
|
|
81
|
+
"react-dom": ">=18.0.0",
|
|
82
|
+
"react-select": ">=5.9.0",
|
|
92
83
|
"soundfont-player": ">=0.12.0",
|
|
93
|
-
"tonal": "5.
|
|
94
|
-
"zds-mappings": "
|
|
95
|
-
"zds-react-piano": ">=4"
|
|
84
|
+
"tonal": "5.2.1",
|
|
85
|
+
"zds-mappings": "1.4.9",
|
|
86
|
+
"zds-react-piano": ">=4.0.10"
|
|
96
87
|
}
|
|
97
88
|
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; /* eslint-disable consistent-return */
|
|
2
|
-
import { useCallback, useLayoutEffect, useState } from 'react';
|
|
3
|
-
|
|
4
|
-
var getSize = function getSize(el) {return el ?
|
|
5
|
-
{
|
|
6
|
-
width: el.offsetWidth,
|
|
7
|
-
height: el.offsetHeight
|
|
8
|
-
} :
|
|
9
|
-
{
|
|
10
|
-
width: 0,
|
|
11
|
-
height: 0
|
|
12
|
-
};};
|
|
13
|
-
|
|
14
|
-
var useComponentSize = function useComponentSize(ref) {
|
|
15
|
-
var _useState = useState(getSize(ref ? ref.current : {})),_useState2 = _slicedToArray(_useState, 2),componentSize = _useState2[0],setComponentSize = _useState2[1];
|
|
16
|
-
|
|
17
|
-
var handleResize = useCallback(function () {
|
|
18
|
-
if (ref.current) {
|
|
19
|
-
setComponentSize(getSize(ref.current));
|
|
20
|
-
}
|
|
21
|
-
}, [ref]);
|
|
22
|
-
|
|
23
|
-
useLayoutEffect(
|
|
24
|
-
function () {
|
|
25
|
-
if (!ref.current) return;
|
|
26
|
-
|
|
27
|
-
handleResize();
|
|
28
|
-
|
|
29
|
-
if (typeof ResizeObserver === 'function') {
|
|
30
|
-
var resizeObserver = new ResizeObserver(function () {
|
|
31
|
-
handleResize();
|
|
32
|
-
});
|
|
33
|
-
resizeObserver.observe(ref.current);
|
|
34
|
-
|
|
35
|
-
return function () {
|
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
-
resizeObserver.disconnect(ref.current);
|
|
38
|
-
resizeObserver = null;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
window.addEventListener('resize', handleResize);
|
|
42
|
-
|
|
43
|
-
return function () {
|
|
44
|
-
window.removeEventListener('resize', handleResize);
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
-
[ref.current]
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
return componentSize;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default useComponentSize;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
export default (function (defaultVal) {
|
|
4
|
-
var _useState = useState(defaultVal),_useState2 = _slicedToArray(_useState, 2),state = _useState2[0],setState = _useState2[1];
|
|
5
|
-
|
|
6
|
-
useEffect(function () {
|
|
7
|
-
setState(defaultVal);
|
|
8
|
-
}, [defaultVal]);
|
|
9
|
-
|
|
10
|
-
return [state, setState];
|
|
11
|
-
});
|
package/dist/index.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Pickers
|
|
2
|
-
export { default as CCPicker } from './pickers/CCPicker';
|
|
3
|
-
export { default as ChannelMappingPicker } from './pickers/ChannelMappingPicker';
|
|
4
|
-
export { default as ChannelPicker } from './pickers/ChannelPicker';
|
|
5
|
-
export { default as Knob } from './pickers/Knob';
|
|
6
|
-
export { default as KnobPicker } from './pickers/KnobPicker';
|
|
7
|
-
export { default as LatchPicker } from './pickers/LatchPicker';
|
|
8
|
-
export { default as MappingPicker } from './pickers/MappingPicker';
|
|
9
|
-
export { default as NotePicker } from './pickers/NotePicker';
|
|
10
|
-
export { default as OctavePlayer } from './other/OctavePlayer';
|
|
11
|
-
export { default as PianoPicker } from './pickers/PianoPicker';
|
|
12
|
-
export { default as PolarityPicker } from './pickers/PolarityPicker';
|
|
13
|
-
export { default as ResponseCurvePicker } from './pickers/ResponseCurvePicker';
|
|
14
|
-
export { default as Select } from './pickers/Select';
|
|
15
|
-
export { default as StatusPicker } from './pickers/StatusPicker';
|
|
16
|
-
export { default as SVGText } from './other/SVGText';
|
|
17
|
-
export { default as ValuePicker } from './pickers/ValuePicker';
|
|
18
|
-
|
|
19
|
-
// MIDI
|
|
20
|
-
export {
|
|
21
|
-
default as statuses,
|
|
22
|
-
getStatusLabel,
|
|
23
|
-
combineStatus,
|
|
24
|
-
extractStatus,
|
|
25
|
-
STATUS_NOTE_OFF,
|
|
26
|
-
STATUS_NOTE_ON,
|
|
27
|
-
STATUS_AFTER_TOUCH,
|
|
28
|
-
STATUS_CONTROL_CHANGE,
|
|
29
|
-
STATUS_PROGRAM_CHANGE,
|
|
30
|
-
STATUS_CHANNEL_PRESSURE,
|
|
31
|
-
STATUS_PITCH_WHEEL,
|
|
32
|
-
MASK_CHANNEL,
|
|
33
|
-
MASK_STATUS } from
|
|
34
|
-
'./midi/statuses';
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
default as ResponseCurve,
|
|
38
|
-
RESPONSE_CURVES } from
|
|
39
|
-
'./pickers/ResponseCurve';
|
|
40
|
-
|
|
41
|
-
export { default as ccValues } from './midi/ccValues';
|
|
42
|
-
|
|
43
|
-
export { assertRange, memoize } from './utils';
|
package/dist/midi/ccValues.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
var CC_NAMES = [
|
|
2
|
-
'Bank Select',
|
|
3
|
-
'Modulation Wheel',
|
|
4
|
-
'Breath Controller',
|
|
5
|
-
'',
|
|
6
|
-
'Foot Control',
|
|
7
|
-
'Portamento Time',
|
|
8
|
-
'Data Entry Slider',
|
|
9
|
-
'Volume',
|
|
10
|
-
'Balance',
|
|
11
|
-
'',
|
|
12
|
-
'Pan',
|
|
13
|
-
'Expression',
|
|
14
|
-
'Effect Control 1',
|
|
15
|
-
'Effect Control 2',
|
|
16
|
-
'',
|
|
17
|
-
'',
|
|
18
|
-
'',
|
|
19
|
-
'',
|
|
20
|
-
'',
|
|
21
|
-
'',
|
|
22
|
-
'',
|
|
23
|
-
'',
|
|
24
|
-
'',
|
|
25
|
-
'',
|
|
26
|
-
'',
|
|
27
|
-
'',
|
|
28
|
-
'',
|
|
29
|
-
'',
|
|
30
|
-
'',
|
|
31
|
-
'',
|
|
32
|
-
'',
|
|
33
|
-
'',
|
|
34
|
-
'Controller 0',
|
|
35
|
-
'Controller 1',
|
|
36
|
-
'Controller 2',
|
|
37
|
-
'Controller 3',
|
|
38
|
-
'Controller 4',
|
|
39
|
-
'Controller 5',
|
|
40
|
-
'Controller 6',
|
|
41
|
-
'Controller 7',
|
|
42
|
-
'Controller 8',
|
|
43
|
-
'Controller 9',
|
|
44
|
-
'Controller 10',
|
|
45
|
-
'Controller 11',
|
|
46
|
-
'Controller 12',
|
|
47
|
-
'Controller 13',
|
|
48
|
-
'Controller 14',
|
|
49
|
-
'Controller 15',
|
|
50
|
-
'Controller 16',
|
|
51
|
-
'Controller 17',
|
|
52
|
-
'Controller 18',
|
|
53
|
-
'Controller 19',
|
|
54
|
-
'Controller 20',
|
|
55
|
-
'Controller 21',
|
|
56
|
-
'Controller 22',
|
|
57
|
-
'Controller 23',
|
|
58
|
-
'Controller 24',
|
|
59
|
-
'Controller 25',
|
|
60
|
-
'Controller 26',
|
|
61
|
-
'Controller 27',
|
|
62
|
-
'Controller 28',
|
|
63
|
-
'Controller 29',
|
|
64
|
-
'Controller 30',
|
|
65
|
-
'Controller 31',
|
|
66
|
-
'Sustain',
|
|
67
|
-
'Portamento',
|
|
68
|
-
'Sostenuto',
|
|
69
|
-
'Soft Pedal',
|
|
70
|
-
'Legato Pedal',
|
|
71
|
-
'Sustain 2',
|
|
72
|
-
'Sound Variation',
|
|
73
|
-
'Resonance/Timbre',
|
|
74
|
-
'Sound Release Time',
|
|
75
|
-
'Sound Attack Time',
|
|
76
|
-
'Frequency Cutoff',
|
|
77
|
-
'Sound Control 6',
|
|
78
|
-
'Sound Control 7',
|
|
79
|
-
'Sound Control 8',
|
|
80
|
-
'Sound Control 9',
|
|
81
|
-
'Sound Control 10',
|
|
82
|
-
'Decay or General 1',
|
|
83
|
-
'Hi-Pass or General 2',
|
|
84
|
-
'General 3',
|
|
85
|
-
'General 4',
|
|
86
|
-
'Portamento Amount',
|
|
87
|
-
'',
|
|
88
|
-
'',
|
|
89
|
-
'',
|
|
90
|
-
'',
|
|
91
|
-
'',
|
|
92
|
-
'',
|
|
93
|
-
'Reverb Level',
|
|
94
|
-
'Tremolo Depth',
|
|
95
|
-
'Chorus Level',
|
|
96
|
-
'Detune',
|
|
97
|
-
'Phaser Depth',
|
|
98
|
-
'Data Entry +1',
|
|
99
|
-
'Data Entry -1',
|
|
100
|
-
'Non-registered LSB',
|
|
101
|
-
'Non-registered MSB',
|
|
102
|
-
'Registered msb',
|
|
103
|
-
'Registered lsb',
|
|
104
|
-
'',
|
|
105
|
-
'',
|
|
106
|
-
'',
|
|
107
|
-
'',
|
|
108
|
-
'',
|
|
109
|
-
'',
|
|
110
|
-
'',
|
|
111
|
-
'',
|
|
112
|
-
'Shift 1',
|
|
113
|
-
'Shift 2',
|
|
114
|
-
'Shift 3',
|
|
115
|
-
'Shift 4',
|
|
116
|
-
'Shift 5',
|
|
117
|
-
'Shift 6',
|
|
118
|
-
'',
|
|
119
|
-
'',
|
|
120
|
-
'',
|
|
121
|
-
'',
|
|
122
|
-
'All Sound Off',
|
|
123
|
-
'All Controllers Off',
|
|
124
|
-
'Local Mode',
|
|
125
|
-
'All Notes Off',
|
|
126
|
-
'Omni Mode Off',
|
|
127
|
-
'Omni Mode On',
|
|
128
|
-
'Mono Mode On',
|
|
129
|
-
'Poly Mode'].
|
|
130
|
-
map(function (label, value) {return {
|
|
131
|
-
label: String(label).length ? "".concat(
|
|
132
|
-
value, " - ").concat(label) :
|
|
133
|
-
value,
|
|
134
|
-
value: value
|
|
135
|
-
};});
|
|
136
|
-
|
|
137
|
-
export default CC_NAMES;
|
package/dist/midi/statuses.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-bitwise */
|
|
2
|
-
|
|
3
|
-
export var STATUS_NOTE_OFF = 8; // 1000
|
|
4
|
-
export var STATUS_NOTE_ON = 9; // 1001
|
|
5
|
-
export var STATUS_AFTER_TOUCH = 10; // 1010
|
|
6
|
-
export var STATUS_CONTROL_CHANGE = 11; // 1011
|
|
7
|
-
export var STATUS_PROGRAM_CHANGE = 12; // 1100
|
|
8
|
-
export var STATUS_CHANNEL_PRESSURE = 13; // 1101
|
|
9
|
-
export var STATUS_PITCH_WHEEL = 14; // 1110
|
|
10
|
-
|
|
11
|
-
export var MASK_CHANNEL = 15; // 00001111
|
|
12
|
-
export var MASK_STATUS = 240; // 01110000
|
|
13
|
-
|
|
14
|
-
var statuses = [
|
|
15
|
-
{ value: STATUS_NOTE_ON, label: 'Note On' },
|
|
16
|
-
{ value: STATUS_NOTE_OFF, label: 'Note Stack' },
|
|
17
|
-
{ value: STATUS_CONTROL_CHANGE, label: 'Control Change' },
|
|
18
|
-
{ value: STATUS_PROGRAM_CHANGE, label: 'Program Change' },
|
|
19
|
-
{ value: STATUS_AFTER_TOUCH, label: 'Aftertouch' },
|
|
20
|
-
{ value: STATUS_CHANNEL_PRESSURE, label: 'Channel Pressure' },
|
|
21
|
-
{ value: STATUS_PITCH_WHEEL, label: 'Pitch Wheel' }];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export var getStatusLabel = function getStatusLabel(val) {var _statuses$filter$;return ((_statuses$filter$ = statuses.filter(function (_ref) {var value = _ref.value;return value === val;})[0]) === null || _statuses$filter$ === void 0 ? void 0 : _statuses$filter$.label) || '???';};
|
|
25
|
-
|
|
26
|
-
export var combineStatus = function combineStatus(channel, status) {return channel | status << 4;};
|
|
27
|
-
|
|
28
|
-
export var extractStatus = function extractStatus(status) {return {
|
|
29
|
-
status: (status & MASK_STATUS) >> 4 | 8,
|
|
30
|
-
channel: status & MASK_CHANNEL
|
|
31
|
-
};};
|
|
32
|
-
|
|
33
|
-
export default statuses;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
|
|
4
|
-
var DefaultTooltip = function DefaultTooltip(_ref) {var children = _ref.children;return createElement(Fragment, null, children);};
|
|
5
|
-
|
|
6
|
-
DefaultTooltip.propTypes = { children: PropTypes.element.isRequired };
|
|
7
|
-
|
|
8
|
-
export default DefaultTooltip;
|