cabbage-react 1.0.28 → 1.0.30

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Cabbage React
2
2
 
3
- Cabbage React provides React hooks for synchronizing [Cabbage](https://cabbageaudio.com) with [React](https://github.com/facebook/react), making it easier to build a custom UI that communicates with the Cabbage host.
3
+ Cabbage React provides React hooks for synchronizing [Cabbage](https://cabbageaudio.com) with [React](https://github.com/facebook/react), making it easier to build a custom UI that communicates with the Cabbage backend.
4
4
 
5
5
  ## Example Project
6
6
 
@@ -18,19 +18,18 @@ npm install cabbage-react
18
18
 
19
19
  ### useCabbageState
20
20
 
21
- Synchronize a parameter with Cabbage. This hook:
21
+ Synchronize a parameter with the backend. This hook:
22
22
 
23
- - Identifies and sets the default value defined in Cabbage to a state.
23
+ - Identifies and sets the default value defined in .csd to a state.
24
24
  - Handles initialization when opening an existing session, or reopening the plugin window.
25
25
  - Listens for value updates from the host (DAW), or from Csound.
26
- - Sends changes back to Cabbage when using the provided value-setter.
26
+ - Sends changes to the backend using the provided value-setter.
27
27
 
28
28
  ### useCabbageProperties
29
29
 
30
- Get properties for a parameter from Cabbage.
31
- This hook:
30
+ Get properties for a parameter from the backend. This hook:
32
31
 
33
- - Listens for property updates from Cabbage.
32
+ - Listens for property updates from the backend.
34
33
  - Updates local state automatically when data changes.
35
34
 
36
35
  ## Usage
@@ -41,22 +40,17 @@ import { useCabbageProperties, useCabbageState } from "cabbage-react";
41
40
 
42
41
  const HorizontalSlider = ({
43
42
  channelId,
44
- parameterIndex,
45
43
  inputProps,
46
44
  }: {
47
45
  channelId: string;
48
- parameterIndex: number;
49
46
  inputProps?: InputHTMLAttributes<HTMLInputElement>;
50
47
  }) => {
51
48
  const { properties } = useCabbageProperties(channelId);
52
49
  const channelProperties = properties?.channels.find(
53
- (c: any) => c.id === channelId
50
+ (c: any) => c.id === channelId,
54
51
  );
55
52
 
56
- const { value, setValue } = useCabbageState<number>(
57
- channelId,
58
- parameterIndex
59
- );
53
+ const { value, setValue } = useCabbageState<number>(channelId);
60
54
 
61
55
  return (
62
56
  <div>
@@ -89,7 +83,7 @@ export default HorizontalSlider;
89
83
 
90
84
  ## Interact directly with Cabbage
91
85
 
92
- You can also import the [Cabbage class](https://github.com/hdale94/cabbage-react/blob/main/src/cabbage/cabbage.js) to send custom messages or interact directly with Cabbage.
86
+ You can also import the [Cabbage class](https://github.com/hdale94/cabbage-react/blob/main/src/cabbage/cabbage.js) to send custom messages or interact directly with the backend.
93
87
 
94
88
  ## Notify Cabbage When UI Is Ready
95
89
 
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Custom hook to get a parameter's properties from Cabbage.
3
- * This hook listens for updates to parameter properties via Cabbage and updates the local state
2
+ * Custom hook to get a parameter's properties from Cabbage backend.
3
+ * This hook listens for updates to parameter properties from the backend and updates the local state
4
4
  * whenever new data is received.
5
5
  * @param channelId - The channel name
6
6
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Custom hook to sync a parameter with Cabbage.
3
- * This hook listens for updates to a parameter value from Cabbage and
4
- * sends updates to Cabbage when the parameter value changes locally (e.g., through a UI slider).
2
+ * Custom hook to sync a parameter with Cabbage backend.
3
+ * This hook listens for updates to a parameter value from the backend and
4
+ * sends updates to the backend when the parameter value changes locally (e.g., through a UI slider).
5
5
  * @param channelId - The channel name
6
6
  * @param gesture - The gesture type: "begin" (start of interaction), "value" (during interaction), "end" (end of continuous interaction), or "complete" (discrete action e.g. button click).
7
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cabbage-react",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "cabbage",