@vsreact/core 0.0.15 → 0.0.17

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 ADDED
@@ -0,0 +1,107 @@
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
+ Starting fresh? The scaffolder gives you a complete plugin project —
34
+ CMake, C++, and a React UI — in one command:
35
+
36
+ ```sh
37
+ bun create vsreact my-plugin # or: npm create vsreact@latest my-plugin
38
+ ```
39
+
40
+ Adding to an existing plugin:
41
+
42
+ ```sh
43
+ bun add @vsreact/core # or npm / yarn / pnpm
44
+ ```
45
+
46
+ The native side is a JUCE module fetched with CMake — see the
47
+ [installation guide](https://vsreact.n9records.com/docs/installation).
48
+
49
+ ## What's in the box
50
+
51
+ **Parameter controls** — `Knob`, `Slider`, `Toggle`, `XYPad`,
52
+ `Segmented`, `Select`, `NumberBox`, `Checkbox`, `RadioGroup`,
53
+ `HardwareKnob`, `MacroPad`, `Crossfader` — each with a `Param*` twin
54
+ that binds to a host parameter in one line, and `GenericEditor`, the
55
+ one-line editor for your whole parameter list.
56
+
57
+ **Synth & performance** — `PianoKeyboard` (glissando, held notes),
58
+ `StepSequencer`, `ADSREnvelope` (four-corner editor), `PitchBend`,
59
+ `ModWheel`, `EQCurve` (real RBJ biquad response with draggable band
60
+ nodes).
61
+
62
+ **Meters & visualizers** — `Meter` (peak-hold, hot zone, reverse for
63
+ gain reduction), `RingMeter`, `Bars`, `Waveform`, `PulseOrb`.
64
+
65
+ **Structure & feedback** — `Tabs`, `Disclosure`, `Button`, `Tooltip`,
66
+ `Modal`, `ProgressBar` (determinate + indeterminate), `Spinner`.
67
+
68
+ **Hooks** — `useParameter`, `useParameterList`, `useNativeEvent`,
69
+ `useNativeValue`, `useSpring`, `useTween`, `usePeakHold`,
70
+ `useRollingBuffer`, `useDebounced`, `useThrottled`, `useInterval`,
71
+ `useHover`, `useToggle`, `usePrevious`, `useLayoutRect`, `useOverlay`.
72
+
73
+ **Utilities** — a Tailwind-subset `className` engine with theme
74
+ tokens, `cx`, value formatters (`formatDb`, `formatHz`, `formatMs`,
75
+ `formatPercent`, `formatSemitones`, `midiNoteName`, `midiNoteToHz`),
76
+ and the pure math behind the components (`adsrLevelAt`,
77
+ `biquadMagnitudeDb`, `eqResponseDb`, `snapToStep`, `mapRange`).
78
+
79
+ ## How it works
80
+
81
+ ```
82
+ React (QuickJS) ──mutations──▶ C++ shadow tree ──Yoga──▶ juce::Graphics
83
+ ▲ │
84
+ └────────────── events, parameters, native calls ────────┘
85
+ ```
86
+
87
+ Your bundle runs in QuickJS with a custom react-reconciler that
88
+ streams JSON mutations to a C++ shadow tree. Yoga computes layout,
89
+ JUCE paints, and input events flow back. Parameters ride
90
+ `vsreact::ParameterBridge`; anything else rides `native.call()` /
91
+ `useNativeEvent`.
92
+
93
+ - **Hot reload**: point the native side at your bundle file and it
94
+ reloads on save — inside the DAW.
95
+ - **Automation-safe**: every control opens proper begin/set/end
96
+ gestures.
97
+ - **No webview**: the UI is painted by the same process and toolkit as
98
+ the rest of your plugin.
99
+
100
+ ## Docs
101
+
102
+ - Site & component gallery: <https://vsreact.n9records.com/components>
103
+ - Quick start: <https://vsreact.n9records.com/docs/quick-start>
104
+ - Full docs: <https://vsreact.n9records.com/docs>
105
+ - Analytics add-on: [`@vsreact/posthog`](https://www.npmjs.com/package/@vsreact/posthog)
106
+
107
+ MIT © N9 Records Technologies
@@ -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.17";
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.17";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vsreact/core",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "Write React. Ship native VST. A React renderer for JUCE audio plugins — QuickJS + Yoga + juce::Graphics, no webview.",
5
5
  "keywords": [
6
6
  "react",
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
@@ -3,6 +3,9 @@
3
3
  import "./runtime";
4
4
  import "./bridge";
5
5
 
6
+ /** The SDK version — stamp it on support dumps and analytics. */
7
+ export const VERSION = "0.0.17";
8
+
6
9
  export { View, Text, Image, TextInput, NativeView } from "./primitives";
7
10
  export type {
8
11
  CommonProps,
@@ -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");