@vsreact/core 0.0.15 → 0.0.16
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/README.md +98 -0
- package/dist/controls.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
- package/src/controls.tsx +3 -0
- package/src/index.ts +3 -0
- package/src/perform.test.tsx +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @vsreact/core
|
|
2
|
+
|
|
3
|
+
**Write React. Ship native VST.**
|
|
4
|
+
|
|
5
|
+
VSReacT is a React renderer for JUCE audio plugins — your UI runs in
|
|
6
|
+
QuickJS inside the plugin, lays out with Yoga, and paints with
|
|
7
|
+
`juce::Graphics`. No webview, no browser, no Electron. Real threads,
|
|
8
|
+
real automation gestures, hot reload in your DAW.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { render, View, Text, ParamKnob } from "@vsreact/core";
|
|
12
|
+
|
|
13
|
+
function App() {
|
|
14
|
+
return (
|
|
15
|
+
<View className="w-full h-full items-center justify-center gap-5">
|
|
16
|
+
<Text className="text-text text-[15] font-bold tracking-widest">MY PLUGIN</Text>
|
|
17
|
+
<View className="flex-row gap-10">
|
|
18
|
+
<ParamKnob paramId="gain" size={88} />
|
|
19
|
+
<ParamKnob paramId="pan" size={88} bipolar />
|
|
20
|
+
</View>
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
render(<App />);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
That's a working plugin UI: knobs bound to APVTS parameters, drag /
|
|
29
|
+
wheel / double-click-reset, automation-safe begin/set/end gestures.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
bun add @vsreact/core # or npm / yarn / pnpm
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The native side is a JUCE module fetched with CMake — see the
|
|
38
|
+
[installation guide](https://vsreact.n9records.com/docs/installation).
|
|
39
|
+
|
|
40
|
+
## What's in the box
|
|
41
|
+
|
|
42
|
+
**Parameter controls** — `Knob`, `Slider`, `Toggle`, `XYPad`,
|
|
43
|
+
`Segmented`, `Select`, `NumberBox`, `Checkbox`, `RadioGroup`,
|
|
44
|
+
`HardwareKnob`, `MacroPad`, `Crossfader` — each with a `Param*` twin
|
|
45
|
+
that binds to a host parameter in one line, and `GenericEditor`, the
|
|
46
|
+
one-line editor for your whole parameter list.
|
|
47
|
+
|
|
48
|
+
**Synth & performance** — `PianoKeyboard` (glissando, held notes),
|
|
49
|
+
`StepSequencer`, `ADSREnvelope` (four-corner editor), `PitchBend`,
|
|
50
|
+
`ModWheel`, `EQCurve` (real RBJ biquad response with draggable band
|
|
51
|
+
nodes).
|
|
52
|
+
|
|
53
|
+
**Meters & visualizers** — `Meter` (peak-hold, hot zone, reverse for
|
|
54
|
+
gain reduction), `RingMeter`, `Bars`, `Waveform`, `PulseOrb`.
|
|
55
|
+
|
|
56
|
+
**Structure & feedback** — `Tabs`, `Disclosure`, `Button`, `Tooltip`,
|
|
57
|
+
`Modal`, `ProgressBar` (determinate + indeterminate), `Spinner`.
|
|
58
|
+
|
|
59
|
+
**Hooks** — `useParameter`, `useParameterList`, `useNativeEvent`,
|
|
60
|
+
`useNativeValue`, `useSpring`, `useTween`, `usePeakHold`,
|
|
61
|
+
`useRollingBuffer`, `useDebounced`, `useThrottled`, `useInterval`,
|
|
62
|
+
`useHover`, `useToggle`, `usePrevious`, `useLayoutRect`, `useOverlay`.
|
|
63
|
+
|
|
64
|
+
**Utilities** — a Tailwind-subset `className` engine with theme
|
|
65
|
+
tokens, `cx`, value formatters (`formatDb`, `formatHz`, `formatMs`,
|
|
66
|
+
`formatPercent`, `formatSemitones`, `midiNoteName`, `midiNoteToHz`),
|
|
67
|
+
and the pure math behind the components (`adsrLevelAt`,
|
|
68
|
+
`biquadMagnitudeDb`, `eqResponseDb`, `snapToStep`, `mapRange`).
|
|
69
|
+
|
|
70
|
+
## How it works
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
React (QuickJS) ──mutations──▶ C++ shadow tree ──Yoga──▶ juce::Graphics
|
|
74
|
+
▲ │
|
|
75
|
+
└────────────── events, parameters, native calls ────────┘
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Your bundle runs in QuickJS with a custom react-reconciler that
|
|
79
|
+
streams JSON mutations to a C++ shadow tree. Yoga computes layout,
|
|
80
|
+
JUCE paints, and input events flow back. Parameters ride
|
|
81
|
+
`vsreact::ParameterBridge`; anything else rides `native.call()` /
|
|
82
|
+
`useNativeEvent`.
|
|
83
|
+
|
|
84
|
+
- **Hot reload**: point the native side at your bundle file and it
|
|
85
|
+
reloads on save — inside the DAW.
|
|
86
|
+
- **Automation-safe**: every control opens proper begin/set/end
|
|
87
|
+
gestures.
|
|
88
|
+
- **No webview**: the UI is painted by the same process and toolkit as
|
|
89
|
+
the rest of your plugin.
|
|
90
|
+
|
|
91
|
+
## Docs
|
|
92
|
+
|
|
93
|
+
- Site & component gallery: <https://vsreact.n9records.com/components>
|
|
94
|
+
- Quick start: <https://vsreact.n9records.com/docs/quick-start>
|
|
95
|
+
- Full docs: <https://vsreact.n9records.com/docs>
|
|
96
|
+
- Analytics add-on: [`@vsreact/posthog`](https://www.npmjs.com/package/@vsreact/posthog)
|
|
97
|
+
|
|
98
|
+
MIT © N9 Records Technologies
|
package/dist/controls.d.ts
CHANGED
|
@@ -85,6 +85,9 @@ export declare function Toggle({ on, label, offLabel, onLabel, size, disabled, t
|
|
|
85
85
|
export interface ParamToggleProps {
|
|
86
86
|
paramId: string;
|
|
87
87
|
label?: string;
|
|
88
|
+
/** Hardware-style side captions, forwarded to Toggle. */
|
|
89
|
+
offLabel?: string;
|
|
90
|
+
onLabel?: string;
|
|
88
91
|
size?: number;
|
|
89
92
|
trackColor?: string;
|
|
90
93
|
onColor?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "./runtime";
|
|
2
2
|
import "./bridge";
|
|
3
|
+
/** The SDK version — stamp it on support dumps and analytics. */
|
|
4
|
+
export declare const VERSION = "0.0.16";
|
|
3
5
|
export { View, Text, Image, TextInput, NativeView } from "./primitives";
|
|
4
6
|
export type { CommonProps, TextProps, ImageProps, TextInputProps, NativeViewProps, } from "./primitives";
|
|
5
7
|
export { render, unmount } from "./render";
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// timer/console/microtask shims react depends on inside QuickJS.
|
|
3
3
|
import "./runtime";
|
|
4
4
|
import "./bridge";
|
|
5
|
+
/** The SDK version — stamp it on support dumps and analytics. */
|
|
6
|
+
export const VERSION = "0.0.16";
|
|
5
7
|
export { View, Text, Image, TextInput, NativeView } from "./primitives";
|
|
6
8
|
export { render, unmount } from "./render";
|
|
7
9
|
export { native } from "./native";
|
package/package.json
CHANGED
package/src/controls.tsx
CHANGED
|
@@ -388,6 +388,9 @@ export function Toggle({
|
|
|
388
388
|
export interface ParamToggleProps {
|
|
389
389
|
paramId: string;
|
|
390
390
|
label?: string;
|
|
391
|
+
/** Hardware-style side captions, forwarded to Toggle. */
|
|
392
|
+
offLabel?: string;
|
|
393
|
+
onLabel?: string;
|
|
391
394
|
size?: number;
|
|
392
395
|
trackColor?: string;
|
|
393
396
|
onColor?: string;
|
package/src/index.ts
CHANGED
package/src/perform.test.tsx
CHANGED
|
@@ -10,6 +10,7 @@ const batches: unknown[][][] = [];
|
|
|
10
10
|
import {
|
|
11
11
|
render,
|
|
12
12
|
unmount,
|
|
13
|
+
VERSION,
|
|
13
14
|
PianoKeyboard,
|
|
14
15
|
StepSequencer,
|
|
15
16
|
ProgressBar,
|
|
@@ -41,6 +42,12 @@ beforeEach(() => {
|
|
|
41
42
|
batches.length = 0;
|
|
42
43
|
});
|
|
43
44
|
|
|
45
|
+
describe("VERSION", () => {
|
|
46
|
+
test("matches the package version", () => {
|
|
47
|
+
expect(VERSION).toBe(require("../package.json").version);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
44
51
|
describe("format", () => {
|
|
45
52
|
test("formatDb signs and floors", () => {
|
|
46
53
|
expect(formatDb(6)).toBe("+6.0 dB");
|