@tremolo-ui/react 0.2.0 → 0.2.1
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 +1203 -1036
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +176 -159
- package/dist/index.d.cts +241 -246
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +241 -246
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1187 -1021
- package/dist/index.js.map +1 -1
- package/package.json +17 -19
- package/src/components/AnimationCanvas/index.tsx +0 -7
- package/src/components/DragObserver/index.tsx +9 -7
- package/src/components/Knob/ActiveLine.tsx +29 -0
- package/src/components/Knob/InactiveLine.tsx +53 -0
- package/src/components/Knob/SVGRoot.tsx +39 -0
- package/src/components/Knob/Thumb.tsx +64 -0
- package/src/components/Knob/context.tsx +120 -0
- package/src/components/Knob/index.css +5 -1
- package/src/components/Knob/index.tsx +110 -164
- package/src/components/NumberInput/DecrementStepper.tsx +0 -2
- package/src/components/NumberInput/IncrementStepper.tsx +0 -2
- package/src/components/NumberInput/InternalInput.tsx +3 -1
- package/src/components/NumberInput/Stepper.tsx +0 -2
- package/src/components/NumberInput/context.tsx +0 -1
- package/src/components/NumberInput/index.tsx +6 -8
- package/src/components/Piano/KeyLabel.tsx +0 -2
- package/src/components/Piano/context.tsx +0 -2
- package/src/components/Piano/index.tsx +7 -11
- package/src/components/Piano/key.tsx +0 -10
- package/src/components/Piano/keyboardShortcuts.ts +0 -2
- package/src/components/PointsEditor/Background.tsx +17 -0
- package/src/components/PointsEditor/Container.tsx +26 -0
- package/src/components/PointsEditor/Point.tsx +137 -0
- package/src/components/PointsEditor/context.tsx +91 -0
- package/src/components/PointsEditor/index.css +30 -0
- package/src/components/PointsEditor/index.tsx +129 -0
- package/src/components/Slider/Scale.tsx +0 -2
- package/src/components/Slider/ScaleOption.tsx +0 -2
- package/src/components/Slider/Thumb.tsx +0 -4
- package/src/components/Slider/Track.tsx +0 -2
- package/src/components/Slider/context.tsx +0 -1
- package/src/components/Slider/index.tsx +42 -14
- package/src/components/WheelObserver/index.tsx +17 -19
- package/src/components/XYPad/Area.tsx +0 -2
- package/src/components/XYPad/Thumb.tsx +0 -3
- package/src/components/XYPad/index.tsx +52 -25
- package/src/components/_util/composeRefs.tsx +63 -0
- package/src/components/_util/index.ts +23 -6
- package/src/components/_util/type.ts +1 -0
- package/src/hooks/useAnimationFrame.ts +0 -3
- package/src/hooks/useCallbackRef.ts +2 -2
- package/src/hooks/useDrag.ts +12 -11
- package/src/hooks/useDragWithElement.ts +12 -17
- package/src/hooks/useEventListener.ts +6 -9
- package/src/hooks/useInterval.ts +0 -3
- package/src/hooks/useLongPress.ts +0 -3
- package/src/hooks/useMIDIAccess.ts +0 -1
- package/src/hooks/useMIDIInput.ts +0 -1
- package/src/hooks/useMIDIMessage.ts +0 -1
- package/src/hooks/usePianoDrag.ts +75 -0
- package/src/index.ts +8 -5
- package/src/styles/global.css +17 -1
- package/dist/index.css.map +0 -1
- package/src/components/AnimationKnob/index.tsx +0 -314
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import React$1, { CSSProperties, ComponentPropsWithoutRef, DependencyList, ElementType, ReactElement, ReactNode, RefObject } from "react";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
|
+
import * as _$react from "react";
|
|
2
|
+
import React$1, { CSSProperties, ComponentProps, ComponentPropsWithoutRef, DependencyList, ElementType, ReactElement, ReactNode, Ref, RefObject, SVGProps } from "react";
|
|
4
3
|
import { InputEventOption } from "@tremolo-ui/functions";
|
|
5
4
|
|
|
6
5
|
//#region src/components/AnimationCanvas/index.d.ts
|
|
7
|
-
/** @category AnimationCanvas */
|
|
8
6
|
type InitFunction = (context: CanvasRenderingContext2D, option: {
|
|
9
|
-
/** current canvas width */
|
|
10
|
-
width: number;
|
|
11
|
-
/** current canvas height */
|
|
7
|
+
/** current canvas width */width: number; /** current canvas height */
|
|
12
8
|
height: number;
|
|
13
9
|
}) => void;
|
|
14
|
-
/** @category AnimationCanvas */
|
|
15
10
|
type DrawFunction = (context: CanvasRenderingContext2D, option: {
|
|
16
|
-
/** current canvas width */
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/** frame
|
|
21
|
-
count: number;
|
|
22
|
-
/** delta time (ms) */
|
|
23
|
-
deltaTime: number;
|
|
24
|
-
/** elapsed time (ms) */
|
|
25
|
-
elapsedTime: number;
|
|
26
|
-
/** frame per second */
|
|
11
|
+
/** current canvas width */width: number; /** current canvas height */
|
|
12
|
+
height: number; /** frame count */
|
|
13
|
+
count: number; /** delta time (ms) */
|
|
14
|
+
deltaTime: number; /** elapsed time (ms) */
|
|
15
|
+
elapsedTime: number; /** frame per second */
|
|
27
16
|
fps: number;
|
|
28
17
|
}) => void;
|
|
29
|
-
/** @category AnimationCanvas */
|
|
30
18
|
interface CommonProps {
|
|
31
19
|
draw: DrawFunction;
|
|
32
20
|
init?: InitFunction;
|
|
@@ -36,89 +24,25 @@ interface CommonProps {
|
|
|
36
24
|
*/
|
|
37
25
|
options?: CanvasRenderingContext2DSettings;
|
|
38
26
|
}
|
|
39
|
-
/** @category AnimationCanvas */
|
|
40
27
|
interface AbsoluteSizingProps {
|
|
41
28
|
width?: number;
|
|
42
29
|
height?: number;
|
|
43
30
|
}
|
|
44
|
-
/** @category AnimationCanvas */
|
|
45
31
|
interface RelativeSizingProps {
|
|
46
32
|
relativeSize?: boolean;
|
|
47
33
|
reduceFlickering?: boolean;
|
|
48
34
|
}
|
|
49
|
-
/** @category AnimationCanvas */
|
|
50
35
|
type AnimationCanvasProps = CommonProps & AbsoluteSizingProps & RelativeSizingProps;
|
|
51
36
|
/**
|
|
52
37
|
* A simple animatable canvas with requestAnimationFrame()
|
|
53
|
-
* @category AnimationCanvas
|
|
54
38
|
*/
|
|
55
39
|
declare function AnimationCanvas(props: CommonProps & AbsoluteSizingProps & Omit<ComponentPropsWithoutRef<'canvas'>, keyof AnimationCanvasProps>): ReactElement;
|
|
56
40
|
declare function AnimationCanvas(pros: CommonProps & RelativeSizingProps & Omit<ComponentPropsWithoutRef<'canvas'>, keyof AnimationCanvasProps>): ReactElement;
|
|
57
|
-
//# sourceMappingURL=index.d.ts.map
|
|
58
41
|
//#endregion
|
|
59
|
-
//#region src/components/
|
|
60
|
-
|
|
61
|
-
type AnimationKnobProps = {
|
|
62
|
-
value: number;
|
|
63
|
-
min: number;
|
|
64
|
-
max: number;
|
|
65
|
-
step?: number;
|
|
66
|
-
skew?: number;
|
|
67
|
-
/**
|
|
68
|
-
* value set when double-clicking
|
|
69
|
-
* @see enableDoubleClickDefault
|
|
70
|
-
*/
|
|
71
|
-
defaultValue?: number;
|
|
72
|
-
/**
|
|
73
|
-
* Value to be used as the starting point of the line when drawing.
|
|
74
|
-
* @default min
|
|
75
|
-
*/
|
|
76
|
-
startValue?: number;
|
|
77
|
-
/** Priority over width or height */
|
|
78
|
-
size?: number | `${number}%`;
|
|
79
|
-
width?: number | `${number}%`;
|
|
80
|
-
height?: number | `${number}%`;
|
|
81
|
-
/** active line color */
|
|
82
|
-
activeColor?: string;
|
|
83
|
-
/** inactive line color */
|
|
84
|
-
inactiveColor?: string;
|
|
85
|
-
/** background color */
|
|
86
|
-
bg?: string;
|
|
87
|
-
/** thumb color */
|
|
88
|
-
thumb?: string;
|
|
89
|
-
lineWeight?: number;
|
|
90
|
-
thumbWeight?: number;
|
|
91
|
-
draw?: DrawFunction;
|
|
92
|
-
/** Whether to apply `{use-select: none}` when dragging */
|
|
93
|
-
bodyNoSelect?: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* wheel control option
|
|
96
|
-
*/
|
|
97
|
-
wheel?: InputEventOption | null;
|
|
98
|
-
/**
|
|
99
|
-
* keyboard control option
|
|
100
|
-
*/
|
|
101
|
-
keyboard?: InputEventOption | null;
|
|
102
|
-
enableDoubleClickDefault?: boolean;
|
|
103
|
-
style?: CSSProperties;
|
|
104
|
-
onChange?: (value: number) => void;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* @category AnimationKnob
|
|
108
|
-
*/
|
|
109
|
-
interface AnimationKnobMethods {
|
|
110
|
-
focus: () => void;
|
|
111
|
-
blur: () => void;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Animatable rotary knob.
|
|
115
|
-
* @category AnimationKnob
|
|
116
|
-
*/
|
|
117
|
-
declare const AnimationKnob: React$1.ForwardRefExoticComponent<AnimationKnobProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof AnimationKnobProps> & React$1.RefAttributes<AnimationKnobMethods>>;
|
|
118
|
-
//# sourceMappingURL=index.d.ts.map
|
|
42
|
+
//#region src/components/_util/type.d.ts
|
|
43
|
+
type Override<T, U> = T & Omit<U, keyof T>;
|
|
119
44
|
//#endregion
|
|
120
45
|
//#region src/components/DragObserver/index.d.ts
|
|
121
|
-
/** @category DragObserver */
|
|
122
46
|
interface DragObserverProps<T extends ElementType> {
|
|
123
47
|
/**
|
|
124
48
|
* React.ElementType
|
|
@@ -131,16 +55,78 @@ interface DragObserverProps<T extends ElementType> {
|
|
|
131
55
|
*/
|
|
132
56
|
threshold?: number;
|
|
133
57
|
children?: ReactNode;
|
|
134
|
-
onDrag
|
|
58
|
+
onDrag?: (x: number, y: number, deltaX: number, deltaY: number) => void;
|
|
135
59
|
onDragStart?: () => void;
|
|
136
60
|
onDragEnd?: () => void;
|
|
137
61
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
//#
|
|
62
|
+
declare function DragObserver<T extends ElementType = 'div'>(props: Override<DragObserverProps<T>, ComponentPropsWithoutRef<T>>): _$react.JSX.Element;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/components/_util/index.d.ts
|
|
65
|
+
declare const cursorStyles: {
|
|
66
|
+
grabbing: string;
|
|
67
|
+
grab: string;
|
|
68
|
+
pointer: string;
|
|
69
|
+
move: string;
|
|
70
|
+
none: string;
|
|
71
|
+
};
|
|
72
|
+
type Cursor = keyof typeof cursorStyles;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/components/Knob/ActiveLine.d.ts
|
|
75
|
+
declare function ActiveLine({
|
|
76
|
+
stroke,
|
|
77
|
+
strokeWidth,
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: Omit<SVGProps<SVGPathElement>, 'd'>): _$react.JSX.Element;
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/Knob/InactiveLine.d.ts
|
|
83
|
+
declare function InactiveLine({
|
|
84
|
+
stroke,
|
|
85
|
+
strokeWidth,
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: Omit<SVGProps<SVGPathElement>, 'd'>): _$react.JSX.Element;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/components/Knob/SVGRoot.d.ts
|
|
91
|
+
interface SVGRoot {
|
|
92
|
+
block?: boolean;
|
|
93
|
+
overflowVisible?: boolean;
|
|
94
|
+
}
|
|
95
|
+
declare function SVGRoot({
|
|
96
|
+
children,
|
|
97
|
+
style,
|
|
98
|
+
...props
|
|
99
|
+
}: Override<SVGRoot, SVGProps<SVGSVGElement>>): _$react.JSX.Element;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/Knob/Thumb.d.ts
|
|
102
|
+
interface Props {
|
|
103
|
+
/** color */
|
|
104
|
+
thumb?: string;
|
|
105
|
+
/** color */
|
|
106
|
+
thumbLine?: string;
|
|
107
|
+
/** percent (0-100) */
|
|
108
|
+
thumbSize?: number;
|
|
109
|
+
/** percent (0-100) */
|
|
110
|
+
thumbLineWeight?: number;
|
|
111
|
+
/** percent (0-100) */
|
|
112
|
+
thumbLineLength?: number;
|
|
113
|
+
classes?: {
|
|
114
|
+
thumb?: string;
|
|
115
|
+
thumbLine?: string;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
declare function Thumb({
|
|
119
|
+
className,
|
|
120
|
+
thumb,
|
|
121
|
+
thumbLine,
|
|
122
|
+
thumbSize,
|
|
123
|
+
thumbLineWeight,
|
|
124
|
+
thumbLineLength,
|
|
125
|
+
classes,
|
|
126
|
+
...props
|
|
127
|
+
}: Props & Omit<SVGProps<SVGSVGElement>, 'd' | keyof Props>): _$react.JSX.Element;
|
|
141
128
|
//#endregion
|
|
142
129
|
//#region src/components/Knob/index.d.ts
|
|
143
|
-
/** @category Knob */
|
|
144
130
|
interface KnobProps {
|
|
145
131
|
value: number;
|
|
146
132
|
min: number;
|
|
@@ -149,6 +135,7 @@ interface KnobProps {
|
|
|
149
135
|
skew?: number;
|
|
150
136
|
/**
|
|
151
137
|
* value set when double-clicking
|
|
138
|
+
* restriction: enableDoubleClickDefault = true
|
|
152
139
|
* @default min
|
|
153
140
|
* @see enableDoubleClickDefault
|
|
154
141
|
*/
|
|
@@ -160,105 +147,82 @@ interface KnobProps {
|
|
|
160
147
|
startValue?: number;
|
|
161
148
|
/** width and height */
|
|
162
149
|
size?: number | string;
|
|
163
|
-
/**
|
|
164
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Global style to apply when dragged
|
|
152
|
+
* @default defaultExternalStyles
|
|
153
|
+
*/
|
|
154
|
+
externalStyles?: {
|
|
155
|
+
userSelectNone?: boolean;
|
|
156
|
+
cursor?: Cursor;
|
|
157
|
+
};
|
|
165
158
|
/**
|
|
166
159
|
* wheel control option
|
|
160
|
+
* If null, no event will be triggered
|
|
167
161
|
*/
|
|
168
162
|
wheel?: InputEventOption | null;
|
|
169
163
|
/**
|
|
170
164
|
* keyboard control option
|
|
165
|
+
* If null, no event will be triggered
|
|
171
166
|
*/
|
|
172
167
|
keyboard?: InputEventOption | null;
|
|
173
168
|
enableDoubleClickDefault?: boolean;
|
|
174
169
|
disabled?: boolean;
|
|
175
170
|
readonly?: boolean;
|
|
176
|
-
/** color */
|
|
177
|
-
activeLine?: string;
|
|
178
|
-
/** color */
|
|
179
|
-
inactiveLine?: string;
|
|
180
|
-
/** color */
|
|
181
|
-
thumb?: string;
|
|
182
|
-
/** color */
|
|
183
|
-
thumbLine?: string;
|
|
184
|
-
/** percent (0-100) */
|
|
185
|
-
thumbSize?: number;
|
|
186
|
-
/** percent (0-100) */
|
|
187
|
-
thumbLineWeight?: number;
|
|
188
|
-
/** percent (0-100) */
|
|
189
|
-
thumbLineLength?: number;
|
|
190
|
-
/** line weight [px] */
|
|
191
|
-
lineWeight?: number;
|
|
192
171
|
/** angle range [degree] */
|
|
193
172
|
angleRange?: number;
|
|
194
|
-
classes?: {
|
|
195
|
-
activeLine?: string;
|
|
196
|
-
inactiveLine?: string;
|
|
197
|
-
thumb?: string;
|
|
198
|
-
thumbLine?: string;
|
|
199
|
-
};
|
|
200
173
|
onChange?: (value: number) => void;
|
|
201
174
|
}
|
|
202
|
-
/**
|
|
203
|
-
* @category Knob
|
|
204
|
-
*/
|
|
205
175
|
interface KnobMethods {
|
|
206
176
|
focus: () => void;
|
|
207
177
|
blur: () => void;
|
|
208
178
|
}
|
|
209
179
|
/**
|
|
210
180
|
* Interactive rotary knob component implemented in SVG.
|
|
211
|
-
*
|
|
212
|
-
* @category Knob
|
|
213
181
|
*/
|
|
214
|
-
declare const Knob:
|
|
215
|
-
|
|
182
|
+
declare const Knob: {
|
|
183
|
+
Root: _$react.ForwardRefExoticComponent<KnobProps & Omit<Omit<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KnobProps> & _$react.RefAttributes<KnobMethods>>;
|
|
184
|
+
SVGRoot: typeof SVGRoot;
|
|
185
|
+
InactiveLine: typeof InactiveLine;
|
|
186
|
+
ActiveLine: typeof ActiveLine;
|
|
187
|
+
Thumb: typeof Thumb;
|
|
188
|
+
};
|
|
216
189
|
//#endregion
|
|
217
190
|
//#region src/components/NumberInput/DecrementStepper.d.ts
|
|
218
|
-
/** @category NumberInput */
|
|
219
191
|
interface DecrementStepperProps {
|
|
220
192
|
size?: number;
|
|
221
193
|
children?: ReactNode;
|
|
222
194
|
}
|
|
223
|
-
/** @category NumberInput */
|
|
224
195
|
declare function DecrementStepper({
|
|
225
196
|
size,
|
|
226
197
|
children,
|
|
227
198
|
className,
|
|
228
199
|
...props
|
|
229
|
-
}: DecrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof DecrementStepperProps>):
|
|
230
|
-
//# sourceMappingURL=DecrementStepper.d.ts.map
|
|
200
|
+
}: DecrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof DecrementStepperProps>): _$react.JSX.Element;
|
|
231
201
|
//#endregion
|
|
232
202
|
//#region src/components/NumberInput/IncrementStepper.d.ts
|
|
233
|
-
/** @category NumberInput */
|
|
234
203
|
interface IncrementStepperProps {
|
|
235
204
|
size?: number;
|
|
236
205
|
children?: ReactNode;
|
|
237
206
|
}
|
|
238
|
-
/** @category NumberInput */
|
|
239
207
|
declare function IncrementStepper({
|
|
240
208
|
size,
|
|
241
209
|
children,
|
|
242
210
|
className,
|
|
243
211
|
...props
|
|
244
|
-
}: IncrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof IncrementStepperProps>):
|
|
245
|
-
//# sourceMappingURL=IncrementStepper.d.ts.map
|
|
212
|
+
}: IncrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof IncrementStepperProps>): _$react.JSX.Element;
|
|
246
213
|
//#endregion
|
|
247
214
|
//#region src/components/NumberInput/Stepper.d.ts
|
|
248
|
-
/** @category NumberInput */
|
|
249
215
|
interface StepperProps {
|
|
250
216
|
/** Display only when hovering. */
|
|
251
217
|
dynamic?: boolean;
|
|
252
218
|
children?: ReactNode;
|
|
253
219
|
}
|
|
254
|
-
/** @category NumberInput */
|
|
255
220
|
declare function Stepper({
|
|
256
221
|
dynamic,
|
|
257
222
|
children,
|
|
258
223
|
className,
|
|
259
224
|
...props
|
|
260
|
-
}: StepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof StepperProps>):
|
|
261
|
-
//# sourceMappingURL=Stepper.d.ts.map
|
|
225
|
+
}: StepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof StepperProps>): _$react.JSX.Element;
|
|
262
226
|
//#endregion
|
|
263
227
|
//#region src/components/NumberInput/type.d.ts
|
|
264
228
|
/**
|
|
@@ -269,7 +233,6 @@ declare function Stepper({
|
|
|
269
233
|
type Units = [string, number][];
|
|
270
234
|
//#endregion
|
|
271
235
|
//#region src/components/NumberInput/index.d.ts
|
|
272
|
-
/** @category NumberInput */
|
|
273
236
|
interface NumberInputProps {
|
|
274
237
|
value: number | string;
|
|
275
238
|
/**
|
|
@@ -306,10 +269,12 @@ interface NumberInputProps {
|
|
|
306
269
|
clampValueOnBlur?: boolean;
|
|
307
270
|
/**
|
|
308
271
|
* wheel control option
|
|
272
|
+
* If null, no event will be triggered
|
|
309
273
|
*/
|
|
310
274
|
wheel?: InputEventOption | null;
|
|
311
275
|
/**
|
|
312
276
|
* keyboard control option
|
|
277
|
+
* If null, no event will be triggered
|
|
313
278
|
*/
|
|
314
279
|
keyboard?: InputEventOption | null;
|
|
315
280
|
activeColor?: string;
|
|
@@ -319,27 +284,21 @@ interface NumberInputProps {
|
|
|
319
284
|
onBlur?: (value: number, text: string, event: React.FocusEvent<HTMLInputElement, Element>) => void;
|
|
320
285
|
children?: ReactNode;
|
|
321
286
|
}
|
|
322
|
-
/**
|
|
323
|
-
* @category NumberInput
|
|
324
|
-
*/
|
|
325
287
|
interface NumberInputMethods {
|
|
326
288
|
focus: () => void;
|
|
327
289
|
blur: () => void;
|
|
328
290
|
}
|
|
329
291
|
/**
|
|
330
292
|
* Input with some useful functions for entering numerical values.
|
|
331
|
-
* @category NumberInput
|
|
332
293
|
*/
|
|
333
|
-
declare const NumberInput:
|
|
294
|
+
declare const NumberInput: {
|
|
295
|
+
Root: _$react.ForwardRefExoticComponent<NumberInputProps & Omit<Omit<_$react.DetailedHTMLProps<_$react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | keyof NumberInputProps> & _$react.RefAttributes<NumberInputMethods>>;
|
|
334
296
|
Stepper: typeof Stepper;
|
|
335
297
|
IncrementStepper: typeof IncrementStepper;
|
|
336
298
|
DecrementStepper: typeof DecrementStepper;
|
|
337
299
|
};
|
|
338
300
|
//#endregion
|
|
339
301
|
//#region src/components/Piano/key.d.ts
|
|
340
|
-
/**
|
|
341
|
-
* @category Piano
|
|
342
|
-
*/
|
|
343
302
|
interface KeyProps {
|
|
344
303
|
noteNumber: number;
|
|
345
304
|
width?: number;
|
|
@@ -356,41 +315,32 @@ interface KeyProps {
|
|
|
356
315
|
/** @internal */
|
|
357
316
|
__width?: number;
|
|
358
317
|
}
|
|
359
|
-
/**
|
|
360
|
-
* @category Piano
|
|
361
|
-
*/
|
|
362
318
|
interface KeyMethods {
|
|
363
319
|
play: (velocity?: number) => void;
|
|
364
320
|
stop: () => void;
|
|
365
321
|
played: () => boolean;
|
|
366
322
|
}
|
|
367
|
-
/** @category Piano */
|
|
368
323
|
//#endregion
|
|
369
324
|
//#region src/components/Piano/context.d.ts
|
|
370
|
-
/** @category Piano */
|
|
371
325
|
type NoteRange = {
|
|
372
326
|
first: number;
|
|
373
327
|
last: number;
|
|
374
328
|
};
|
|
375
329
|
//#endregion
|
|
376
330
|
//#region src/components/Piano/keyboardShortcuts.d.ts
|
|
377
|
-
/** @category Piano */
|
|
378
331
|
type KeyboardShortcuts = {
|
|
379
332
|
keys: string[];
|
|
380
333
|
flags?: {
|
|
381
334
|
naturalOnly?: boolean;
|
|
382
335
|
};
|
|
383
336
|
};
|
|
384
|
-
/** @category Piano */
|
|
385
337
|
declare const SHORTCUTS: {
|
|
386
338
|
HOME_ROW: {
|
|
387
339
|
keys: string[];
|
|
388
340
|
};
|
|
389
341
|
};
|
|
390
|
-
//# sourceMappingURL=keyboardShortcuts.d.ts.map
|
|
391
342
|
//#endregion
|
|
392
343
|
//#region src/components/Piano/KeyLabel.d.ts
|
|
393
|
-
/** @category Piano */
|
|
394
344
|
interface KeyLabelProps {
|
|
395
345
|
/**
|
|
396
346
|
* override Piano.label
|
|
@@ -403,7 +353,6 @@ interface KeyLabelProps {
|
|
|
403
353
|
/** @internal */
|
|
404
354
|
__label?: (note: number, index: number) => ReactNode;
|
|
405
355
|
}
|
|
406
|
-
/** @category Piano */
|
|
407
356
|
declare function KeyLabel({
|
|
408
357
|
label,
|
|
409
358
|
className,
|
|
@@ -412,16 +361,13 @@ declare function KeyLabel({
|
|
|
412
361
|
__note,
|
|
413
362
|
__label,
|
|
414
363
|
...props
|
|
415
|
-
}: KeyLabelProps & Omit<ComponentPropsWithoutRef<'div'>, keyof KeyLabelProps>): false |
|
|
416
|
-
//# sourceMappingURL=KeyLabel.d.ts.map
|
|
364
|
+
}: KeyLabelProps & Omit<ComponentPropsWithoutRef<'div'>, keyof KeyLabelProps>): false | _$react.JSX.Element;
|
|
417
365
|
//#endregion
|
|
418
366
|
//#region src/components/Piano/index.d.ts
|
|
419
367
|
/**
|
|
420
368
|
* [noteRange.first, noteRange.first + 1 ..., noteRange.last]
|
|
421
|
-
* @category Piano
|
|
422
369
|
*/
|
|
423
370
|
declare function getNoteRangeArray(noteRange: NoteRange): number[];
|
|
424
|
-
/** @category Piano */
|
|
425
371
|
interface PianoProps {
|
|
426
372
|
noteRange: NoteRange;
|
|
427
373
|
glissando?: boolean;
|
|
@@ -440,35 +386,118 @@ interface PianoProps {
|
|
|
440
386
|
*/
|
|
441
387
|
children?: ReactElement | ReactElement[];
|
|
442
388
|
}
|
|
443
|
-
/**
|
|
444
|
-
* @category Piano
|
|
445
|
-
*/
|
|
446
389
|
interface PianoMethods {
|
|
447
390
|
playNote: (note: number, velocity?: number) => void;
|
|
448
391
|
stopNote: (note: number) => void;
|
|
449
392
|
}
|
|
450
393
|
/**
|
|
451
394
|
* Customizable piano component.
|
|
452
|
-
* @category Piano
|
|
453
395
|
*/
|
|
454
|
-
declare const Piano:
|
|
396
|
+
declare const Piano: {
|
|
397
|
+
Root: React$1.ForwardRefExoticComponent<PianoProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof PianoProps> & React$1.RefAttributes<PianoMethods>>;
|
|
455
398
|
WhiteKey: React$1.ForwardRefExoticComponent<KeyProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KeyProps> & React$1.RefAttributes<KeyMethods>>;
|
|
456
399
|
BlackKey: React$1.ForwardRefExoticComponent<KeyProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KeyProps> & React$1.RefAttributes<KeyMethods>>;
|
|
457
400
|
KeyLabel: typeof KeyLabel;
|
|
458
401
|
};
|
|
459
402
|
//#endregion
|
|
403
|
+
//#region src/components/PointsEditor/Background.d.ts
|
|
404
|
+
declare function Background({
|
|
405
|
+
className,
|
|
406
|
+
children,
|
|
407
|
+
...props
|
|
408
|
+
}: ComponentPropsWithoutRef<'div'>): _$react.JSX.Element;
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/components/PointsEditor/Container.d.ts
|
|
411
|
+
declare function Container({
|
|
412
|
+
className,
|
|
413
|
+
children,
|
|
414
|
+
...props
|
|
415
|
+
}: ComponentPropsWithoutRef<'div'>): _$react.JSX.Element;
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region src/components/PointsEditor/Point.d.ts
|
|
418
|
+
type PointBaseType = {
|
|
419
|
+
x: number;
|
|
420
|
+
y: number;
|
|
421
|
+
};
|
|
422
|
+
declare function clampPoint(point: PointBaseType, min?: Partial<PointBaseType>, max?: Partial<PointBaseType>): {
|
|
423
|
+
x: number;
|
|
424
|
+
y: number;
|
|
425
|
+
};
|
|
426
|
+
interface PointProps<T extends PointBaseType> {
|
|
427
|
+
value: T;
|
|
428
|
+
min?: Partial<PointBaseType>;
|
|
429
|
+
max?: Partial<PointBaseType>;
|
|
430
|
+
size?: number | string;
|
|
431
|
+
width?: number | string;
|
|
432
|
+
height?: number | string;
|
|
433
|
+
color?: string;
|
|
434
|
+
disabled?: boolean;
|
|
435
|
+
readonly?: boolean;
|
|
436
|
+
onChange?: (value: PointBaseType) => void;
|
|
437
|
+
onDragStart?: (value: PointBaseType) => void;
|
|
438
|
+
onDragEnd?: (value: PointBaseType) => void;
|
|
439
|
+
}
|
|
440
|
+
declare function Point<T extends PointBaseType>({
|
|
441
|
+
value,
|
|
442
|
+
min,
|
|
443
|
+
max,
|
|
444
|
+
size,
|
|
445
|
+
width,
|
|
446
|
+
height,
|
|
447
|
+
color,
|
|
448
|
+
disabled,
|
|
449
|
+
readonly,
|
|
450
|
+
onChange,
|
|
451
|
+
onDragStart,
|
|
452
|
+
onDragEnd,
|
|
453
|
+
className,
|
|
454
|
+
style,
|
|
455
|
+
onPointerDown,
|
|
456
|
+
...props
|
|
457
|
+
}: PointProps<T> & Omit<ComponentPropsWithoutRef<'div'>, keyof PointProps<T>>): _$react.JSX.Element;
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/components/PointsEditor/index.d.ts
|
|
460
|
+
interface PointsEditorProps {
|
|
461
|
+
width?: number | string;
|
|
462
|
+
height?: number | string;
|
|
463
|
+
grid?: number | PointBaseType;
|
|
464
|
+
disabled?: boolean;
|
|
465
|
+
readonly?: boolean;
|
|
466
|
+
externalStyles?: {
|
|
467
|
+
userSelectNone?: boolean;
|
|
468
|
+
cursor?: Cursor;
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* wheel control option
|
|
472
|
+
* If null, no event will be triggered
|
|
473
|
+
*/
|
|
474
|
+
wheel?: InputEventOption | null;
|
|
475
|
+
/**
|
|
476
|
+
* keyboard control option
|
|
477
|
+
* If null, no event will be triggered
|
|
478
|
+
*/
|
|
479
|
+
keyboard?: InputEventOption | null;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Multiple Point Controller
|
|
483
|
+
*/
|
|
484
|
+
declare const PointsEditor: {
|
|
485
|
+
Root: _$react.ForwardRefExoticComponent<PointsEditorProps & Omit<Omit<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof PointsEditorProps> & _$react.RefAttributes<HTMLDivElement>>;
|
|
486
|
+
Background: typeof Background;
|
|
487
|
+
Container: typeof Container;
|
|
488
|
+
Point: typeof Point;
|
|
489
|
+
};
|
|
490
|
+
//#endregion
|
|
460
491
|
//#region src/components/Slider/type.d.ts
|
|
461
492
|
type ScaleType = 'mark' | 'mark-number' | 'number';
|
|
462
493
|
type ScaleOptions = ['step', ScaleType] | [number, ScaleType];
|
|
463
494
|
//#endregion
|
|
464
495
|
//#region src/components/Slider/Scale.d.ts
|
|
465
|
-
/** @category Slider */
|
|
466
496
|
interface ScaleProps {
|
|
467
497
|
gap?: number | string;
|
|
468
498
|
options?: ScaleOptions;
|
|
469
499
|
children?: ReactNode;
|
|
470
500
|
}
|
|
471
|
-
/** @category Slider */
|
|
472
501
|
declare function Scale({
|
|
473
502
|
gap,
|
|
474
503
|
options,
|
|
@@ -476,11 +505,9 @@ declare function Scale({
|
|
|
476
505
|
className,
|
|
477
506
|
style,
|
|
478
507
|
...props
|
|
479
|
-
}: ScaleProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleProps>):
|
|
480
|
-
//# sourceMappingURL=Scale.d.ts.map
|
|
508
|
+
}: ScaleProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleProps>): _$react.JSX.Element;
|
|
481
509
|
//#endregion
|
|
482
510
|
//#region src/components/Slider/ScaleOption.d.ts
|
|
483
|
-
/** @category Slider */
|
|
484
511
|
interface ScaleOptionProps {
|
|
485
512
|
value: number;
|
|
486
513
|
type?: ScaleType;
|
|
@@ -502,7 +529,6 @@ interface ScaleOptionProps {
|
|
|
502
529
|
label?: CSSProperties;
|
|
503
530
|
};
|
|
504
531
|
}
|
|
505
|
-
/** @category Slider */
|
|
506
532
|
declare function ScaleOption({
|
|
507
533
|
value,
|
|
508
534
|
type,
|
|
@@ -516,11 +542,9 @@ declare function ScaleOption({
|
|
|
516
542
|
className,
|
|
517
543
|
style,
|
|
518
544
|
...props
|
|
519
|
-
}: ScaleOptionProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleOptionProps>):
|
|
520
|
-
//# sourceMappingURL=ScaleOption.d.ts.map
|
|
545
|
+
}: ScaleOptionProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleOptionProps>): _$react.JSX.Element;
|
|
521
546
|
//#endregion
|
|
522
547
|
//#region src/components/Slider/Thumb.d.ts
|
|
523
|
-
/** @category Slider */
|
|
524
548
|
interface SliderThumbProps {
|
|
525
549
|
size?: number | string;
|
|
526
550
|
width?: number | string;
|
|
@@ -532,15 +556,12 @@ interface SliderThumbProps {
|
|
|
532
556
|
/** @internal */
|
|
533
557
|
__percent?: number;
|
|
534
558
|
}
|
|
535
|
-
/** @category Slider */
|
|
536
559
|
interface SliderThumbMethods {
|
|
537
560
|
focus: () => void;
|
|
538
561
|
blur: () => void;
|
|
539
562
|
}
|
|
540
|
-
/** @category Slider */
|
|
541
563
|
//#endregion
|
|
542
564
|
//#region src/components/Slider/Track.d.ts
|
|
543
|
-
/** @category Slider */
|
|
544
565
|
interface SliderTrackProps {
|
|
545
566
|
length?: number | string;
|
|
546
567
|
thickness?: number | string;
|
|
@@ -555,7 +576,6 @@ interface SliderTrackProps {
|
|
|
555
576
|
/** @internal */
|
|
556
577
|
__percent?: number;
|
|
557
578
|
}
|
|
558
|
-
/** @category Slider */
|
|
559
579
|
declare function Track({
|
|
560
580
|
length,
|
|
561
581
|
thickness,
|
|
@@ -568,8 +588,7 @@ declare function Track({
|
|
|
568
588
|
__thumb,
|
|
569
589
|
__percent,
|
|
570
590
|
...props
|
|
571
|
-
}: SliderTrackProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SliderTrackProps>):
|
|
572
|
-
//# sourceMappingURL=Track.d.ts.map
|
|
591
|
+
}: SliderTrackProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SliderTrackProps>): _$react.JSX.Element;
|
|
573
592
|
//#endregion
|
|
574
593
|
//#region src/components/Slider/context.d.ts
|
|
575
594
|
type State = {
|
|
@@ -582,35 +601,45 @@ type State = {
|
|
|
582
601
|
disabled: boolean;
|
|
583
602
|
readonly: boolean;
|
|
584
603
|
};
|
|
585
|
-
/** @category Slider */
|
|
586
604
|
declare function useSliderContext<T>(selector: (state: State) => T): T;
|
|
587
605
|
//#endregion
|
|
588
606
|
//#region src/components/Slider/index.d.ts
|
|
589
|
-
/** @category Slider */
|
|
590
607
|
interface SliderProps {
|
|
591
608
|
value: number;
|
|
592
609
|
min: number;
|
|
593
610
|
max: number;
|
|
594
611
|
step?: number;
|
|
595
612
|
skew?: number;
|
|
613
|
+
/**
|
|
614
|
+
* slider orientation
|
|
615
|
+
* aria-orientation property is also applied.
|
|
616
|
+
*/
|
|
596
617
|
vertical?: boolean;
|
|
597
618
|
reverse?: boolean;
|
|
598
|
-
|
|
619
|
+
/** Global style to apply when dragged */
|
|
620
|
+
externalStyles?: {
|
|
621
|
+
userSelectNone?: boolean;
|
|
622
|
+
cursor?: Cursor;
|
|
623
|
+
};
|
|
599
624
|
/**
|
|
600
625
|
* wheel control option
|
|
626
|
+
* If null, no event will be triggered
|
|
601
627
|
*/
|
|
602
628
|
wheel?: InputEventOption | null;
|
|
603
629
|
/**
|
|
604
630
|
* keyboard control option
|
|
631
|
+
* If null, no event will be triggered
|
|
605
632
|
*/
|
|
606
633
|
keyboard?: InputEventOption | null;
|
|
607
634
|
/**
|
|
608
635
|
* Only the appearance will change.
|
|
609
636
|
* Please consider using with readonly.
|
|
637
|
+
* aria-disabled property is also applied.
|
|
610
638
|
*/
|
|
611
639
|
disabled?: boolean;
|
|
612
640
|
/**
|
|
613
641
|
* Make the value unchangeable.
|
|
642
|
+
* aria-readonly property is also applied.
|
|
614
643
|
*/
|
|
615
644
|
readonly?: boolean;
|
|
616
645
|
className?: string;
|
|
@@ -621,18 +650,15 @@ interface SliderProps {
|
|
|
621
650
|
/** \<SliderThumb /> | \<SliderTrack /> */
|
|
622
651
|
children?: ReactElement | ReactElement[];
|
|
623
652
|
}
|
|
624
|
-
/**
|
|
625
|
-
* @category Slider
|
|
626
|
-
*/
|
|
627
653
|
interface SliderMethods {
|
|
628
654
|
focus: () => void;
|
|
629
655
|
blur: () => void;
|
|
630
656
|
}
|
|
631
657
|
/**
|
|
632
658
|
* Customizable slider
|
|
633
|
-
* @category Slider
|
|
634
659
|
*/
|
|
635
|
-
declare const Slider:
|
|
660
|
+
declare const Slider: {
|
|
661
|
+
Root: React$1.ForwardRefExoticComponent<SliderProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SliderProps> & React$1.RefAttributes<SliderMethods>>;
|
|
636
662
|
Thumb: React$1.ForwardRefExoticComponent<SliderThumbProps & React$1.RefAttributes<SliderThumbMethods>>;
|
|
637
663
|
Track: typeof Track;
|
|
638
664
|
Scale: typeof Scale;
|
|
@@ -640,6 +666,15 @@ declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & Omit<Omit<
|
|
|
640
666
|
};
|
|
641
667
|
//#endregion
|
|
642
668
|
//#region src/components/WheelObserver/index.d.ts
|
|
669
|
+
interface WheelObserverProps<T extends ElementType> {
|
|
670
|
+
/**
|
|
671
|
+
* React.ElementType
|
|
672
|
+
* @default div
|
|
673
|
+
*/
|
|
674
|
+
as?: T;
|
|
675
|
+
children?: ReactNode;
|
|
676
|
+
onWheel?: (event: WheelEvent) => void;
|
|
677
|
+
}
|
|
643
678
|
/**
|
|
644
679
|
* @example
|
|
645
680
|
* <WheelObserver
|
|
@@ -651,22 +686,9 @@ declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & Omit<Omit<
|
|
|
651
686
|
* <div>Wheel here</div>
|
|
652
687
|
* </WheelObserver>
|
|
653
688
|
*/
|
|
654
|
-
|
|
655
|
-
interface WheelObserverProps<T extends ElementType> {
|
|
656
|
-
/**
|
|
657
|
-
* React.ElementType
|
|
658
|
-
* @default div
|
|
659
|
-
*/
|
|
660
|
-
as?: T;
|
|
661
|
-
children?: ReactNode;
|
|
662
|
-
onWheel?: (event: WheelEvent) => void;
|
|
663
|
-
}
|
|
664
|
-
/** @category WheelObserver */
|
|
665
|
-
declare function WheelObserver<T extends ElementType = 'div'>(props: WheelObserverProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof WheelObserverProps<T>>): react_jsx_runtime0.JSX.Element;
|
|
666
|
-
//# sourceMappingURL=index.d.ts.map
|
|
689
|
+
declare function WheelObserver<T extends ElementType = 'div'>(props: Override<WheelObserverProps<T>, ComponentProps<T>>): _$react.JSX.Element;
|
|
667
690
|
//#endregion
|
|
668
691
|
//#region src/components/XYPad/Area.d.ts
|
|
669
|
-
/** @category XYPad */
|
|
670
692
|
interface XYPadAreaProps {
|
|
671
693
|
width?: number | string;
|
|
672
694
|
height?: number | string;
|
|
@@ -677,7 +699,6 @@ interface XYPadAreaProps {
|
|
|
677
699
|
/** inherit */
|
|
678
700
|
__thumb?: ReactElement;
|
|
679
701
|
}
|
|
680
|
-
/** @category XYPad */
|
|
681
702
|
declare function Area({
|
|
682
703
|
width,
|
|
683
704
|
height,
|
|
@@ -687,11 +708,9 @@ declare function Area({
|
|
|
687
708
|
style,
|
|
688
709
|
__thumb,
|
|
689
710
|
...props
|
|
690
|
-
}: XYPadAreaProps & Omit<ComponentPropsWithoutRef<'div'>, keyof XYPadAreaProps>):
|
|
691
|
-
//# sourceMappingURL=Area.d.ts.map
|
|
711
|
+
}: XYPadAreaProps & Omit<ComponentPropsWithoutRef<'div'>, keyof XYPadAreaProps>): _$react.JSX.Element;
|
|
692
712
|
//#endregion
|
|
693
713
|
//#region src/components/XYPad/Thumb.d.ts
|
|
694
|
-
/** @category XYPad */
|
|
695
714
|
interface XYPadThumbProps {
|
|
696
715
|
size?: number | string;
|
|
697
716
|
width?: number | string;
|
|
@@ -707,17 +726,14 @@ interface XYPadThumbProps {
|
|
|
707
726
|
/** @internal */
|
|
708
727
|
__css?: CSSProperties;
|
|
709
728
|
}
|
|
710
|
-
/** @category XYPad */
|
|
711
729
|
interface XYPadThumbMethods {
|
|
712
730
|
focus: () => void;
|
|
713
731
|
blur: () => void;
|
|
714
732
|
}
|
|
715
|
-
/** @category XYPad */
|
|
716
733
|
//#endregion
|
|
717
734
|
//#region src/components/XYPad/index.d.ts
|
|
718
735
|
/**
|
|
719
736
|
* Two-dimensional slider component.
|
|
720
|
-
* @category XYPad
|
|
721
737
|
*/
|
|
722
738
|
interface ValueOptions {
|
|
723
739
|
value: number;
|
|
@@ -735,11 +751,13 @@ interface ValueOptions {
|
|
|
735
751
|
*/
|
|
736
752
|
keyboard?: InputEventOption | null;
|
|
737
753
|
}
|
|
738
|
-
/** @category XYPad */
|
|
739
754
|
interface XYPadProps {
|
|
740
755
|
x: ValueOptions;
|
|
741
756
|
y: ValueOptions;
|
|
742
|
-
|
|
757
|
+
externalStyles?: {
|
|
758
|
+
userSelectNone?: boolean;
|
|
759
|
+
cursor?: Cursor;
|
|
760
|
+
};
|
|
743
761
|
disabled?: boolean;
|
|
744
762
|
readonly?: boolean;
|
|
745
763
|
onChange?: (valueX: number, valueY: number) => void;
|
|
@@ -748,86 +766,70 @@ interface XYPadProps {
|
|
|
748
766
|
/** \<XYPadThumb /> | \<XYPadArea /> */
|
|
749
767
|
children?: ReactElement | ReactElement[];
|
|
750
768
|
}
|
|
751
|
-
/** @category XYPad */
|
|
752
769
|
interface XYPadMethods {
|
|
753
770
|
focus: () => void;
|
|
754
771
|
blur: () => void;
|
|
772
|
+
original: Ref<HTMLDivElement>;
|
|
755
773
|
}
|
|
756
774
|
/**
|
|
757
775
|
* Simple XYPad
|
|
758
|
-
* @category XYPad
|
|
759
776
|
*/
|
|
760
|
-
declare const XYPad:
|
|
777
|
+
declare const XYPad: {
|
|
778
|
+
Root: React$1.ForwardRefExoticComponent<XYPadProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof XYPadProps> & React$1.RefAttributes<XYPadMethods>>;
|
|
761
779
|
Thumb: React$1.ForwardRefExoticComponent<XYPadThumbProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof XYPadThumbProps> & React$1.RefAttributes<XYPadThumbMethods>>;
|
|
762
780
|
Area: typeof Area;
|
|
763
781
|
};
|
|
764
782
|
//#endregion
|
|
765
783
|
//#region src/hooks/useAnimationFrame.d.ts
|
|
766
|
-
/**
|
|
767
|
-
* @category hooks
|
|
768
|
-
*/
|
|
769
784
|
declare function useAnimationFrame(callback?: () => void, deps?: DependencyList): void;
|
|
770
|
-
//# sourceMappingURL=useAnimationFrame.d.ts.map
|
|
771
785
|
//#endregion
|
|
772
786
|
//#region src/hooks/useDrag.d.ts
|
|
773
787
|
interface UseDragProps {
|
|
774
788
|
threshold?: number;
|
|
775
|
-
onDrag
|
|
789
|
+
onDrag?: (x: number, y: number, deltaX: number, deltaY: number) => void;
|
|
776
790
|
onDragStart?: () => void;
|
|
777
791
|
onDragEnd?: () => void;
|
|
778
792
|
}
|
|
779
793
|
/**
|
|
780
|
-
* @category hooks
|
|
781
794
|
* @returns [refCallback, pointerDownHandler]
|
|
782
795
|
*/
|
|
783
796
|
declare function useDrag<T extends Element>({
|
|
784
|
-
threshold,
|
|
797
|
+
threshold: _threshold,
|
|
785
798
|
onDrag,
|
|
786
799
|
onDragStart,
|
|
787
800
|
onDragEnd
|
|
788
801
|
}: UseDragProps): [(div: EventTarget | null) => void, (event: React.PointerEvent<T>) => void];
|
|
789
802
|
//#endregion
|
|
790
803
|
//#region src/hooks/useDragWithElement.d.ts
|
|
791
|
-
interface
|
|
804
|
+
interface UseDragWithElement<T extends Element> {
|
|
792
805
|
baseElementRef: RefObject<T | null>;
|
|
793
806
|
onDrag: (normalizedX: number, normalizedY: number) => void;
|
|
794
807
|
onDragStart?: (normalizedX: number, normalizedY: number) => void;
|
|
795
808
|
onDragEnd?: (normalizedX: number, normalizedY: number) => void;
|
|
796
809
|
}
|
|
797
|
-
/**
|
|
798
|
-
* @category hooks
|
|
799
|
-
* @returns [refCallback, pointerDownHandler]
|
|
800
|
-
*/
|
|
801
810
|
declare function useDragWithElement<T extends Element>({
|
|
802
811
|
baseElementRef,
|
|
803
812
|
onDrag,
|
|
804
813
|
onDragStart,
|
|
805
814
|
onDragEnd
|
|
806
|
-
}:
|
|
815
|
+
}: UseDragWithElement<T>): {
|
|
816
|
+
refHandler: (div: EventTarget | null) => void;
|
|
817
|
+
pointerDownHandler: (event: React.PointerEvent<T>) => void;
|
|
818
|
+
dragging: boolean;
|
|
819
|
+
};
|
|
807
820
|
//#endregion
|
|
808
821
|
//#region src/hooks/useEventListener.d.ts
|
|
809
822
|
type Target = EventTarget | null | (() => EventTarget | null);
|
|
810
823
|
type Options = boolean | AddEventListenerOptions;
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
declare function useEventListener<K extends keyof DocumentEventMap>(target: Target, event: K, handler?: (event: DocumentEventMap[K]) => void, options?: Options): VoidFunction;
|
|
815
|
-
declare function useEventListener<K extends keyof WindowEventMap>(target: Target, event: K, handler?: (event: WindowEventMap[K]) => void, options?: Options): VoidFunction;
|
|
816
|
-
declare function useEventListener<K extends keyof GlobalEventHandlersEventMap>(target: Target, event: K, handler?: (event: GlobalEventHandlersEventMap[K]) => void, options?: Options): VoidFunction;
|
|
824
|
+
declare function useEventListener<K extends keyof DocumentEventMap>(target: Target, event: K, handler: (event: DocumentEventMap[K]) => void, options?: Options): VoidFunction;
|
|
825
|
+
declare function useEventListener<K extends keyof WindowEventMap>(target: Target, event: K, handler: (event: WindowEventMap[K]) => void, options?: Options): VoidFunction;
|
|
826
|
+
declare function useEventListener<K extends keyof GlobalEventHandlersEventMap>(target: Target, event: K, handler: (event: GlobalEventHandlersEventMap[K]) => void, options?: Options): VoidFunction;
|
|
817
827
|
//#endregion
|
|
818
828
|
//#region src/hooks/useInterval.d.ts
|
|
819
|
-
/**
|
|
820
|
-
* @category hooks
|
|
821
|
-
*/
|
|
822
829
|
declare function useInterval(callback: () => void, delay: number | null): void;
|
|
823
|
-
//# sourceMappingURL=useInterval.d.ts.map
|
|
824
830
|
//#endregion
|
|
825
831
|
//#region src/hooks/useLongPress.d.ts
|
|
826
|
-
/**
|
|
827
|
-
* @category hooks
|
|
828
|
-
*/
|
|
829
832
|
declare function useLongPress(callback: () => void, initialDelay?: number, interval?: number): () => void;
|
|
830
|
-
//# sourceMappingURL=useLongPress.d.ts.map
|
|
831
833
|
//#endregion
|
|
832
834
|
//#region src/hooks/useMIDIAccess.d.ts
|
|
833
835
|
/** @private */
|
|
@@ -838,31 +840,24 @@ declare const NOT_SUPPORTED = "NOT_SUPPORTED";
|
|
|
838
840
|
type MIDIAccessError = typeof PERMISSION_DENIED | typeof NOT_SUPPORTED;
|
|
839
841
|
/**
|
|
840
842
|
* Hooks for requesting MIDI access in the browser. The first argument allows you to choose whether to request access on mount.
|
|
841
|
-
* @category hooks
|
|
842
843
|
*/
|
|
843
844
|
declare function useMIDIAccess(requestOnMount?: boolean): {
|
|
844
845
|
request: () => void;
|
|
845
846
|
midiAccess: MIDIAccess | null;
|
|
846
847
|
error: MIDIAccessError | null;
|
|
847
848
|
};
|
|
848
|
-
//# sourceMappingURL=useMIDIAccess.d.ts.map
|
|
849
849
|
//#endregion
|
|
850
850
|
//#region src/hooks/useMIDIInput.d.ts
|
|
851
851
|
/**
|
|
852
852
|
* Hooks for handling note on/off events. To be used with useMIDIAccess. Internally uses useMIDIMessage.
|
|
853
|
-
* @category hooks
|
|
854
853
|
*/
|
|
855
854
|
declare function useMIDIInput(midiAccess: MIDIAccess | null, onNoteOnEvent?: (note: number, velocity: number) => void, onNoteOffEvent?: (note: number) => void, onPitchBendEvent?: (msb: number, lsb: number) => void): void;
|
|
856
|
-
//# sourceMappingURL=useMIDIInput.d.ts.map
|
|
857
855
|
//#endregion
|
|
858
856
|
//#region src/hooks/useMIDIMessage.d.ts
|
|
859
857
|
/**
|
|
860
858
|
* Hooks for when you want to process MIDI events in more detail than useMIDIInput.
|
|
861
|
-
* @category hooks
|
|
862
859
|
*/
|
|
863
860
|
declare function useMIDIMessage(midiAccess: MIDIAccess | null, onMIDIMessage: (event: MIDIMessageEvent) => void): void;
|
|
864
|
-
//# sourceMappingURL=useMIDIMessage.d.ts.map
|
|
865
|
-
|
|
866
861
|
//#endregion
|
|
867
|
-
export { type AbsoluteSizingProps, AnimationCanvas, type AnimationCanvasProps,
|
|
862
|
+
export { type AbsoluteSizingProps, AnimationCanvas, type AnimationCanvasProps, type CommonProps, type DecrementStepperProps, DragObserver, type DragObserverProps, type DrawFunction, type IncrementStepperProps, type InitFunction, type KeyLabelProps, type KeyMethods, type KeyProps, type KeyboardShortcuts, Knob, type KnobMethods, type KnobProps, type MIDIAccessError, NOT_SUPPORTED, NumberInput, type NumberInputMethods, type NumberInputProps, PERMISSION_DENIED, Piano, type PianoMethods, type PianoProps, type PointBaseType, type PointProps, PointsEditor, type PointsEditorProps, type RelativeSizingProps, SHORTCUTS, type ScaleOptionProps, type ScaleProps, Slider, type SliderMethods, type SliderProps, type SliderThumbMethods, type SliderThumbProps, type SliderTrackProps, type StepperProps, type ValueOptions, WheelObserver, type WheelObserverProps, XYPad, type XYPadAreaProps, type XYPadMethods, type XYPadProps, type XYPadThumbMethods, type XYPadThumbProps, clampPoint, getNoteRangeArray, useAnimationFrame, useDrag, useDragWithElement, useEventListener, useInterval, useLongPress, useMIDIAccess, useMIDIInput, useMIDIMessage, useSliderContext };
|
|
868
863
|
//# sourceMappingURL=index.d.ts.map
|